diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac1c8138b..0bb1e442a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -290,9 +290,6 @@ foreach(arg ${ALLFILES}) endforeach() FILE(WRITE "AllFiles.lst" "${ALLFILESLINES}") - -set(EXECUTABLE Cuberite) - if (MSVC) get_directory_property(BINDING_OUTPUTS DIRECTORY "Bindings" DEFINITION BINDING_OUTPUTS) get_directory_property(BINDING_DEPENDENCIES DIRECTORY "Bindings" DEFINITION BINDING_DEPENDENCIES) @@ -324,46 +321,45 @@ if (MSVC) endif() endif() -add_executable(${EXECUTABLE} ${SOURCE}) +add_executable(${CMAKE_PROJECT_NAME} ${SOURCE}) # Output the executable into the $/Server folder, so that it has access to external resources: -set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Server) -SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES +SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server ) - # Make the debug executable have a "_debug" suffix -SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES DEBUG_POSTFIX "_debug") +SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_debug") # Make the profiled executables have a "_profile" postfix -SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES DEBUGPROFILE_POSTFIX "_debug_profile") -SET_TARGET_PROPERTIES(${EXECUTABLE} PROPERTIES RELEASEPROFILE_POSTFIX "_profile") +SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES DEBUGPROFILE_POSTFIX "_debug_profile") +SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES RELEASEPROFILE_POSTFIX "_profile") # Precompiled headers (2nd part) if (MSVC) SET_TARGET_PROPERTIES( - ${EXECUTABLE} PROPERTIES COMPILE_FLAGS "/Yu\"Globals.h\"" + ${CMAKE_PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/Yu\"Globals.h\"" OBJECT_DEPENDS "$(IntDir)/$(TargetName.pch)" ) endif () if (NOT MSVC) - target_link_libraries(${EXECUTABLE} + target_link_libraries(${CMAKE_PROJECT_NAME} OSSupport HTTPServer Bindings Items Blocks Noise Protocol Generating WorldStorage Mobs Entities Simulator IncrementalRedstoneSimulator BlockEntities UI PolarSSL++ ) endif () + if (WIN32) - target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib) + target_link_libraries(${CMAKE_PROJECT_NAME} expat tolualib ws2_32.lib Psapi.lib) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") @@ -371,7 +367,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") add_flags_lnk(-L/usr/ports/devel) endif() -target_link_libraries(${EXECUTABLE} luaexpat jsoncpp_lib_static mbedtls zlib sqlite lua SQLiteCpp event_core event_extra) +target_link_libraries(${CMAKE_PROJECT_NAME} luaexpat jsoncpp_lib_static mbedtls zlib sqlite lua SQLiteCpp event_core event_extra) # Create a folder for Bindings' documentation: FILE(MAKE_DIRECTORY "Bindings/docs") |