# The name of our project is "inVRs". CMakeLists files in this project can # refer to the root source directory of the project as ${inVRs_SOURCE_DIR} and # to the root binary directory of the project as ${inVRs_BINARY_DIR}. cmake_minimum_required (VERSION 2.6) project (INVRS) if (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4) set (CMAKE_VERSION_24 TRUE) endif (CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) set (CMAKE_INSTALL_PREFIX ${INVRS_SOURCE_DIR} CACHE PATH "inVRs install prefix" FORCE) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) option (INVRS_ENABLE_TESTING "Enable CTest test-drivers functionality checks in inVRs." OFF) if ( INVRS_ENABLE_TESTING ) enable_testing() endif ( INVRS_ENABLE_TESTING ) set (INVRS_TARGET_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib) set (INVRS_TARGET_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include) set (INVRS_TARGET_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin) set (INVRS_TARGET_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/inVRs) include (${INVRS_SOURCE_DIR}/cmake/config.cmake) # save INVRS_EXPORT_* definitions, so another project can use them: list ( APPEND INVRS_EXPORT_LIBRARY_DIRS ${INVRS_TARGET_LIB_DIR} ) list ( APPEND INVRS_EXPORT_INCLUDE_DIRS ${INVRS_TARGET_INCLUDE_DIR} ) list ( APPEND INVRS_EXPORT_INCLUDE_DIRS ${INVRS_TARGET_INCLUDE_DIR}/irrXML ) list ( APPEND INVRS_EXPORT_INCLUDE_DIRS ${INVRS_TARGET_INCLUDE_DIR}/inVRs/tools/libraries ) if (INVRS_EXPORT_INCLUDE_DIRS AND NOT CMAKE_VERSION_24) list ( REMOVE_DUPLICATES INVRS_EXPORT_INCLUDE_DIRS ) endif (INVRS_EXPORT_INCLUDE_DIRS AND NOT CMAKE_VERSION_24) if (INVRS_EXPORT_LIBRARY_DIRS AND NOT CMAKE_VERSION_24) list ( REMOVE_DUPLICATES INVRS_EXPORT_LIBRARY_DIRS ) endif (INVRS_EXPORT_LIBRARY_DIRS AND NOT CMAKE_VERSION_24) if (INVRS_EXPORT_DEFINITIONS AND NOT CMAKE_VERSION_24) list ( REMOVE_DUPLICATES INVRS_EXPORT_DEFINITIONS ) endif (INVRS_EXPORT_DEFINITIONS AND NOT CMAKE_VERSION_24) if (INVRS_EXPORT_LIBRARIES AND NOT CMAKE_VERSION_24) list ( REMOVE_DUPLICATES INVRS_EXPORT_LIBRARIES ) endif (INVRS_EXPORT_LIBRARIES AND NOT CMAKE_VERSION_24) set ( INVRS_EXPORTS_FILE "${CMAKE_CURRENT_BINARY_DIR}/config_inVRs.cmake" ) macro(INVRS_ADD_EXPORTS _module ) file ( APPEND ${INVRS_EXPORTS_FILE} "\n# definitions from ${CMAKE_CURRENT_SOURCE_DIR}:\n" ) foreach ( var INCLUDE_DIRS LIBRARY_DIRS DEFINITIONS LIBRARIES ) file ( APPEND ${INVRS_EXPORTS_FILE} "set (INVRS_EXPORT_${_module}_${var} \"${INVRS_EXPORT_${_module}_${var}}\" )\n" ) endforeach( var INCLUDE_DIRS LIBRARY_DIRS DEFINITIONS LIBRARIES ) endmacro(INVRS_ADD_EXPORTS _module ) configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_inVRs.cmake.in" ${INVRS_EXPORTS_FILE} @ONLY ) install ( FILES ${INVRS_EXPORTS_FILE} DESTINATION ${INVRS_TARGET_INCLUDE_DIR}/inVRs) # Recurse into the defined subdirectories. This does not actually # cause another cmake executable to run. The same process will walk through # the project's entire directory structure. add_subdirectory (external) add_subdirectory (src/inVRs/SystemCore) add_subdirectory (src/inVRs/InputInterface/ControllerManager) add_subdirectory (src/inVRs/OutputInterface/OpenSGSceneGraphInterface) add_subdirectory (tools/libraries) add_subdirectory (tools/applications) add_subdirectory (src/inVRs/Modules) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake") # add documentation files to install: install( FILES Changelog.txt COPYING COPYING.LESSER LICENSE README DESTINATION ${INVRS_TARGET_DOC_DIR} )