aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-08-09 23:14:16 +0200
committerclick <none@none>2010-08-09 23:14:16 +0200
commit816acb11a46c39e678efe8012e0ac12c32cd271b (patch)
tree21796f19a54aadf5c6f3623b4358d35fc5261cbf
parent5709c8be0d88a134a25ca28d1cc77203d7666799 (diff)
BuilSystem: Clean up some small but annoying things from my earlier commits:
- return to using default CMake buildconfiguration (release, relwithdebinfo, debug, minsizerel Note: These are not yet populated as buildmodes : relwithdebinfo / minsizerel (will be created later) - change it so that genrev creates revision.h properly (after genrev has been compiled successfully) - split scripts/game PCH creation depending on which part a user wants to compile (default on) (thanks shauren) --HG-- branch : trunk
-rw-r--r--CMakeLists.txt32
-rw-r--r--src/genrevision/CMakeLists.txt9
-rw-r--r--src/server/game/CMakeLists.txt7
-rw-r--r--src/server/scripts/CMakeLists.txt4
4 files changed, 26 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 644377fe545..13aa61a7cee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,10 @@
##### Base setup for project
#####
+#
+# Set projectname (must be done AFTER setting configurationtypes btw...)
+#
+
project(TrinityCore)
# CMake policies
@@ -19,17 +23,6 @@ cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0005 OLD)
#
-# Override configuration-types
-#
-
-if(CMAKE_CONFIGURATION_TYPES)
- set(CMAKE_CONFIGURATION_TYPES Release RelWitDebInfo Debug)
- set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
- "Reset the configurations to what we need"
- FORCE)
-endif()
-
-#
# Force out-of-source build
#
@@ -91,7 +84,8 @@ option(SCRIPTS "Build worldserver with scripts included" 1)
option(TOOLS "Build map/vmap extraction/assembler tools" 0)
option(CLI "Build worldserver with commandline-interface included" 1)
option(DEBUG "Build worldserver with additional debug-code included" 0)
-option(PCH "Use precompiled headers when compiling" 1)
+option(SCRIPTPCH "Use precompiled headers when compiling scripts project" 1)
+option(GAMEPCH "Use precompiled headers when compiling game project" 1)
option(SQL "Copy SQL files during installation" 0)
option(WARNINGS "Enable all compile-warnings during compile" 0)
@@ -169,6 +163,7 @@ execute_process(
# Output some generic information about the core and buildtype chosen
#
+message("")
message("* TrinityCore revision : ${HG_REVISION}")
message("* Build binaries in : ${CMAKE_BUILD_TYPE} mode")
message("")
@@ -224,10 +219,16 @@ else()
message("* Build in debug-mode : No (default)")
endif()
-if( PCH )
- message("* Use PCH : Yes (default)")
+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("* Use PCH : No")
+ message("* Build scripts w/PCH : No")
endif()
if( WARNINGS )
@@ -260,6 +261,7 @@ if( SQL )
else()
message("* Install SQL-files : No (default)")
endif()
+message("")
#####
##### Tweaks to make things operate well
diff --git a/src/genrevision/CMakeLists.txt b/src/genrevision/CMakeLists.txt
index 5e8a002b25d..06f7a6c4bd7 100644
--- a/src/genrevision/CMakeLists.txt
+++ b/src/genrevision/CMakeLists.txt
@@ -16,15 +16,16 @@ add_executable(genrev
)
if( CMAKE_GENERATOR MATCHES "Visual Studio" )
- add_custom_command(TARGET genrev ALL
+ add_custom_command(TARGET genrev
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/genrev ${CMAKE_SOURCE_DIR}
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
else()
- add_custom_command(TARGET genrev ALL
+ add_custom_command(TARGET genrev
+ POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/src/genrevision/genrev ${CMAKE_SOURCE_DIR}
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt
index 5b67fabc510..3ab856cfb97 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -8,10 +8,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-######## game ########
-
-# Enable precompiled headers when using the GCC compiler.
-if(PCH)
+if( GAMEPCH )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
@@ -195,7 +192,7 @@ add_library(game STATIC ${game_STAT_SRCS})
add_dependencies(game genrev)
# Generate precompiled header
-if(PCH)
+if( GAMEPCH )
if(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/gamePCH.h)
elseif(MSVC)
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index 792f6c81bfe..ae9ba964eca 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -18,7 +18,7 @@ file(GLOB_RECURSE scripts_examples Examples/*.cpp Examples/*.h)
file(GLOB_RECURSE scripts_outdoorpvp OutdoorPvP/*.cpp OutdoorPvP/*.h)
# Enable precompiled headers when using the GCC compiler.
-if(PCH)
+if( SCRIPTPCH )
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
@@ -142,7 +142,7 @@ add_library(scripts STATIC ${scripts_STAT_SRCS})
add_dependencies(scripts genrev)
# Generate precompiled header
-if(PCH)
+if( SCRIPTPCH )
if(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(scripts ${CMAKE_SOURCE_DIR}/src/server/scripts/PrecompiledHeaders/ScriptPCH.h)
elseif(MSVC)