summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-12-28 22:11:52 +0100
committermadmaxoft <github@xoft.cz>2013-12-28 22:11:52 +0100
commit11a3132e017136298ebc34e1525ae14add35fe35 (patch)
tree031597d0c7b068c1e95189bb0a48c0980d54a0dd /CMakeLists.txt
parentCMake: Fixed mismatching library vs app builds. (diff)
downloadcuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar.gz
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar.bz2
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar.lz
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar.xz
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.tar.zst
cuberite-11a3132e017136298ebc34e1525ae14add35fe35.zip
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt62
1 files changed, 43 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2afceaab..c053ae92d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,39 +1,63 @@
cmake_minimum_required (VERSION 2.6)
-project (MCServer)
-macro(add_flags FLAGS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}")
- set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${FLAGS}")
- set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${FLAGS}")
-endmacro()
+SET(CMAKE_CXX_FLAGS_DEBUGPROFILE
+ "${CMAKE_CXX_FLAGS_DEBUG} -pg -D_DEBUG"
+ CACHE STRING "Flags used by the C++ compiler during profile builds."
+ FORCE )
+SET(CMAKE_C_FLAGS_DEBUGPROFILE
+ "${CMAKE_C_FLAGS_DEBUG} -pg -D_DEBUG"
+ CACHE STRING "Flags used by the C compiler during profile builds."
+ FORCE )
+SET(CMAKE_EXE_LINKER_FLAGS_DEBUGPROFILE
+ "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -pg"
+ CACHE STRING "Flags used for linking binaries during profile builds."
+ FORCE )
+SET(CMAKE_SHARED_LINKER_FLAGS_DEBUGPROFILE
+ "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -pg"
+ CACHE STRING "Flags used by the shared libraries linker during profile builds."
+ FORCE )
+MARK_AS_ADVANCED(
+ CMAKE_CXX_FLAGS_DEBUGPROFILE
+ CMAKE_C_FLAGS_DEBUGPROFILE
+ CMAKE_EXE_LINKER_FLAGS_DEBUGPROFILE
+ CMAKE_SHARED_LINKER_FLAGS_DEBUGPROFILE )
-SET(CMAKE_CXX_FLAGS_PROFILE
+SET(CMAKE_CXX_FLAGS_RELEASEPROFILE
"${CMAKE_CXX_FLAGS_DEBUG} -pg -DNDEBUG"
CACHE STRING "Flags used by the C++ compiler during profile builds."
FORCE )
-SET(CMAKE_C_FLAGS_PROFILE
+SET(CMAKE_C_FLAGS_RELEASEPROFILE
"${CMAKE_C_FLAGS_DEBUG} -pg -DNDEBUG"
CACHE STRING "Flags used by the C compiler during profile builds."
FORCE )
-SET(CMAKE_EXE_LINKER_FLAGS_PROFILE
+SET(CMAKE_EXE_LINKER_FLAGS_RELEASEPROFILE
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} -pg"
CACHE STRING "Flags used for linking binaries during profile builds."
FORCE )
-SET(CMAKE_SHARED_LINKER_FLAGS_PROFILE
+SET(CMAKE_SHARED_LINKER_FLAGS_RELEASEPROFILE
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -pg"
CACHE STRING "Flags used by the shared libraries linker during profile builds."
FORCE )
MARK_AS_ADVANCED(
- CMAKE_CXX_FLAGS_PROFILE
- CMAKE_C_FLAGS_PROFILE
- CMAKE_EXE_LINKER_FLAGS_PROFILE
- CMAKE_SHARED_LINKER_FLAGS_PROFILE )
+ CMAKE_CXX_FLAGS_RELEASEPROFILE
+ CMAKE_C_FLAGS_RELEASEPROFILE
+ CMAKE_EXE_LINKER_FLAGS_RELEASEPROFILE
+ CMAKE_SHARED_LINKER_FLAGS_RELEASEPROFILE )
+
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release;DebugProfile;ReleaseProfile" CACHE STRING "" FORCE)
+project (MCServer)
+
+macro(add_flags FLAGS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${FLAGS}")
+ set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${FLAGS}")
+endmacro()
# Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC):
if (NOT MSVC)