Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 14, 2009, 6:11:32 PM (15 years ago)
Author:
rgrieder
Message:

Merged the build system changes from the Gruppenarbeit:

  • More Comments (including Doxygen stuff for the config files)
  • Removed redundancy between PackageConfigMSVC.cmake and PackageConfigMinGW.cmake
  • Option ORXONOX_RELEASE which activates some expensive (build time) optimisations
  • Native Visual Leak Detector support (doesn't work for MSVC9 though)
  • Added CMake option to disable the console on Windows
Location:
code/branches/pch/cmake
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/cmake/BuildConfig.cmake

    r2896 r3167  
    7070ENDIF()
    7171
     72# Enable expensive optimisations: Use this for a binary release build
     73OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
     74
     75# Use WinMain() or main()?
     76OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
    7277
    7378################# OGRE Plugins ##################
  • code/branches/pch/cmake/BuildConfigMSVC.cmake

    r3117 r3167  
    3434######################## Options ########################
    3535
    36 IF(MSVC80)
    37   OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" FALSE)
    38 ENDIF(MSVC80)
     36# Currently VLD has a problem with MSVC9 although it actually is supported
     37IF(MSVC8)
     38  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
     39ENDIF()
     40# Make sure the value is "on" or "off" for vld.ini
     41IF(VISUAL_LEAK_DETECTOR_ENABLE)
     42  SET(VISUAL_LEAK_DETECTOR_ENABLE on)
     43ELSE()
     44  SET(VISUAL_LEAK_DETECTOR_ENABLE off)
     45ENDIF()
    3946
    4047# Orxonox only supports MSVC 8 and above, which gets asserted above
     
    6168
    6269# Overwrite CMake default flags here.
    63 SET_COMPILER_FLAGS("-MDd -Od -ZI -D_DEBUG -Gm -RTC1" Debug          CACHE)
     70SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -Gm -RTC1" Debug          CACHE)
    6471SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG -MP2"      Release        CACHE)
    6572SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG -MP2"      RelWithDebInfo CACHE)
     
    8996# Happens on STL member variables which are not public
    9097ADD_COMPILER_FLAGS("-w44251" CACHE)
     98ADD_COMPILER_FLAGS("-w44275" CACHE) # For inheritance
    9199
    92100# Multiple assignment operators specified
  • code/branches/pch/cmake/LibraryConfig.cmake

    r3159 r3167  
    6767    INCLUDE(PackageConfigMinGW)
    6868    INCLUDE(PackageConfigMSVC)
    69 
    70     # On Windows, DLLs have to be in the executable folder, install them
    71     IF(DEP_BINARY_DIR AND WIN32)
    72       # When installing a debug version, we really can't know which libraries
    73       # are used in released mode because there might be deps of deps.
    74       INSTALL(
    75         DIRECTORY ${DEP_BINARY_DIR}/
    76         DESTINATION bin
    77         CONFIGURATIONS Debug
    78         REGEX "^.*\\.pdb$" EXCLUDE
    79       )
    80 
    81       # Try to filter out all the debug libraries. If the regex doesn't do the
    82       # job anymore, simply adjust it.
    83       INSTALL(
    84         DIRECTORY ${DEP_BINARY_DIR}/
    85         DESTINATION bin
    86         CONFIGURATIONS Release RelWithDebInfo MinSizeRel
    87         REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    88       )
    89     ENDIF(DEP_BINARY_DIR AND WIN32)
    90   ENDIF(NOT DEPENDENCY_PACKAGE_DIR)
     69    INCLUDE(PackageConfig) # For both msvc and mingw
     70  ENDIF()
    9171ENDIF(DEPENDENCY_PACKAGE_ENABLE)
    9272
  • code/branches/pch/cmake/PackageConfigMSVC.cmake

    r2710 r3167  
    2828IF(MSVC)
    2929
    30   # MAJOR: Interface breaking change somewhere or added a new library
    31   # MINOR: Updated a library to a new version
    32   # PATCH: Bug fix or smaller things
    33   SET(DEPENDENCY_VERSION 0.0.1)
    34 
    35   MESSAGE(STATUS "Using library package for the dependencies.")
    36 
    3730  # 64 bit system?
    3831  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    4538  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
    4639         _msvc_version "${CMAKE_GENERATOR}")
    47   IF(MSVC71)
    48     SET(_msvc_version "7.1")
    49   ENDIF(MSVC71)
    5040
    5141  SET(DEP_INCLUDE_DIR ${DEPENDENCY_PACKAGE_DIR}/include)
     
    6252  SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR})
    6353
    64   # Include paths and other special treatments
    65   SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut-1.1.0)
    66   SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost-1.37.0)
    67   SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui-0.6.2)
    68   SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx-2007.aug)
    69   SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet-1.2)
    70   SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua-5.1.4)
    71   SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg-1.1.3)
    72   SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis-1.2.0)
    73   SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre-1.4.9)
    74   SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
    75   SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal-1.1)
    76   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include)
    77   SET(TCL_LIBRARY                ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    78   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include)
    79   SET(ZLIB_LIBRARY               ${DEP_LIBRARY_DIR}/zdll.lib CACHE FILEPATH "")
     54  # Certain find scripts don't behave as ecpected to we have
     55  # 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 "")
     58
     59  # Visual Leak Detector
     60  SET(VLD_INCLUDE_DIR  ${DEP_INCLUDE_DIR}/vld-1.9h CACHE PATH "")
     61  SET(VLD_LIBRARY_DIR  ${DEP_LIBRARY_DIR}          CACHE PATH "")
     62  LINK_DIRECTORIES(${VLD_LIBRARY_DIR}) # Used for auto-linking
     63  MARK_AS_ADVANCED(VLD_INCLUDE_DIR VLD_LIBRARY_DIR)
    8064
    8165ENDIF(MSVC)
  • code/branches/pch/cmake/PackageConfigMinGW.cmake

    r2710 r3167  
    2828IF(MINGW)
    2929
    30   # MAJOR: Interface breaking change somewhere or added a new library
    31   # MINOR: Updated a library to a new version
    32   # PATCH: Bug fix or smaller things
    33   SET(DEPENDENCY_VERSION 0.0.1)
    34 
    35   MESSAGE(STATUS "Using library package for the dependencies.")
    36 
    3730  # 64 bit system?
    3831  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    5245  SET(CMAKE_LIBRARY_PATH ${DEP_LIBRARY_DIR} ${DEP_BINARY_DIR})
    5346
    54   # Include paths and other special treatments
    55   SET(ENV{ALUTDIR}               ${DEP_INCLUDE_DIR}/freealut-1.1.0)
    56   SET(ENV{BOOST_ROOT}            ${DEP_INCLUDE_DIR}/boost-1.37.0)
    57   SET(ENV{CEGUIDIR}              ${DEP_INCLUDE_DIR}/cegui-0.6.2)
    58   SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx-2007.aug)
    59   SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet-1.2)
    60   SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua-5.1.4)
    61   SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg-1.1.3)
    62   SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis-1.2.0)
    63   SET(ENV{OGRE_HOME}             ${DEP_INCLUDE_DIR}/ogre-1.4.9)
    64   SET(ENV{OGRE_PLUGIN_DIR}       ${DEP_BINARY_DIR})
    65   SET(ENV{OPENALDIR}             ${DEP_INCLUDE_DIR}/openal-1.1)
    66   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/tcl-8.5.2/include)
    67   SET(TCL_LIBRARY                ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    68   LIST(APPEND CMAKE_INCLUDE_PATH ${DEP_INCLUDE_DIR}/zlib-1.2.3/include)
    69   SET(ZLIB_LIBRARY               ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
     47  # Certain find scripts don't behave as ecpected to we have
     48  # to specify the libraries ourselves.
     49  SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
     50  SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
    7051
    7152ENDIF(MINGW)
  • code/branches/pch/cmake/PrecompiledHeaderFiles.cmake

    r3160 r3167  
    110110    GET_GCC_COMPILER_FLAGS(${_target_name} _pch_gcc_flags)
    111111    # Make sure we recompile the pch file even if only the flags change
    112     FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
     112    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_PCH_GCC_FLAGS}")
     113      SET(_INTERNAL_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
     114      FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
     115    ENDIF()
    113116
    114117    # Set Compile flags for the other source files
     
    157160    ENDIF(CMAKE_COMPILER_IS_GNU)
    158161ENDFUNCTION(PRECOMPILED_HEADER_FILES_POST_TARGET)
    159 
    160 # TODO: Investigate what happens when we suddenly disable PCH for a library
    161 # TODO: C and CXX
  • code/branches/pch/cmake/TargetUtilities.cmake

    r3117 r3167  
    164164  IF(_arg_VERSION)
    165165    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES VERSION ${_arg_VERSION})
    166   ELSEIF(NOT ORXONOX_EXTERNAL)
     166  ELSEIF(NOT _arg_ORXONOX_EXTERNAL)
    167167    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES VERSION ${ORXONOX_VERSION})
    168168  ENDIF()
Note: See TracChangeset for help on using the changeset viewer.