PROJECT( IGSTK ) # Executables and libraries should just go to bin IF(NOT EXECUTABLE_OUTPUT_PATH) SET(EXECUTABLE_OUTPUT_PATH "${IGSTK}/bin" CACHE INTERNAL "Where to put the executables for IGSTK" ) ENDIF(NOT EXECUTABLE_OUTPUT_PATH) IF(NOT LIBRARY_OUTPUT_PATH) SET(LIBRARY_OUTPUT_PATH "${IGSTK}/bin" CACHE INTERNAL "Where to put the libraries for IGSTK" ) ENDIF(NOT LIBRARY_OUTPUT_PATH) # IGSTK uses fltk OPTION(IGSTK_USE_FLTK "Use FLTK (The Fast Light Toolkit) for GUI" ON) # The IGSTK Library SUBDIRS(Source) #----------------------------------------------------------------------------- # The entire IGSTK tree should use the same include path, except for the # Wrapping directory. # Create the list of include directories needed for IGSTK header files. INCLUDE(${IGSTK_SOURCE_DIR}/igstkIncludeDirectories.cmake) # This should be the only INCLUDE_DIRECTORIES command in the entire # tree, except for the Utilities and Wrapping directories. We need to # do this in one place to make sure the order is correct. INCLUDE_DIRECTORIES( ${ITK_DIR}/Utilities/zlib ${IGSTK_INCLUDE_DIRS_BUILD_TREE} ${IGSTK_INCLUDE_DIRS_BUILD_TREE_CXX} ${IGSTK_INCLUDE_DIRS_SYSTEM} ) #----------------------------------------------------------------------------- # check for header files that we need INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) # for serial communication: termio.h or termios.h? CHECK_INCLUDE_FILE("termios.h" HAVE_TERMIOS_H) CHECK_INCLUDE_FILE("termio.h" HAVE_TERMIO_H) # Configure a header needed by igstkSystemInformation. CONFIGURE_FILE("${IGSTK_SOURCE_DIR}/igstkConfigure.h.in" "${IGSTK_BINARY_DIR}/igstkConfigure.h") #----------------------------------------------------------------------------- # define the right names for the serial devices according to operating system IF(WIN32) SET(IGSTK_SERIAL_PORT_0 "COM1:" CACHE STRING "Device name for serial port 0") SET(IGSTK_SERIAL_PORT_1 "COM2:" CACHE STRING "Device name for serial port 1") SET(IGSTK_SERIAL_PORT_2 "COM3:" CACHE STRING "Device name for serial port 2") SET(IGSTK_SERIAL_PORT_3 "COM4:" CACHE STRING "Device name for serial port 3") ELSE(WIN32) SET(IGSTK_SERIAL_PORT_0 "/dev/ttyS0" CACHE STRING "Device name for serial port 0") SET(IGSTK_SERIAL_PORT_1 "/dev/ttyS1" CACHE STRING "Device name for serial port 1") SET(IGSTK_SERIAL_PORT_2 "/dev/ttyUSB0" CACHE STRING "Device name for serial port 2") SET(IGSTK_SERIAL_PORT_3 "/dev/ttyUSB1" CACHE STRING "Device name for serial port 3") ENDIF(WIN32) MARK_AS_ADVANCED(IGSTK_SERIAL_PORT_0) MARK_AS_ADVANCED(IGSTK_SERIAL_PORT_1) MARK_AS_ADVANCED(IGSTK_SERIAL_PORT_2) MARK_AS_ADVANCED(IGSTK_SERIAL_PORT_3) #----------------------------------------------------------------------------- # Help other projects use IGSTK. SET(IGSTK_LIBRARY_PATH ${LIBRARY_OUTPUT_PATH}) # Copy the UseIGSTK.cmake file to the binary tree for backward compatability. CONFIGURE_FILE(${IGSTK_SOURCE_DIR}/UseIGSTK.cmake.in ${IGSTK_BINARY_DIR}/UseIGSTK.cmake COPYONLY IMMEDIATE) # Save the compiler settings so another project can import them. INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake) CMAKE_EXPORT_BUILD_SETTINGS(${IGSTK_BINARY_DIR}/IGSTKBuildSettings.cmake) INSTALL_FILES(/lib/InsightToolkit .cmake IGSTKBuildSettings) # Save library dependencies. EXPORT_LIBRARY_DEPENDENCIES(${IGSTK_BINARY_DIR}/IGSTKLibraryDepends.cmake) # Create the IGSTKConfig.cmake file containing the IGSTK configuration. INCLUDE (${IGSTK_SOURCE_DIR}/igstkGenerateIGSTKConfig.cmake) # Install some files. INSTALL_FILES(/include/InsightToolkit .h igstkConfigure) INSTALL_FILES(/lib/InsightToolkit .cmake UseIGSTK IGSTKLibraryDepends) #----------------------------------------------------------------------------- # Add compiler flags IGSTK needs to work on this platform. This must be # done AFTER the call to CMAKE_EXPORT_BUILD_SETTINGS. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IGSTK_REQUIRED_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGSTK_REQUIRED_CXX_FLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${IGSTK_REQUIRED_LINK_FLAGS}") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${IGSTK_REQUIRED_LINK_FLAGS}") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${IGSTK_REQUIRED_LINK_FLAGS}")