Changeset 2621 for code/branches/buildsystem2/cmake/BuildConfig.cmake
- Timestamp:
- Jan 29, 2009, 11:35:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/BuildConfig.cmake
r2618 r2621 35 35 # Sets where to find the external libraries like OgreMain.dll at runtime 36 36 # On Unix you should not have to change this at all. 37 IF(NOT ORXONOX_ LIBRARY_BIN_DIR)38 SET(ORXONOX_ LIBRARY_BIN_DIR${CMAKE_RUNTIME_OUTPUT_DIRECTORY})39 ENDIF(NOT ORXONOX_ LIBRARY_BIN_DIR)37 IF(NOT ORXONOX_RUNTIME_LIBRARY_DIRECTORY) 38 SET(ORXONOX_RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 39 ENDIF(NOT ORXONOX_RUNTIME_LIBRARY_DIRECTORY) 40 40 41 41 # Set Debug build to default when not having multi-config generator like msvc … … 54 54 55 55 OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)") 56 IF(EXTRA_WARNINGS)57 SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")58 ELSE(EXTRA_WARNINGS)59 SET(ORXONOX_WARNING_FLAGS "-Wall")60 ENDIF(EXTRA_WARNINGS)61 56 62 SET(ORXONOX_MEDIA_DIRECTORY "${CMAKE_SOURCE_DIR}/../media") 57 # Specify media directory 58 GET_FILENAME_COMPONENT(_media_path "${CMAKE_SOURCE_DIR}/../media" ABSOLUTE) 59 SET(ORXONOX_MEDIA_DIRECTORY ${_media_path} CACHE PATH 60 "Location of the media directory.") 61 IF(NOT EXISTS ${ORXONOX_MEDIA_DIRECTORY}) 62 MESSAGE(STATUS "Warning: The media directory does not exist ${ORXONOX_MEDIA_DIRECTORY}") 63 ENDIF(NOT EXISTS ${ORXONOX_MEDIA_DIRECTORY}) 64 63 65 # More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager 64 66 # Render systems may be optional, but at least one has to be found in FindOgre … … 78 80 79 81 ############## Compiler Config ################## 80 INCLUDE(BuildConfigGCC) 81 INCLUDE(BuildConfigMSVC) 82 # User can create his own file if required 83 IF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake) 84 INCLUDE(${CMAKE_BINARY_DIR}/BuildConfigUser) 85 ENDIF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake) 82 83 INCLUDE(FlagUtilities) 84 85 # Configure the compiler specific build options 86 IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC) 87 INCLUDE(BuildConfigGCC) 88 ELSEIF(MSVC) 89 INCLUDE(BuildConfigMSVC) 90 ELSE(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC) 91 MESSAGE(STATUS "Warning: Your compiler is not officially supported.") 92 ENDIF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC) 93 94 SET(BUILD_CONFIG_USER_SCRIPT "" CACHE FILEPATH 95 "Specify a CMake script if you wish to write your own build config. 96 See BuildConfigGCC.cmake or BuildConfigMSVC.cmake for examples.") 97 IF(BUILD_CONFIG_USER_SCRIPT) 98 IF(EXISTS ${CMAKE_MODULE_PATH}/${BUILD_CONFIG_USER_SCRIPT}.cmake) 99 INCLUDE(${BUILD_CONFIG_USER_SCRIPT}) 100 ELSEIF(EXISTS ${BUILD_CONFIG_USER_SCRIPT}) 101 INCLUDE(${BUILD_CONFIG_USER_SCRIPT}) 102 ELSEIF(EXISTS ${CMAKE_MODULE_PATH}/${BUILD_CONFIG_USER_SCRIPT}) 103 INCLUDE(${CMAKE_MODULE_PATH}/${BUILD_CONFIG_USER_SCRIPT}) 104 ENDIF(EXISTS ${CMAKE_MODULE_PATH}/${BUILD_CONFIG_USER_SCRIPT}.cmake) 105 ENDIF(BUILD_CONFIG_USER_SCRIPT) 86 106 87 107 … … 97 117 98 118 99 ####### ############ Macros ######################119 ####### Static/Dynamic linking defines ########## 100 120 101 # Also define macros to easily extend the compiler flags 102 # Additional argument is a condition 103 MACRO(ADD_CXX_FLAGS _flag _cond) 104 IF(${_cond}) 105 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}") 106 ENDIF(${_cond}) 107 ENDMACRO(ADD_CXX_FLAGS _flag) 108 MACRO(ADD_C_FLAGS _flag) 109 IF(${_cond}) 110 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}") 111 ENDIF(${_cond}) 112 ENDMACRO(ADD_C_FLAGS _flag) 121 # If no defines are specified, these libs get linked statically 122 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC) 123 ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 LINK_ENET_DYNAMIC) 124 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA_DYNAMIC) 125 ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC) 126 127 # If no defines are specified, these libs get linked dynamically 128 # You can change that optionally in the Cache. 129 ADD_COMPILER_FLAGS("-DCEGUI_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC) 130 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB" WIN32 NOT LINK_OGRE_DYNAMIC) 131 ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC)
Note: See TracChangeset
for help on using the changeset viewer.