Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 20, 2009, 11:49:37 PM (15 years ago)
Author:
rgrieder
Message:
  • Moved all (as far as possible) build related CMake options and switches to src/OrxonoxConfig.cmake (new file). This should my constant problems of finding options I've created some time ago…
  • Renamed BuildConfig to CompilerConfig (since that's what it has become now).
  • Moved all installation related options and paths to cmake/InstallConfig.cmake (new file)
  • Note: I moved the very basic options to the root CMLs like default paths (bin, lib, doc, etc.), output directories and configuration type.

Actual code changes are absolutely minimal, maybe a few lines or so.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/OrxonoxConfig.cmake

    r5662 r5664  
    1717 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1818 #
     19 #
     20 #  Author:
     21 #    Reto Grieder
     22 #  Description:
     23 #    Configures the header files OrxonoxConfig.h and SpecialConfig.h
     24 #    and sets some other options. All the build related options should be
     25 #    found and set here if possible.
     26 #
    1927
    20 ################ Various Options ################
     28#################### Options ####################
    2129
    22 # various macro includes
    23 INCLUDE(FlagUtilities)
    24 INCLUDE(TargetUtilities)
     30# Default linking is SHARED
     31SET(ORXONOX_DEFAULT_LINK SHARED)
    2532
    26 # Use TinyXML++
    27 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
    28 # OIS dynamic linking requires macro definition, at least for Windows
    29 ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
     33# Use, i.e. don't skip the full RPATH for the build tree
     34SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
    3035
    31 ################ OrxonoxConfig.h ################
     36# Global switch to disable Precompiled Header Files
     37IF(PCH_COMPILER_SUPPORT)
     38  OPTION(PCH_ENABLE "Global PCH switch" TRUE)
     39ENDIF()
     40
     41# Enable expensive optimisations: use this for a binary release build
     42OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
     43
     44# Use WinMain() or main()?
     45IF(WIN32)
     46  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
     47ENDIF()
     48
     49################ Platform Config ################
    3250
    3351# Check endianness
     
    6078ENDIF(MSVC)
    6179
    62 # Check ciso646 include (literal operators)
     80# Check iso646.h include (literal operators)
    6381INCLUDE(CheckIncludeFileCXX)
    6482CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
    6583
    66 # XCode and Visual Studio support multiple configurations. In order to tell the
    67 # which one we have to define the macros separately for each configuration
     84# XCode and Visual Studio support multiple configurations. In order to tell
     85# about the active one we have to define the macro for each configuration
    6886ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
    6987ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
    7088ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
    7189ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
     90
     91############## Configured Headers ###############
    7292
    7393SET(GENERATED_FILE_COMMENT
     
    85105  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
    86106)
    87 
    88 ############## Include Directories ##############
    89 
    90 # Set the search paths for include files
    91 INCLUDE_DIRECTORIES(
    92   # External
    93   ${OGRE_INCLUDE_DIR}
    94   ${CEGUI_INCLUDE_DIR}
    95   ${ENET_INCLUDE_DIR}
    96   ${Boost_INCLUDE_DIRS}
    97   ${OPENAL_INCLUDE_DIRS}
    98   ${ALUT_INCLUDE_DIR}
    99   ${VORBIS_INCLUDE_DIR}
    100   ${OGG_INCLUDE_DIR}
    101   ${LUA_INCLUDE_DIR}
    102   ${TCL_INCLUDE_PATH}
    103   ${DIRECTX_INCLUDE_DIR}
    104   ${ZLIB_INCLUDE_DIR}
    105   ${VLD_INCLUDE_DIR}
    106 
    107   # All library includes are prefixed with the path to avoid conflicts
    108   ${CMAKE_CURRENT_SOURCE_DIR}
    109   # Bullet headers really need the include directory
    110   ${CMAKE_CURRENT_SOURCE_DIR}/bullet
    111   # OIS headers need the root dir as well
    112   ${CMAKE_CURRENT_SOURCE_DIR}/ois
    113   # Convenience directory
    114   ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
    115   # OrxonoxConfig.h
    116   ${CMAKE_CURRENT_BINARY_DIR}
    117   # Tolua bind files for Core
    118   ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR}
    119   # Tolua bind files for Orxonox
    120   ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR}
    121 )
    122 
    123 
    124 ################ Sub Directories ################
    125 
    126 # Third party libraries
    127 ADD_SUBDIRECTORY(tolua)
    128 
    129 # Include CEGUILua if not requested otherwise
    130 IF(CEGUILUA_USE_INTERNAL_LIBRARY)
    131   IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
    132     MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
    133   ENDIF()
    134 
    135   INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})
    136   ADD_SUBDIRECTORY(ceguilua)
    137 ENDIF()
    138 
    139 ADD_SUBDIRECTORY(bullet)
    140 ADD_SUBDIRECTORY(cpptcl)
    141 ADD_SUBDIRECTORY(ogreceguirenderer)
    142 ADD_SUBDIRECTORY(ois)
    143 ADD_SUBDIRECTORY(tinyxml)
    144 
    145 # Orxonox code
    146 ADD_SUBDIRECTORY(util)
    147 ADD_SUBDIRECTORY(core)
    148 ADD_SUBDIRECTORY(network)
    149 ADD_SUBDIRECTORY(orxonox)
Note: See TracChangeset for help on using the changeset viewer.