# Only execute commands if file was not included already if (NOT INVRS_CONFIG_CMAKE_LOADED) include (${INVRS_SOURCE_DIR}/user.cmake) if(WIN32) string(TOLOWER $ENV{COMPUTERNAME} COMPUTERNAME) elseif(UNIX) find_program(HOSTNAME_BIN NAMES hostname) exec_program(${HOSTNAME_BIN} ARGS OUTPUT_VARIABLE HOSTNAME) string(TOLOWER "${HOSTNAME}" COMPUTERNAME) endif(WIN32) include (${INVRS_SOURCE_DIR}/user.${COMPUTERNAME}.cmake OPTIONAL) # search for cmake modules in this directory: set (CMAKE_MODULE_PATH ${INVRS_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) # Set a default build type if no build type is set # (CACHE variables are only set if they don't already have a value) set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (Release/Debug)") # when first generating the cache, cache-variables are not instantly available (only at subsequent runs): if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) if ( NOT ${CMAKE_VERSION} VERSION_LESS "2.8" ) # cmake >= 2.8 provides combo-boxes: set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release Debug) endif ( NOT ${CMAKE_VERSION} VERSION_LESS "2.8" ) # Set the default install prefix to the inVRs directory if not already set in # user.cmake if (NOT INVRS_INSTALL_PREFIX) set (INVRS_INSTALL_PREFIX ${INVRS_SOURCE_DIR}) endif (NOT INVRS_INSTALL_PREFIX) ############################################################################### # Find IrrXML include path ############################################################################### set (IRRXML_INCLUDE_DIR ${INVRS_SOURCE_DIR}/external/irrxml-1.2/src) #will be installed into target dir which is already appended #list (APPEND INVRS_EXPORT_INCLUDE_DIRS ${INVRS_TARGET_INCLUDE_DIR}/irrxml ) include_directories(${IRRXML_INCLUDE_DIR}) ############################################################################### # Find GMTL include path ############################################################################### set (GMTL_INCLUDE_DIR ${INVRS_SOURCE_DIR}/external/gmtl-0.6.1) #will be installed into target dir which is already appended #can be skipped because the normal direcotry is already there #list (APPEND INVRS_EXPORT_INCLUDE_DIRS ${INVRS_TARGET_INCLUDE_DIR}) include_directories(${GMTL_INCLUDE_DIR}) # Set Compiler flags if (NOT WIN32) set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC ${USERDEFINED_CXX_FLAGS}") set (CMAKE_CXX_FLAGS_PROFILE ${CMAKE_CXX_FLAGS_PROFILE} "-O3 -g -DNDEBUG -fPIC ${USERDEFINED_CXX_FLAGS}") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} "-O3 -g -DNDEBUG -fPIC ${USERDEFINED_CXX_FLAGS}") list (APPEND INVRS_EXPORT_DEFINITIONS "-fPIC") else (NOT WIN32) if (UNIX) #mingw, cygwin etc. message (FATAL_ERROR "Found unsupported operating system: Only Windows and Linux systems are supported!") else (UNIX) add_definitions(-D_WINSOCKAPI_) endif (UNIX) endif (NOT WIN32) # set formatting for eclipse output if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") endif (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCXX) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") endif (CMAKE_COMPILER_IS_GNUCXX) ############################################################################### # inVRs include path ############################################################################### include_directories(${INVRS_SOURCE_DIR}/src) include_directories(${INVRS_SOURCE_DIR}/tools/libraries) # allow header-files to differ between build-time and installed-time # i.e. some header files use #ifdefs, which are then "baked" into a # separate header-file, which is only included when inVRs is installed: # #ifdef INVRS_BUILD_TIME # # include "config.h" # #endif add_definitions( -DINVRS_BUILD_TIME ) set (INVRS_CONFIG_CMAKE_LOADED ON) endif (NOT INVRS_CONFIG_CMAKE_LOADED)