summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-12 10:04:16 +0100
committermadmaxoft <github@xoft.cz>2014-01-12 10:04:16 +0100
commit180b9b90993870532a8daa2ee6498005b6c3bf49 (patch)
treedac846b760b6f5fd294fbd771975dd55b0856c0d /src/CMakeLists.txt
parentFixed Linux configuration. (diff)
parentDisabled a useless MSVC warning in Bindings.cpp. (diff)
downloadcuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar.gz
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar.bz2
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar.lz
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar.xz
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.tar.zst
cuberite-180b9b90993870532a8daa2ee6498005b6c3bf49.zip
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 88e469b74..853138769 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,7 @@ set(FOLDERS ${FOLDERS} WorldStorage Mobs Entities Simulator UI BlockEntities)
-if (NOT WIN32)
+if (NOT MSVC)
foreach(folder ${FOLDERS})
add_subdirectory(${folder})
endforeach(folder)
@@ -62,18 +62,25 @@ else ()
endif()
-if (UNIX)
- set(EXECUTABLE ../MCServer/MCServer)
-else ()
- set(EXECUTABLE MCServer)
-endif ()
-
+set(EXECUTABLE MCServer)
add_executable(${EXECUTABLE} ${SOURCE})
+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/MCServer)
+
+if (MSVC)
+ # MSVC generator adds a "Debug" or "Release" postfixes to the EXECUTABLE_OUTPUT_PATH, we need to cancel them:
+ SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES PREFIX "../")
+ SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES IMPORT_PREFIX "../")
+endif()
+
+
+# Make the debug executable have a "_debug" suffix
+SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES DEBUG_POSTFIX "_debug")
+
# Precompiled headers (2nd part)
-if (WIN32)
+if (MSVC)
SET_TARGET_PROPERTIES(
${EXECUTABLE} PROPERTIES COMPILE_FLAGS "/Yu\"Globals.h\""
OBJECT_DEPENDS "$(IntDir)/$(TargetName.pch)"
@@ -81,7 +88,7 @@ if (WIN32)
endif ()
-if (NOT WIN32)
+if (NOT MSVC)
target_link_libraries(${EXECUTABLE} OSSupport HTTPServer Bindings Items Blocks)
target_link_libraries(${EXECUTABLE} Protocol Generating WorldStorage)
target_link_libraries(${EXECUTABLE} Mobs Entities Simulator UI BlockEntities)