diff --git a/cmake/macros.cmake b/cmake/macros.cmake index ee9d44da6..ac71abdea 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -20,11 +20,6 @@ #MESSAGE(STATUS "Processing ${CMAKE_CURRENT_SOURCE_DIR} ...") -# By default, we assume an "in-source" build. -IF(NOT DEFINED IN_SOURCETREE) - SET(IN_SOURCETREE TRUE) -ENDIF(NOT DEFINED IN_SOURCETREE) - # Setup the install prefix. IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) IF(WIN32) @@ -41,20 +36,6 @@ IF(NOT _ALREADY_DONE) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/splitargn.cmake) ENDIF(NOT _ALREADY_DONE) -# Include dir for config.h -IF(IN_SOURCETREE) - FIND_PATH(CONFIGH_INCLUDE_DIR config.h PATHS ${SOURCE_DIR} ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH) - FIND_PATH(CONFIGH_INCLUDE_DIR config.h PATHS ${SOURCE_DIR} ${CMAKE_BINARY_DIR}) - MARK_AS_ADVANCED(CONFIGH_INCLUDE_DIR) - IF(CONFIGH_INCLUDE_DIR) - SET(HAVE_CONFIG_H TRUE) - ELSE(CONFIGH_INCLUDE_DIR) - SET(HAVE_CONFIG_H FALSE) - ENDIF(CONFIGH_INCLUDE_DIR) -ELSE(IN_SOURCETREE) - SET(HAVE_CONFIG_H FALSE) -ENDIF(IN_SOURCETREE) - # Determine the default value of the user settings folder. IF(WIN32) SET(SD_LOCALDIR "~/speed-dreams-2.settings" CACHE STRING "Where the user settings files should go") @@ -321,6 +302,9 @@ MACRO(SD_GENERATE_CLOBBER_SCRIPT) ENDMACRO(SD_GENERATE_CLOBBER_SCRIPT) +ADD_COMPILE_DEFINITIONS(HAVE_CONFIG_H) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) + # Add non-default compile options. ADD_SD_COMPILE_OPTIONS() diff --git a/cmake/options.cmake b/cmake/options.cmake index 678995129..834c7bdfe 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -22,27 +22,6 @@ INCLUDE(CMakeDependentOption) MACRO(ADD_SD_COMPILE_OPTIONS) - # This has to be done more than once, because HAVE_CONFIG_H may change. - IF(HAVE_CONFIG_H) - - ADD_DEFINITIONS(-DHAVE_CONFIG_H) - - IF(IN_SOURCETREE) - SET(INCLUDE_CANDIDATE ${CMAKE_SOURCE_DIR}) - ELSE(IN_SOURCETREE) - SET(INCLUDE_CANDIDATE "") - ENDIF(IN_SOURCETREE) - FIND_PATH(CONFIGH_INCLUDE_DIR config.h ${INCLUDE_CANDIDATE} /usr/include /usr/local/include NO_DEFAULT_PATH) - FIND_PATH(CONFIGH_INCLUDE_DIR config.h ${INCLUDE_CANDIDATE} /usr/include /usr/local/include) - MARK_AS_ADVANCED(CONFIGH_INCLUDE_DIR) - IF(CONFIGH_INCLUDE_DIR) - INCLUDE_DIRECTORIES(${CONFIGH_INCLUDE_DIR}) - ELSE(CONFIGH_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "Cannot find config.h header file") - ENDIF(CONFIGH_INCLUDE_DIR) - - ENDIF(HAVE_CONFIG_H) - # Build options (do it only once). IF(NOT _ALREADY_DONE) diff --git a/cmake/robot.cmake b/cmake/robot.cmake index 74b62f955..875cd61c3 100644 --- a/cmake/robot.cmake +++ b/cmake/robot.cmake @@ -64,11 +64,7 @@ MACRO(GENERATE_ROBOT_DEF_FILE ROBOTNAME DEF_FILE) # Generate the .def file SET(ROBOT_NAME "${ROBOTNAME}") - IF(IN_SOURCETREE) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/robot.def.in.cmake ${DEF_FILE}) - ELSE(IN_SOURCETREE) - CONFIGURE_FILE(${SD_DATADIR}/cmake/robot.def.in.cmake ${DEF_FILE}) - ENDIF(IN_SOURCETREE) + CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/robot.def.in.cmake ${DEF_FILE}) ENDMACRO(GENERATE_ROBOT_DEF_FILE ROBOTNAME DEF_FILE)