Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 10:04:38 PM (15 years ago)
Author:
rgrieder
Message:

Rearranged CMake configuration code. I split serveral files in two and moved some code around.
There are no actual code changes!

Details:

  • Everything that involves library finding is in LibraryConfig.cmake. It includes other LibraryConfigXXX.cmake files that set specific options for certain platforms or package configurations (like MSVC or MinGW dependency package).
  • All build related code is in BuildConfig.cmake. The actual compiler configuration is done in BuildConfigXXX.cmake where XXX can be GCC or MSVC.
  • The changes above implied splitting FindOGRE.cmake in two (was going to do it anyway, but rather in a later commit) so that CheckOGREPlugins.cmake is now a separate module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/CMakeLists.txt

    r2599 r2612  
    1616SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
    1717
    18 # Set binary output directories
    19 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    20 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
    21 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     18# Library Config
     19INCLUDE(LibraryConfig)
    2220
    23 # Set Debug build to default when not having multi-config generator like msvc
    24 IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
    25   SET(CMAKE_BUILD_TYPE "Debug")
    26 ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
     21# Build Config
     22INCLUDE(BuildConfig)
    2723
    28 ############## Platform Config ##################
    29 
    30 # Configure platform specific options
    31 INCLUDE(ConfigPlatforms)
    32 
    33 ################ Test options ###################
    34 
    35 OPTION(ENABLE_TESTS "Enable build tests.")
    36 IF(ENABLE_TESTS)
    37   ENABLE_TESTING()
    38 ENDIF(ENABLE_TESTS)
    39 
    40 OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
    41 OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
    42 
    43 ############### Library finding #################
    44 
    45 # Performs the search and sets the variables
    46 
    47 # Expand the next statement if newer boost versions than 1.36.1 are released
    48 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
    49 FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
    50 # With MSVC, automatic linking is performed for boost. So wee need to tell
    51 # the linker where to find them. Also note that when running FindBoost for the
    52 # first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
    53 IF (MSVC)
    54   LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    55 ENDIF (MSVC)
    56 FIND_PACKAGE(OGRE REQUIRED)
    57 FIND_PACKAGE(CEGUI REQUIRED)
    58 FIND_PACKAGE(ENet REQUIRED)
    59 FIND_PACKAGE(OpenAL REQUIRED)
    60 FIND_PACKAGE(ALUT REQUIRED)
    61 FIND_PACKAGE(OggVorbis REQUIRED)
    62 FIND_PACKAGE(ZLIB REQUIRED)
    63 FIND_PACKAGE(DirectX REQUIRED)
    64 
    65 # Require Lua 5.0 or 5.1
    66 FIND_PACKAGE(Lua50 QUIET)
    67 IF(NOT LUA50_FOUND)
    68   # Remove variables set by Lua50 and try with Lua51
    69   SET(LUA_INCLUDE_DIR)
    70   SET(LUA_LIBRARY_lua)
    71   SET(LUA_LIBRARY_lualib)
    72   SET(LUA_LIBRARIES)
    73   FIND_PACKAGE(Lua51 REQUIRED)
    74 ENDIF(NOT LUA50_FOUND)
    75 # Determine Lua version (Lua50 may also find Lua51)
    76 FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION")
    77 STRING(REGEX REPLACE "^.*\"Lua (.*)\".*$" "\\1" LUA_VERSION "${LUA_VERSION}")
    78 
    79 # QUIET: Don't require the whole tcl rat tail
    80 FIND_PACKAGE(TCL QUIET)
    81 IF(NOT TCL_FOUND)
    82   MESSAGE(FATAL_ERROR "Tcl was not found.")
    83 ENDIF(NOT TCL_FOUND)
    84 
    85 # Hide variables created by CMake FindXX scripts
    86 MARK_AS_ADVANCED(
    87   LUA_LIBRARY_lua
    88   LUA_LIBRARY_lualib
    89   OPENAL_INCLUDE_DIR
    90   OPENAL_LIBRARY
    91 )
    92 
    93 ############### Orxonox Source ##################
    94 
     24# Creates the actual project
    9525ADD_SUBDIRECTORY(src)
    9626
Note: See TracChangeset for help on using the changeset viewer.