diff options
author | click <none@none> | 2010-08-11 20:55:14 +0200 |
---|---|---|
committer | click <none@none> | 2010-08-11 20:55:14 +0200 |
commit | 780ed1b01c77ac142e1da5851ff7deb832413b11 (patch) | |
tree | fd455dc88cc1b61c01749100fc0d7a303cb6a703 /CMakeLists.txt | |
parent | f482bb1cd54cb562518a10dfd720c9e798b5b19f (diff) |
Buildsystem: Clean up build-process on all platforms
- Windows: Use CMAKE_INSTALL_PREFIX as a 'final install' directory (thanks to paradox for the preload-handling)
(New target INSTALL, -not- included as part of ALL_BUILD (must be specifically run for installation to start)
- All: Build libmpq library (used for tools)
- All: Build extractiontools with hardlinked mpq-library (no need to install it anymore)
- All: Move jemalloc from being harddefined to using a CMake string (fixes issue 3378) (thanks to tru.bazoozoo for the idea, alternative added)
--HG--
branch : trunk
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e51747b8e..5fa868e1792 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,9 +101,18 @@ endif() # if( PREFIX ) - set(CMAKE_INSTALL_PREFIX ${PREFIX}) + set(CMAKE_INSTALL_PREFIX "${PREFIX}") endif() +IF(WIN32) + IF(NOT CYGWIN) + IF(NOT CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX + "${CMAKE_BINARY_DIR}/bin") + ENDIF(NOT CMAKE_INSTALL_PREFIX) + ENDIF(NOT CYGWIN) +ENDIF(WIN32) + # # Handle debugmode compiles (this will require further work for proper WIN32-setups) # @@ -117,24 +126,28 @@ endif() # if( MSVC ) - # Set up MSVC to dump binaries in the <builddir>/bin/<buildtype>/ folder - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + # Set up MSVC to dump files in the <builddir>/bin/<buildtype>/ folder for testing builds before install + + # executable binaries (.exe-files) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # dynamic linked libraries (.dll) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # statically linked libraries - commented out as it's not needed - shown here as an example only + #set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) endif() # # Set default configuration-directory (used on NIX-based platforms only) # - if( NOT CONF_DIR ) set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc) endif() set(LIBSDIR ${CMAKE_INSTALL_PREFIX}/lib) - ##### ##### Build-preparation ##### @@ -169,12 +182,12 @@ message("") # Output information about installation-directories and locations # +message("* Install core to : ${CMAKE_INSTALL_PREFIX}") if( UNIX ) - message("* Install core to : ${CMAKE_INSTALL_PREFIX}") message("* Install libraries to : ${LIBSDIR}") message("* Install configs to : ${CONF_DIR}") - message("") endif() +message("") # # Show infomation about the options selected during configuration @@ -186,11 +199,24 @@ else() message("* Build servers : No") endif() +if( GAMEPCH ) + message("* Build game w/PCH : Yes (default)") +else() + message("* Build game w/PCH : No") +endif() + if( SCRIPTS ) message("* Build with scripts : Yes (default)") add_definitions(-DSCRIPTS) else() message("* Build with scripts : No") + set(SCRIPTPCH 0) +endif() + +if( SCRIPTPCH ) + message("* Build scripts w/PCH : Yes (default)") +else() + message("* Build scripts w/PCH : No") endif() if( TOOLS ) @@ -209,18 +235,6 @@ else() message("* Build in debug-mode : No (default)") endif() -if( GAMEPCH ) - message("* Build game w/PCH : Yes (default)") -else() - message("* Build game w/PCH : No") -endif() - -if( SCRIPTPCH ) - message("* Build scripts w/PCH : Yes (default)") -else() - message("* Build scripts w/PCH : No") -endif() - if( WARNINGS ) message("* Show all warnings : Yes") if( UNIX ) @@ -294,15 +308,14 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1) # if( UNIX ) -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY -) - -add_custom_target(uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" -) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY + ) + add_custom_target(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + ) endif() # |