C:\Users\Kawauchi\workspace_test\Affine\CMakeLists.txt C:\Users\Kawauchi\workspace_test\Affine_org\CMakeLists.txt
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
if(POLICY CMP0048) if(POLICY CMP0048)
 cmake_policy(SET CMP0048 OLD)  cmake_policy(SET CMP0048 OLD)
endif() endif()
   
project(Affine) project(Affine)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake") include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
set(PROJECT_VERSION 1.2.0 CACHE STRING "Affine version") set(PROJECT_VERSION 1.2.0 CACHE STRING "Affine version")
DISSECT_VERSION() DISSECT_VERSION()
set(PROJECT_DESCRIPTION "Affine image component") set(PROJECT_DESCRIPTION "Affine image component")
set(PROJECT_VENDOR "AIST") set(PROJECT_VENDOR "AIST")
set(PROJECT_AUTHOR "AIST") set(PROJECT_AUTHOR "AIST")
set(PROJECT_AUTHOR_SHORT "AIST") set(PROJECT_AUTHOR_SHORT "AIST")
   
set(PROJECT_MAINTAINER "Noriaki Ando <n-ando@aist.go.jp>")  
set(PROJECT_TYPE "c++/opencv-rtcs")  
   
# Add an "uninstall" target # Add an "uninstall" target
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in" CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
   "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)    "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET (${PROJECT_NAME}_uninstall "${CMAKE_COMMAND}" -P ADD_CUSTOM_TARGET (uninstall "${CMAKE_COMMAND}" -P
   "${PROJECT_BINARY_DIR}/uninstall_target.cmake")    "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
   
#option(BUILD_EXAMPLES "Build and install examples" OFF) #option(BUILD_EXAMPLES "Build and install examples" OFF)
option(BUILD_DOCUMENTATION "Build the documentation" OFF) option(BUILD_DOCUMENTATION "Build the documentation" ON)
#option(BUILD_TESTS "Build the tests" OFF) #option(BUILD_TESTS "Build the tests" OFF)
#option(BUILD_TOOLS "Build the tools" OFF) #option(BUILD_TOOLS "Build the tools" OFF)
option(BUILD_IDL "Build and install idl" ON) option(BUILD_IDL "Build and install idl" ON)
option(BUILD_SOURCES "Build and install sources" OFF) option(BUILD_SOURCES "Build and install sources" OFF)
   
option(STATIC_LIBS "Build static libraries" OFF) option(STATIC_LIBS "Build static libraries" OFF)
if(STATIC_LIBS) if(STATIC_LIBS)
   set(LIB_TYPE STATIC)    set(LIB_TYPE STATIC)
else(STATIC_LIBS) else(STATIC_LIBS)
   set(LIB_TYPE SHARED)    set(LIB_TYPE SHARED)
endif(STATIC_LIBS) endif(STATIC_LIBS)
   
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  # Mac OS X specific code   # Mac OS X specific code
  SET(CMAKE_CXX_COMPILER "g++")   SET(CMAKE_CXX_COMPILER "g++")
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   
   
# Set up installation directories # Set up installation directories
if(WIN32)  set(BIN_INSTALL_DIR "components/bin")
 set(INSTALL_PREFIX "components/${PROJECT_TYPE}") set(LIB_INSTALL_DIR "components/lib")
else(WIN32)  set(INC_INSTALL_DIR 
 set(OPENRTM_SHARE_PREFIX "share/openrtm-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")     "components/include/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}") 
 set(INSTALL_PREFIX "${OPENRTM_SHARE_PREFIX}/components/${PROJECT_TYPE}") set(SHARE_INSTALL_DIR 
endif(WIN32)     "components/share/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}") 
   
   
# Get necessary dependency information # Get necessary dependency information
find_package(OpenRTM) find_package(OpenRTM)
   
# Universal settings # Universal settings
#enable_testing() #enable_testing()
   
# Subdirectories # Subdirectories
add_subdirectory(cmake) add_subdirectory(cmake)
if(BUILD_DOCUMENTATION) if(BUILD_DOCUMENTATION)
   add_subdirectory(doc)    add_subdirectory(doc)
endif(BUILD_DOCUMENTATION) endif(BUILD_DOCUMENTATION)
   
#if(BUILD_EXAMPLES) #if(BUILD_EXAMPLES)
#    add_subdirectory(examples) #    add_subdirectory(examples)
#endif(BUILD_EXAMPLES) #endif(BUILD_EXAMPLES)
   
if(BUILD_IDL) if(BUILD_IDL)
   add_subdirectory(idl)    add_subdirectory(idl)
endif(BUILD_IDL) endif(BUILD_IDL)
   
add_subdirectory(include) add_subdirectory(include)
MAP_ADD_STR(headers  "include/" comp_hdrs) MAP_ADD_STR(headers  "include/" comp_hdrs)
add_subdirectory(src) add_subdirectory(src)
   
#if(BUILD_TESTS) #if(BUILD_TESTS)
#    add_subdirectory(test) #    add_subdirectory(test)
#endif(BUILD_TESTS) #endif(BUILD_TESTS)
   
#if(BUILD_TOOLS) #if(BUILD_TOOLS)
#    add_subdirectory(tools) #    add_subdirectory(tools)
#endif(BUILD_TOOLS) #endif(BUILD_TOOLS)
   
if(BUILD_SOURCES) if(BUILD_SOURCES)
   add_subdirectory(include)    add_subdirectory(include)
   add_subdirectory(src)    add_subdirectory(src)
endif(BUILD_SOURCES) endif(BUILD_SOURCES)
   
# Package creation # Package creation
# By default, do not warn when built on machines using only VS Express: # By default, do not warn when built on machines using only VS Express:
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
ENDIF() ENDIF()
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)
set(PROJECT_EXECUTABLES ${PROJECT_NAME_LOWER}Comp set(PROJECT_EXECUTABLES ${PROJECT_NAME_LOWER}Comp
   "${PROJECT_NAME_LOWER}Comp")    "${PROJECT_NAME_LOWER}Comp")
   
set(cpack_options "${PROJECT_BINARY_DIR}/cpack_options.cmake") set(cpack_options "${PROJECT_BINARY_DIR}/cpack_options.cmake")
   
configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in" configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
   ${cpack_options} @ONLY)    ${cpack_options} @ONLY)
   
set(CPACK_PROJECT_CONFIG_FILE ${cpack_options}) set(CPACK_PROJECT_CONFIG_FILE ${cpack_options})
include(${CPACK_PROJECT_CONFIG_FILE}) include(${CPACK_PROJECT_CONFIG_FILE})
include(CPack) include(CPack)