Changeset 8351 for code/trunk/cmake
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (14 years ago)
- Location:
- code/trunk/cmake
- Files:
-
- 2 deleted
- 18 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/CompilerConfig.cmake
r5781 r8351 34 34 MESSAGE(STATUS "Warning: Your compiler is not officially supported.") 35 35 ENDIF() 36 37 SET(COMPILER_CONFIG_USER_SCRIPT "" CACHE FILEPATH38 "Specify a CMake script if you wish to write your own compiler config.39 See CompilerConfigGCC.cmake or CompilerConfigMSVC.cmake for examples.")40 IF(COMPILER_CONFIG_USER_SCRIPT)41 IF(EXISTS ${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})42 INCLUDE(${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})43 ENDIF()44 ENDIF(COMPILER_CONFIG_USER_SCRIPT) -
code/trunk/cmake/CompilerConfigGCC.cmake
r7458 r8351 26 26 INCLUDE(FlagUtilities) 27 27 INCLUDE(CompareVersionStrings) 28 INCLUDE(CheckCXXCompilerFlag) 28 29 29 30 # Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC … … 36 37 OUTPUT_VARIABLE GCC_VERSION 37 38 ) 38 39 # Complain about incompatibilities40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)41 IF(NOT _compare_result LESS 0)42 IF(${Boost_VERSION} LESS 103700)43 MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")44 ENDIF()45 ENDIF()46 47 # GCC may not support #pragma GCC system_header correctly when using48 # templates. According to Bugzilla, it was fixed March 07 but tests49 # have confirmed that GCC 4.0.0 does not pose a problem for our cases.50 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.0.0" _compare_result)51 IF(_compare_result LESS 0)52 SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)53 ENDIF()54 39 55 40 # GCC only supports PCH in versions 3.4 and above … … 72 57 73 58 # CMake doesn't seem to set the PIC flags right on certain 64 bit systems 74 IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")59 IF(NOT MINGW AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") 75 60 ADD_COMPILER_FLAGS("-fPIC" CACHE) 61 ENDIF() 62 63 # Enable non standard floating point optimisations 64 ADD_COMPILER_FLAGS("-ffast-math" CACHE) 65 66 # Use SSE if possible 67 # Commented because this might not work for cross compiling 68 #CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse) 69 #IF(_gcc_have_sse) 70 # ADD_COMPILER_FLAGS("-msse" CACHE) 71 #ENDIF() 72 73 IF(NOT MINGW) 74 # Have GCC visibility? 75 CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility) 76 IF(_gcc_have_visibility) 77 # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions 78 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result) 79 IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1) 80 ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE) 81 ENDIF() 82 ENDIF(_gcc_have_visibility) 76 83 ENDIF() 77 84 78 85 # We have some unconformant code, disable an optimisation feature 79 86 ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE) 80 81 # For GCC older than version 4, do not display sign compare warnings82 # because of boost::filesystem (which creates about a hundred per include)83 ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)84 87 85 88 # For newer GCC (4.3 and above), don't display hundreds of annoying deprecated … … 98 101 ENDIF() 99 102 100 # General linker flags 101 SET_LINKER_FLAGS("--no-undefined" CACHE) 103 # Linker flags 104 IF(LINUX) 105 # Don't allow undefined symbols in a shared library 106 SET_LINKER_FLAGS("-Wl,--no-undefined" CACHE) 107 ENDIF() 102 108 103 109 # Add compiler and linker flags for MinGW -
code/trunk/cmake/CompilerConfigMSVC.cmake
r7818 r8351 60 60 61 61 # Overwrite CMake default flags here for the individual configurations 62 SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -RTC1" Debug CACHE) 63 SET_COMPILER_FLAGS("-MD -O2 -DNDEBUG" Release CACHE) 64 SET_COMPILER_FLAGS("-MD -O2 -Zi -DNDEBUG" RelWithDebInfo CACHE) 65 SET_COMPILER_FLAGS("-MD -O1 -DNDEBUG" MinSizeRel CACHE) 66 ADD_COMPILER_FLAGS("-D_SECURE_SCL=0" MSVC9 ReleaseAll CACHE) 62 SET_COMPILER_FLAGS("-MDd -Od -Oi -Zi -D_DEBUG -RTC1" Debug CACHE) 63 SET_COMPILER_FLAGS("-MD -O2 -DNDEBUG" Release CACHE) 64 SET_COMPILER_FLAGS("-MD -O2 -Zi -DNDEBUG" RelWithDebInfo CACHE) 65 SET_COMPILER_FLAGS("-MD -O1 -DNDEBUG" MinSizeRel CACHE) 66 67 # Enable non standard floating point optimisations 68 ADD_COMPILER_FLAGS("-fp:fast" CACHE) 67 69 68 70 # Use Link time code generation for Release config if ORXONOX_RELEASE is defined -
code/trunk/cmake/InstallConfig.cmake
r7163 r8351 39 39 ENDIF() 40 40 41 # Default installation paths42 SET(RUNTIME_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})43 SET(LIBRARY_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})44 SET(ARCHIVE_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})45 SET(MODULE_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})46 SET(DOC_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})47 SET(DATA_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})48 SET(CONFIG_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})49 SET(LOG_INSTALL_DIRECTORY ${ CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})41 # Default relative installation paths 42 SET(RUNTIME_INSTALL_DIRECTORY ${DEFAULT_RUNTIME_PATH}) 43 SET(LIBRARY_INSTALL_DIRECTORY ${DEFAULT_LIBRARY_PATH}) 44 SET(ARCHIVE_INSTALL_DIRECTORY ${DEFAULT_ARCHIVE_PATH}) 45 SET(MODULE_INSTALL_DIRECTORY ${DEFAULT_MODULE_PATH}) 46 SET(DOC_INSTALL_DIRECTORY ${DEFAULT_DOC_PATH}) 47 SET(DATA_INSTALL_DIRECTORY ${DEFAULT_DATA_PATH}) 48 SET(CONFIG_INSTALL_DIRECTORY ${DEFAULT_CONFIG_PATH}) 49 SET(LOG_INSTALL_DIRECTORY ${DEFAULT_LOG_PATH}) 50 50 51 51 IF(NOT INSTALL_COPYABLE) 52 IF( UNIX) # Apple too?52 IF(LINUX) 53 53 # Using absolute paths 54 SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/games) 55 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox) 56 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static) 57 SET(MODULE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules) 58 SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox) 59 SET(DATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/games/orxonox) 54 SET(RUNTIME_INSTALL_DIRECTORY games) 55 SET(LIBRARY_INSTALL_DIRECTORY lib/games/orxonox) 56 SET(ARCHIVE_INSTALL_DIRECTORY lib/games/orxonox/static) 57 SET(MODULE_INSTALL_DIRECTORY lib/games/orxonox/modules) 58 SET(DOC_INSTALL_DIRECTORY share/doc/orxonox) 59 SET(DATA_INSTALL_DIRECTORY share/games/orxonox) 60 ELSEIF(WIN32) 61 # Leave on default (installs to only one location anyway) 62 ELSEIF(APPLE) 63 # TODO: Figure out what's the best way to install the application 60 64 ENDIF() 61 65 … … 67 71 ################## Unix rpath ################### 68 72 73 # Use, i.e. don't skip the full RPATH for the build tree 74 SET(CMAKE_SKIP_BUILD_RPATH FALSE) 75 69 76 # When building, don't use the install RPATH already 70 77 # (but later on when installing) … … 73 80 # The RPATH to be used when installing 74 81 IF(INSTALL_COPYABLE) 75 SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH}) 82 # Get relative paths from run to lib and from module to lib directory. 83 FILE(RELATIVE_PATH _runtime_rpath "/${RUNTIME_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}") 84 FILE(RELATIVE_PATH _module_rpath "/${MODULE_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}") 85 # $ORIGIN (with $ escaped) refers to the actual location of the library 86 # The UNIX loader recognises this special variable 87 SET(RUNTIME_RPATH "\$ORIGIN/${_runtime_rpath}") 88 SET(LIBRARY_RPATH "\$ORIGIN") 89 SET(MODULE_RPATH "\$ORIGIN:\$ORIGIN/${_module_rpath}") 76 90 ELSE() 77 SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY}) 91 SET(RUNTIME_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}") 92 SET(LIBRARY_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}") 93 SET(MODULE_RPATH "${LIBRARY_RPATH}:${CMAKE_INSTALL_PREFIX}/${MODULE_INSTALL_DIRECTORY}") 78 94 ENDIF() 79 95 -
code/trunk/cmake/LibraryConfig.cmake
r8264 r8351 40 40 # On Windows using a package causes way less problems 41 41 SET(_option_msg "Set this to true to use precompiled dependecy archives") 42 IF(WIN32 )42 IF(WIN32 OR APPLE) 43 43 OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON) 44 ELSE( WIN32)44 ELSE() 45 45 OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE) 46 ENDIF( WIN32)46 ENDIF() 47 47 48 48 # Scripts for specific library and CMake config 49 49 INCLUDE(LibraryConfigTardis) 50 INCLUDE(LibraryConfigApple)51 50 52 51 IF(DEPENDENCY_PACKAGE_ENABLE) 52 IF(APPLE AND NOT EXISTS ${CMAKE_SOURCE_DIR}/dependencies) 53 # Let CMake automatically download and extract the dependency package on Mac OS X 54 # TODO: Handle download errors and always select newest package 55 SET(_dep_package_current "OrxonoxDeps_110428_2.0_OSX.tar.bz2") 56 SET(_dep_package_url "http://svn.orxonox.net/ogre/apple/precompiled_dependencies") 57 MESSAGE(STATUS "Downloading Mac OS X dependency package.") 58 FILE(DOWNLOAD 59 ${_dep_package_url}/${_dep_package_current} 60 ${CMAKE_SOURCE_DIR}/${_dep_package_current} 61 ) 62 MESSAGE(STATUS "Extracting Mac OS X dependency package.") 63 EXECUTE_PROCESS( 64 COMMAND ${CMAKE_COMMAND} -E tar -jxf ${_dep_package_current} 65 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 66 OUTPUT_FILE ${CMAKE_BINARY_DIR}/dep_pack_extract_log.keep_me 67 ) 68 # Delete the dependency archive once we no longer need it 69 FILE(REMOVE ${CMAKE_SOURCE_DIR}/${_dep_package_current}) 70 ENDIF() 71 53 72 GET_FILENAME_COMPONENT(_dep_dir_1 ${CMAKE_SOURCE_DIR}/../dependencies ABSOLUTE) 54 73 GET_FILENAME_COMPONENT(_dep_dir_2 ${CMAKE_SOURCE_DIR}/../lib_dist ABSOLUTE) … … 59 78 ELSEIF(MSVC90) 60 79 SET(_compiler_prefix msvc9) 80 ELSEIF(MSVC10) 81 SET(_compiler_prefix msvc10) 61 82 ENDIF() 62 83 FIND_PATH(DEPENDENCY_PACKAGE_DIR … … 73 94 "Disable LIBRARY_USE_PACKAGE if you have none intalled.") 74 95 ELSE() 75 INCLUDE(PackageConfigMinGW) 76 INCLUDE(PackageConfigMSVC) 77 INCLUDE(PackageConfig) # For both msvc and mingw 96 IF(WIN32) 97 INCLUDE(PackageConfigMinGW) 98 INCLUDE(PackageConfigMSVC) 99 INCLUDE(PackageConfig) # For both msvc and mingw 100 ELSEIF(APPLE) 101 INCLUDE(PackageConfigOSX) 102 ENDIF(WIN32) 78 103 ENDIF() 79 104 ENDIF(DEPENDENCY_PACKAGE_ENABLE) … … 93 118 # Performs the search and sets the variables # 94 119 95 FIND_PACKAGE(OGRE 1.4 REQUIRED) 96 #FIND_PACKAGE(ENet 1.1 REQUIRED) 120 #FIND_PACKAGE(ENet 1.2 REQUIRED) 121 FIND_PACKAGE(CEGUI 0.6 REQUIRED) 122 FIND_PACKAGE(Lua5.1 REQUIRED) 97 123 FIND_PACKAGE(Ogg REQUIRED) 98 124 FIND_PACKAGE(Vorbis REQUIRED) 99 125 FIND_PACKAGE(ALUT REQUIRED) 100 126 FIND_PACKAGE(ZLIB REQUIRED) 101 IF(POCO_REQUIRED) 102 FIND_PACKAGE(POCO REQUIRED) 103 # Always link against POCO too because of threading 104 SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY}) 105 ENDIF() 127 106 128 IF(WIN32) 107 129 FIND_PACKAGE(DbgHelp) … … 109 131 ENDIF() 110 132 111 ##### CEGUI #####112 # We make use of the CEGUI script module called CEGUILua.113 # However there is a small issue with that: We use Tolua, a C++ binding114 # generator ourselves. And we also have to use our bindings in the same115 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime116 # version are equal or else you get segmentation faults.117 # In order to match the Lua versions we decided to ship CEGUILua in our118 # repository, mainly because there is no way to determine which version of119 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly120 # because we can then choose the Lua version. Future plans might involve only121 # accepting Lua 5.1.122 123 # Insert all internally supported CEGUILua versions here124 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)125 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)126 FIND_PACKAGE(CEGUI 0.5 REQUIRED)127 128 ##### Lua #####129 IF(CEGUILUA_USE_EXTERNAL_LIBRARY)130 COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)131 IF(version_comparison LESS 0)132 SET(LUA_VERSION_REQUEST 5.0)133 ELSE()134 SET(LUA_VERSION_REQUEST 5.1)135 ENDIF()136 ELSE()137 SET(LUA_VERSION_REQUEST 5)138 ENDIF()139 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)140 133 141 134 ##### OpenAL ##### … … 161 154 162 155 ##### Boost ##### 163 # Expand the next statement if newer boost versions than 1.36.1are released164 SET(Boost_ADDITIONAL_VERSIONS 1. 37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0165 1.4 1 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0)166 IF( NOT TARDIS)167 FIND_PACKAGE(Boost 1. 35REQUIRED thread filesystem system date_time)156 # Expand the next statement if newer boost versions are released 157 SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 158 1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1) 159 IF(NOT TARDIS) 160 FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time) 168 161 ENDIF() 169 162 # No auto linking, so this option is useless anyway 170 163 MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS) 164 165 ##### OGRE ##### 166 FIND_PACKAGE(OGRE 1.6 REQUIRED) 167 # For Ogre >= 1.7, we might need a threading library 168 # Variables are either defined by dependency package config or by FindOGRE 169 IF(OGRE_NEEDS_POCO) 170 FIND_PACKAGE(POCO REQUIRED) 171 # Always link against POCO too because of threading 172 SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY}) 173 ELSEIF(OGRE_NEEDS_BOOST) 174 # Always link against boost too because of threading 175 SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${Boost_THREAD_LIBRARY}) 176 ENDIF() 171 177 172 178 … … 177 183 # Note: Default option in the libraries vary, but our default option is dynamic 178 184 IF(WIN32) 179 OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE) 180 OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE) 181 #OPTION(LINK_ENET_DYNAMIC "Link ENet dynamically on Windows" TRUE) 182 OPTION(LINK_OGRE_DYNAMIC "Link OGRE dynamically on Windows" TRUE) 183 OPTION(LINK_TCL_DYNAMIC "Link TCL dynamically on Windows" TRUE) 184 OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 185 COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison) 186 IF(_version_comparison LESS 0) 187 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE) 188 ELSE(_version_comparison LESS 0) 189 OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE) 190 ENDIF(_version_comparison LESS 0) 185 OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE) 186 OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE) 187 #OPTION(LINK_ENET_DYNAMIC "Link ENet dynamically on Windows" TRUE) 188 OPTION(LINK_OGRE_DYNAMIC "Link OGRE dynamically on Windows" TRUE) 189 OPTION(LINK_TCL_DYNAMIC "Link TCL dynamically on Windows" TRUE) 190 OPTION(LINK_ZLIB_DYNAMIC "Link ZLib dynamically on Windows" TRUE) 191 OPTION(LINK_LUA5.1_DYNAMIC "Link Lua dynamically on Windows" TRUE) 191 192 192 193 IF(DEPENDENCY_PACKAGE_ENABLE) … … 194 195 LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC 195 196 LINK_OGRE_DYNAMIC LINK_TCL_DYNAMIC LINK_ZLIB_DYNAMIC 196 LINK_LUA _DYNAMIC197 LINK_LUA5.1_DYNAMIC 197 198 ) 198 199 ENDIF() -
code/trunk/cmake/LibraryConfigTardis.cmake
r6746 r8351 25 25 # 26 26 27 IF(UNIX AND NOT APPLE) 28 IF(EXISTS /etc/hostname) 29 FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1) 30 IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$") 31 SET (TARDIS ON) 32 ENDIF() 27 IF(LINUX AND EXISTS /etc/hostname) 28 FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1) 29 IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$") 30 SET (TARDIS ON) 33 31 ENDIF() 34 32 ENDIF() … … 77 75 #SET(ENV{OGGDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0") 78 76 #SET(ENV{VORBISDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0") 79 #SET(ENV{LUA _DIR}"/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")77 #SET(ENV{LUA5.1_DIR} "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0") 80 78 #SET(ENV{OGRE_HOME} "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0") 81 79 #SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1") -
code/trunk/cmake/PackageConfig.cmake
r7459 r8351 25 25 # 26 26 27 # Check package version info28 # MAJOR: Breaking change29 # MINOR: No breaking changes by the dependency package30 # For example any code running on 3.0 should still run on 3.131 # But you can specify that the code only runs on 3.1 and higher32 # or 4.0 and higher (so both 3.1 and 4.0 will work).33 SET(ALLOWED_MINIMUM_VERSIONS 3.1 4.0 5.0)34 35 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)36 SET(DEPENDENCY_VERSION 1.0)37 ELSE()38 # Get version from file39 FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)40 SET(_match)41 STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})42 IF(_match)43 SET(DEPENDENCY_VERSION ${_match})44 ELSE()45 MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")46 ENDIF()47 ENDIF()48 49 INCLUDE(CompareVersionStrings)50 SET(_version_match FALSE)51 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})52 # Get major version53 STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")54 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)55 IF(_result EQUAL 0)56 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)57 IF(NOT _result LESS 0)58 SET(_version_match TRUE)59 ENDIF()60 ENDIF()61 ENDFOREACH(_version)62 IF(NOT _version_match)63 MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"64 "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"65 "You can get a new version from www.orxonox.net")66 ENDIF()67 68 27 IF(NOT _INTERNAL_PACKAGE_MESSAGE) 69 28 MESSAGE(STATUS "Using library package for the dependencies.") … … 73 32 # Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading 74 33 COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE) 75 IF(NOT _result EQUAL -1 AND NOT MINGW)76 SET(POCO_REQUIREDTRUE)34 IF(NOT _result EQUAL -1 AND NOT APPLE) 35 SET(OGRE_NEEDS_POCO TRUE) 77 36 ENDIF() 78 37 … … 84 43 SET(ENV{DXSDK_DIR} ${DEP_INCLUDE_DIR}/directx) 85 44 #SET(ENV{ENETDIR} ${DEP_INCLUDE_DIR}/enet) 86 SET(ENV{LUA _DIR}${DEP_INCLUDE_DIR}/lua)45 SET(ENV{LUA5.1_DIR} ${DEP_INCLUDE_DIR}/lua) 87 46 SET(ENV{OGGDIR} ${DEP_INCLUDE_DIR}/libogg) 88 47 SET(ENV{VORBISDIR} ${DEP_INCLUDE_DIR}/libvorbis) … … 116 75 117 76 ## RELEASE 118 # Try to filter out all the debug libraries. If the regex doesn't do the 119 # job anymore, simply adjust it. 120 INSTALL( 121 DIRECTORY ${DEP_BINARY_DIR}/ 122 DESTINATION bin 123 CONFIGURATIONS Release RelWithDebInfo MinSizeRel 124 REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE 125 ) 77 IF(EXISTS ${DEP_BINARY_DIR}/install_manifest.txt) 78 FILE(STRINGS ${DEP_BINARY_DIR}/install_manifest.txt _files) 79 FOREACH(_file ${_files}) 80 INSTALL( 81 FILES ${DEP_BINARY_DIR}/${_file} 82 DESTINATION bin 83 CONFIGURATIONS Release RelWithDebInfo MinSizeRel 84 ) 85 ENDFOREACH(_file) 86 ELSE() 87 # Try to filter out all the debug libraries. If the regex doesn't do the 88 # job anymore, simply adjust it. 89 INSTALL( 90 DIRECTORY ${DEP_BINARY_DIR}/ 91 DESTINATION bin 92 CONFIGURATIONS Release RelWithDebInfo MinSizeRel 93 REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE 94 ) 95 ENDIF() 126 96 ENDIF() -
code/trunk/cmake/PackageConfigMSVC.cmake
r7818 r8351 28 28 IF(MSVC) 29 29 30 INCLUDE(CheckPackageVersion) 31 CHECK_PACKAGE_VERSION(4.3 6.0) 32 30 33 # 64 bit system? 31 34 IF(CMAKE_SIZEOF_VOID_P EQUAL 8) … … 36 39 37 40 # Choose right MSVC version 38 STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) 41 STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1" 39 42 _msvc_version "${CMAKE_GENERATOR}") 40 43 … … 54 57 # Certain find scripts don't behave as ecpected to we have 55 58 # to specify the libraries ourselves. 56 SET(TCL_LIBRARY ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "") 57 SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "") 59 IF(MSVC10) 60 SET(TCL_LIBRARY 61 optimized ${DEP_LIBRARY_DIR}/tcl85t.lib 62 debug ${DEP_LIBRARY_DIR}/tcl85tg.lib 63 CACHE FILEPATH "" 64 ) 65 SET(ZLIB_LIBRARY 66 optimized ${DEP_LIBRARY_DIR}/zlib-vc100.lib 67 debug ${DEP_LIBRARY_DIR}/zlib-vc100_d.lib 68 CACHE FILEPATH "" 69 ) 70 ELSE() 71 SET(TCL_LIBRARY ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "") 72 SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "") 73 ENDIF() 74 # Part of Platform SDK and usually gets linked automatically 75 SET(WMI_LIBRARY wbemuuid.lib) 58 76 59 77 ENDIF(MSVC) -
code/trunk/cmake/PackageConfigMinGW.cmake
r5781 r8351 28 28 IF(MINGW) 29 29 30 INCLUDE(CheckPackageVersion) 31 CHECK_PACKAGE_VERSION(6.0) 32 30 33 # 64 bit system? 31 34 IF(CMAKE_SIZEOF_VOID_P EQUAL 8) … … 48 51 # to specify the libraries ourselves. 49 52 SET(TCL_LIBRARY ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "") 50 SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "") 53 SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/libzlib.dll CACHE FILEPATH "") 54 55 # Not included in MinGW, so we need to supply it for OIS 56 SET(WMI_INCLUDE_DIR ${DEP_INCLUDE_DIR}/wmi/include) 57 SET(WMI_LIBRARY ${DEP_LIBRARY_DIR}/wbemuuid.lib) 51 58 52 59 ENDIF(MINGW) -
code/trunk/cmake/tools/CheckOGREPlugins.cmake
r8264 r8351 52 52 NAMES ${_plugin} 53 53 PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR} 54 PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin 54 PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources 55 55 ) 56 56 FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG 57 57 NAMES ${_plugin}d ${_plugin}_d ${_plugin} 58 58 PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR} 59 PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin 59 PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources 60 60 ) 61 61 # We only need at least one render system. Check at the end. -
code/trunk/cmake/tools/FindALUT.cmake
r7163 r8351 1 # - Locate FreeAlut 2 # This module defines 3 # ALUT_LIBRARY 4 # ALUT_FOUND, if false, do not try to link against Alut 5 # ALUT_INCLUDE_DIR, where to find the headers 6 # 7 # $ALUTDIR is an environment variable that would 8 # correspond to the ./configure --prefix=$ALUTDIR 9 # used in building Alut. 10 # 11 # Created by Eric Wing. This was influenced by the FindSDL.cmake module. 12 # On OSX, this will prefer the Framework version (if found) over others. 13 # People will have to manually change the cache values of 14 # ALUT_LIBRARY to override this selection. 15 # Tiger will include OpenAL as part of the System. 16 # But for now, we have to look around. 17 # Other (Unix) systems should be able to utilize the non-framework paths. 18 # 19 # Several changes and additions by Fabian 'x3n' Landau 20 # Some simplifications by Adrian Friedli and Reto Grieder 21 # > www.orxonox.net < 1 # 2 # ORXONOX - the hottest 3D action shooter ever to exist 3 # > www.orxonox.net < 4 # 5 # This program is free software; you can redistribute it and/or 6 # modify it under the terms of the GNU General Public License 7 # as published by the Free Software Foundation; either version 2 8 # of the License, or (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License along 16 # with this program; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 # 19 # 20 # Author: 21 # Kevin Young 22 # Description: 23 # Variables defined: 24 # ALUT_FOUND 25 # ALUT_INCLUDE_DIR 26 # ALUT_LIBRARY 27 # 22 28 23 29 INCLUDE(FindPackageHandleStandardArgs) 24 30 INCLUDE(HandleLibraryTypes) 25 31 26 FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h 27 PATHS 28 $ENV{ALUTDIR} 29 ~/Library/Frameworks/OpenAL.framework 30 /Library/Frameworks/OpenAL.framework 31 /System/Library/Frameworks/OpenAL.framework # Tiger 32 PATH_SUFFIXES include include/OpenAL include/AL Headers 32 FIND_PATH(ALUT_INCLUDE_DIR alut.h 33 PATHS $ENV{ALUTDIR} 34 PATH_SUFFIXES include include/AL 33 35 ) 34 35 # I'm not sure if I should do a special casing for Apple. It is 36 # unlikely that other Unix systems will find the framework path. 37 # But if they do ([Next|Open|GNU]Step?), 38 # do they want the -framework option also? 39 IF(${ALUT_INCLUDE_DIR} MATCHES ".framework") 40 41 STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR}) 42 IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks" 43 OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks" 44 ) 45 # String is in default search path, don't need to use -F 46 SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX") 47 ELSE() 48 # String is not /Library/Frameworks, need to use -F 49 SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX") 50 ENDIF() 51 # Clear the temp variable so nobody can see it 52 SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "") 53 54 ELSE() 55 FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED 56 NAMES alut 57 PATHS $ENV{ALUTDIR} 58 PATH_SUFFIXES lib libs 59 ) 60 FIND_LIBRARY(ALUT_LIBRARY_DEBUG 61 NAMES alutd alut_d alutD alut_D 62 PATHS $ENV{ALUTDIR} 63 PATH_SUFFIXES lib libs 64 ) 65 ENDIF() 36 FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED 37 NAMES alut ALUT 38 PATHS $ENV{ALUTDIR} 39 PATH_SUFFIXES lib bin/Release bin/release Release release ALUT 40 ) 41 FIND_LIBRARY(ALUT_LIBRARY_DEBUG 42 NAMES alutd alut_d alutD alut_D ALUTd ALUT_d ALUTD ALUT_D 43 PATHS $ENV{ALUTDIR} 44 PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT 45 ) 66 46 67 47 # Handle the REQUIRED argument and set ALUT_FOUND 68 48 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG 69 70 49 ALUT_LIBRARY_OPTIMIZED 50 ALUT_INCLUDE_DIR 71 51 ) 72 52 … … 75 55 76 56 MARK_AS_ADVANCED( 77 78 79 57 ALUT_INCLUDE_DIR 58 ALUT_LIBRARY_OPTIMIZED 59 ALUT_LIBRARY_DEBUG 80 60 ) -
code/trunk/cmake/tools/FindCEGUI.cmake
r7163 r8351 4 4 # CEGUI_INCLUDE_DIR 5 5 # CEGUI_LIBRARY, the library to link against to use CEGUI. 6 # CEGUILUA_LIBRARY, the library to link against to use the CEGUI script module. 7 # CEGUI_TOLUA_LIBRARY, the library to link against to use Tolua++. 6 8 # CEGUI_FOUND, If false, do not try to use CEGUI 7 9 # CEGUI_VERSION, the version as string "x.y.z" 8 # CEGUILUA_LIBRARY, Script module library9 # CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here10 10 # 11 11 # Input: 12 12 # ENV{CEGUIDIR}, CEGUI path, optional 13 # FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported14 # in the source repository15 # CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua16 13 # 17 14 # Created by Matt Williams to find OGRE libraries … … 29 26 # > www.orxonox.net < 30 27 28 INCLUDE(CompareVersionStrings) 31 29 INCLUDE(DetermineVersion) 32 30 INCLUDE(FindPackageHandleAdvancedArgs) 33 31 INCLUDE(HandleLibraryTypes) 34 32 33 # Find CEGUI headers 35 34 FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h 36 35 PATHS $ENV{CEGUIDIR} 37 PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers36 PATH_SUFFIXES include include/CEGUI 38 37 ) 38 39 # Inspect CEGUIVersion.h for the version number 40 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 41 42 # Find CEGUI library 39 43 FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED 40 44 NAMES CEGUIBase CEGUI … … 50 54 ) 51 55 52 # Inspect CEGUIVersion.h for the version number 53 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) 56 # Find CEGUILua headers 57 FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h 58 PATHS 59 $ENV{CEGUIDIR} 60 $ENV{CEGUILUADIR} 61 ${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule 62 PATH_SUFFIXES include include/CEGUI 63 ) 64 # Find CEGUILua libraries 65 FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED 66 NAMES CEGUILua CEGUILuaScriptModule 67 PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR} 68 PATH_SUFFIXES lib bin 69 ) 70 FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG 71 NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d 72 PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR} 73 PATH_SUFFIXES lib bin 74 ) 75 76 # Find CEGUI Tolua++ include file 77 # We only need to add this path since we use tolua++ like a normal 78 # dependency but it is shipped with CEGUILua. 79 FIND_PATH(CEGUI_TOLUA_INCLUDE_DIR tolua++.h 80 PATHS 81 ${CEGUILUA_INCLUDE_DIR} 82 # For newer CEGUI versions >= 0.7 83 ${CEGUILUA_INCLUDE_DIR}/support/tolua++ 84 # For Mac OS X, tolua++ is a separate framework in the dependency package 85 ${DEP_FRAMEWORK_DIR} 86 NO_DEFAULT_PATH # Don't attempt to find tolua++ installed on the system 87 ) 88 # Find CEGUI Tolua++ libraries 89 FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED 90 NAMES CEGUItoluapp tolua++ ceguitolua++ 91 PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR} 92 PATH_SUFFIXES lib bin 93 ) 94 FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG 95 NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d 96 PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR} 97 PATH_SUFFIXES lib bin 98 ) 99 100 # Newer versions of CEGUI have the renderer for OGRE shipped with them 101 COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE) 102 IF(_version_compare GREATER -1) 103 # Find CEGUI OGRE Renderer headers 104 FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h 105 PATHS 106 $ENV{CEGUIDIR} 107 $ENV{CEGUIOGRERENDERERDIR} 108 ${CEGUI_INCLUDE_DIR}/RendererModules/Ogre 109 PATH_SUFFIXES include include/CEGUI 110 ) 111 # Find CEGUI OGRE Renderer libraries 112 FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 113 NAMES CEGUIOgreRenderer 114 PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR} 115 PATH_SUFFIXES lib bin 116 ) 117 FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG 118 NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d 119 PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR} 120 PATH_SUFFIXES lib bin 121 ) 122 SET(CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES 123 CEGUI_OGRE_RENDERER_INCLUDE_DIR 124 CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 125 ) 126 ELSE() 127 SET(CEGUI_OLD_VERSION TRUE) 128 SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE) 129 ENDIF() 54 130 55 131 # Handle the REQUIRED argument and set CEGUI_FOUND 56 132 # Also checks the version requirements if given 57 133 FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}" 134 CEGUI_INCLUDE_DIR 58 135 CEGUI_LIBRARY_OPTIMIZED 59 CEGUI_INCLUDE_DIR 136 CEGUILUA_INCLUDE_DIR 137 CEGUILUA_LIBRARY_OPTIMIZED 138 CEGUI_TOLUA_INCLUDE_DIR 139 CEGUI_TOLUA_LIBRARY_OPTIMIZED 140 ${CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES} 60 141 ) 61 142 62 143 # Collect optimized and debug libraries 63 144 HANDLE_LIBRARY_TYPES(CEGUI) 145 HANDLE_LIBRARY_TYPES(CEGUILUA) 146 HANDLE_LIBRARY_TYPES(CEGUI_TOLUA) 147 IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED) 148 HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER) 149 ENDIF() 64 150 65 151 MARK_AS_ADVANCED( … … 67 153 CEGUI_LIBRARY_OPTIMIZED 68 154 CEGUI_LIBRARY_DEBUG 155 CEGUILUA_INCLUDE_DIR 156 CEGUILUA_LIBRARY_OPTIMIZED 157 CEGUILUA_LIBRARY_DEBUG 158 CEGUI_TOLUA_INCLUDE_DIR 159 CEGUI_TOLUA_LIBRARY_OPTIMIZED 160 CEGUI_TOLUA_LIBRARY_DEBUG 161 CEGUI_OGRE_RENDERER_INCLUDE_DIR 162 CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED 163 CEGUI_OGRE_RENDERER_LIBRARY_DEBUG 69 164 ) 70 71 LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)72 IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)73 # Also try to find the CEGUILua libraries.74 # There would already be libraries in src/ for versions 0.5 and 0.675 FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED76 NAMES CEGUILua77 PATHS $ENV{CEGUIDIR}78 PATH_SUFFIXES lib bin79 )80 FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG81 NAMES CEGUILuad CEGUILua_d82 PATHS $ENV{CEGUIDIR}83 PATH_SUFFIXES lib bin84 )85 86 SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})87 # Handle the REQUIRED argument and set CEGUILUA_FOUND88 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG89 CEGUILUA_LIBRARY_OPTIMIZED90 )91 92 # Collect optimized and debug libraries93 HANDLE_LIBRARY_TYPES(CEGUILUA)94 95 MARK_AS_ADVANCED(96 CEGUILUA_LIBRARY_OPTIMIZED97 CEGUILUA_LIBRARY_DEBUG98 )99 100 ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)101 SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)102 ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)103 -
code/trunk/cmake/tools/FindOGRE.cmake
r7163 r8351 23 23 FIND_PATH(OGRE_INCLUDE_DIR Ogre.h 24 24 PATHS $ENV{OGRE_HOME} 25 PATH_SUFFIXES include include/OGRE Ogre.framework/Headers25 PATH_SUFFIXES include include/OGRE 26 26 ) 27 27 FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED … … 33 33 NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d 34 34 PATHS $ENV{OGRE_HOME} 35 PATH_SUFFIXES lib bin/Debug bin/debug Debug debug Versions/A35 PATH_SUFFIXES lib bin/Debug bin/debug Debug debug 36 36 ) 37 37 -
code/trunk/cmake/tools/FindOgg.cmake
r7163 r8351 22 22 ) 23 23 FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED 24 NAMES ogg 24 NAMES ogg ogg-0 libogg 25 25 PATHS $ENV{OGGDIR} 26 26 PATH_SUFFIXES lib 27 27 ) 28 28 FIND_LIBRARY(OGG_LIBRARY_DEBUG 29 NAMES oggd ogg_d oggD ogg_D 29 NAMES oggd ogg_d oggD ogg_D libogg_d 30 30 PATHS $ENV{OGGDIR} 31 31 PATH_SUFFIXES lib -
code/trunk/cmake/tools/FindPOCO.cmake
r7285 r8351 29 29 FIND_PATH(POCO_INCLUDE_DIR Poco/Poco.h 30 30 PATHS $ENV{POCODIR} 31 PATH_SUFFIXES include 31 PATH_SUFFIXES include Foundation/include 32 32 ) 33 33 FIND_LIBRARY(POCO_LIBRARY_OPTIMIZED -
code/trunk/cmake/tools/FindVorbis.cmake
r7163 r8351 22 22 ) 23 23 FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED 24 NAMES vorbis 24 NAMES vorbis vorbis-0 libvorbis 25 25 PATHS $ENV{VORBISDIR} 26 26 PATH_SUFFIXES lib 27 27 ) 28 28 FIND_LIBRARY(VORBIS_LIBRARY_DEBUG 29 NAMES vorbisd vorbis_d vorbisD vorbis_D 29 NAMES vorbisd vorbis_d vorbisD vorbis_D libvorbis_d 30 30 PATHS $ENV{VORBISDIR} 31 31 PATH_SUFFIXES lib 32 32 ) 33 33 FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED 34 NAMES vorbisfile 34 NAMES vorbisfile vorbisfile-3 libvorbisfile 35 35 PATHS $ENV{VORBISDIR} 36 36 PATH_SUFFIXES lib 37 37 ) 38 38 FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG 39 NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D 39 NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D libvorbisfile_d 40 40 PATHS $ENV{VORBISDIR} 41 41 PATH_SUFFIXES lib -
code/trunk/cmake/tools/GenerateToluaBindings.cmake
r7415 r8351 32 32 # RUNTIME_LIBRARY_DIRECTORY - Working directory 33 33 # 34 35 # Workaround for XCode: The folder where the bind files are written to has 36 # to be present beforehand. 37 # We have to do this here because the header files are all stored in a single 38 # location per configuration. 39 IF(CMAKE_CONFIGURATION_TYPES) 40 FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES}) 41 FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}") 42 ENDFOREACH(_dir) 43 ENDIF() 34 44 35 45 FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files) -
code/trunk/cmake/tools/TargetUtilities.cmake
r8079 r8351 43 43 # Lists: 44 44 # LINK_LIBRARIES: Redirects to TARGET_LINK_LIBRARIES 45 # LINK_LIBS_LINUX: Redirects to TARGET_LINK_LIBRARIES only on Linux 46 # LINK_LIBS_WIN32: Redirects to TARGET_LINK_LIBRARIES only on Windows 47 # LINK_LIBS_APPLE: Redirects to TARGET_LINK_LIBRARIES only on Apple 48 # LINK_LIBS_UNIX: Redirects to TARGET_LINK_LIBRARIES only on UNIX 45 49 # VERSION: Set version to the binary 46 50 # SOURCE_FILES: Source files for the target … … 53 57 # This function also installs the target! 54 58 # Prerequisistes: 55 # ORXONOX_DEFAULT_LINK , ORXONOX_CONFIG_FILES59 # ORXONOX_DEFAULT_LINK 56 60 # Parameters: 57 61 # _target_name, ARGN for the macro arguments … … 86 90 SET(_list_names LINK_LIBRARIES VERSION SOURCE_FILES 87 91 DEFINE_SYMBOL TOLUA_FILES PCH_FILE 88 PCH_EXCLUDE OUTPUT_NAME) 92 PCH_EXCLUDE OUTPUT_NAME LINK_LIBS_LINUX 93 LINK_LIBS_WIN32 LINK_LIBS_APPLE LINK_LIBS_UNIX) 89 94 90 95 PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN}) … … 104 109 MESSAGE(FATAL_ERROR "No name provided for source file compilation") 105 110 ENDIF() 106 IF(NOT _compilation_include_string)107 MESSAGE(STATUS "Warning: Empty source file compilation!")108 ENDIF()109 111 IF(NOT DISABLE_COMPILATIONS) 112 IF(NOT _compilation_include_string) 113 MESSAGE(STATUS "Warning: Empty source file compilation!") 114 ENDIF() 110 115 IF(EXISTS ${_compilation_file}) 111 116 FILE(READ ${_compilation_file} _include_string_file) … … 169 174 GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files 170 175 INPUTFILES ${_arg_TOLUA_FILES}) 176 # Workaround for XCode: The folder where the bind files are written to has 177 # to be present beforehand. 178 IF(CMAKE_CONFIGURATION_TYPES) 179 FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES}) 180 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir}) 181 ENDFOREACH(_dir) 182 ENDIF() 171 183 ENDIF() 172 184 … … 192 204 193 205 IF(NOT _arg_ORXONOX_EXTERNAL) 194 # Move the prereqs.h file to the configsection206 # Move the ...Prereqs.h and the PCH files to the 'Config' section 195 207 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h) 196 208 SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h) 197 209 ENDIF() 198 # Add config files to the config section199 LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})200 SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})210 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE}) 211 SOURCE_GROUP("Config" FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE}) 212 ENDIF() 201 213 ENDIF() 202 214 ENDIF() … … 217 229 IF(_arg_ORXONOX_EXTERNAL) 218 230 REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC) 219 ADD_COMPILER_FLAGS("-w") 231 ADD_COMPILER_FLAGS("-w" NOT MSVC) 232 ADD_COMPILER_FLAGS("-W0" MSVC) 220 233 ENDIF() 221 234 222 235 # Don't compile header files 223 236 FOREACH(_file ${_${_target_name}_files}) 224 IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx )$")237 IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$") 225 238 SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE) 226 239 ENDIF() … … 278 291 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBRARIES}) 279 292 ENDIF() 293 IF(_arg_LINK_LIBS_LINUX AND LINUX) 294 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_LINUX}) 295 ENDIF() 296 IF(_arg_LINK_LIBS_WIN32 AND WIN32) 297 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_WIN32}) 298 ENDIF() 299 IF(_arg_LINK_LIBS_APPLE AND APPLE) 300 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_APPLE}) 301 ENDIF() 302 IF(_arg_LINK_LIBS_UNIX AND UNIX) 303 TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_UNIX}) 304 ENDIF() 305 306 # RPATH settings for the installation 307 IF("${_target_type}" STREQUAL "LIBRARY") 308 IF(_arg_MODULE) 309 SET(_rpath "${MODULE_RPATH}") 310 ELSE() 311 SET(_rpath "${LIBRARY_RPATH}") 312 ENDIF() 313 ELSE() 314 SET(_rpath "${RUNTIME_RPATH}") 315 ENDIF() 316 SET_TARGET_PROPERTIES(${_target_name} PROPERTIES INSTALL_RPATH "${_rpath}") 280 317 281 318 # DEFINE_SYMBOL
Note: See TracChangeset
for help on using the changeset viewer.