aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoripriver <g1ran1q@gmail.com>2020-06-17 14:42:49 +0000
committerCarbenium <carbenium@outlook.com>2020-06-19 15:06:03 +0200
commitdc467ee0f6d0a49be4bd20b621f141228dfec736 (patch)
treeb1b4b8e99b3a0537b324c0e49b7276c3b3112aba
parentd26c16b8638282459665a9620288dad26b05c499 (diff)
Additional cmake entry for configs
Closes #24812 Co-authored-by: Carbenium <carbenium@outlook.com>
-rw-r--r--cmake/options.cmake1
-rw-r--r--cmake/showoptions.cmake9
-rw-r--r--src/server/authserver/CMakeLists.txt10
-rw-r--r--src/server/worldserver/CMakeLists.txt10
4 files changed, 24 insertions, 6 deletions
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 5d2adeff6f8..af4be4b3332 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -49,6 +49,7 @@ endif()
option(WITH_WARNINGS "Show all warnings during compile" 0)
option(WITH_COREDEBUG "Include additional debug-code in core" 0)
option(WITH_STRICT_DATABASE_TYPE_CHECKS "Enable strict checking of database field value accessors" 0)
+option(COPY_CONF "Copy authserver and worldserver .conf.dist files to the project dir" 1)
set(WITH_SOURCE_TREE "hierarchical" CACHE STRING "Build the source tree for IDE's.")
set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical hierarchical-folders)
option(WITHOUT_GIT "Disable the GIT testing routines" 0)
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake
index eab421e0b12..dcbeda554ac 100644
--- a/cmake/showoptions.cmake
+++ b/cmake/showoptions.cmake
@@ -12,6 +12,15 @@ message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
if( UNIX )
message("* Install configs to : ${CONF_DIR}")
endif()
+
+if( COPY_CONF )
+ if( UNIX )
+ message("* Install configs to : ${CONF_DIR}")
+ else()
+ message("* Install configs to : ${CMAKE_INSTALL_PREFIX}")
+ endif()
+endif()
+
message("")
# Show infomation about the options selected during configuration
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index 43685fd5621..d1d28a49ce9 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -62,7 +62,7 @@ set_target_properties(authserver
FOLDER
"server")
-if( WIN32 )
+if( COPY_CONF AND WIN32 )
if ( "${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild" )
add_custom_command(TARGET authserver
POST_BUILD
@@ -78,10 +78,14 @@ endif()
if( UNIX )
install(TARGETS authserver DESTINATION bin)
- install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
+ if( COPY_CONF )
+ install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
+ endif()
elseif( WIN32 )
install(TARGETS authserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(FILES authserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ if( COPY_CONF )
+ install(FILES authserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
endif()
# Generate precompiled header
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index f378808f771..adea0911929 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -74,7 +74,7 @@ if (WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES)
add_dependencies(worldserver ${WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES})
endif()
-if( WIN32 )
+if( COPY_CONF AND WIN32 )
if ( "${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild" )
add_custom_command(TARGET worldserver
POST_BUILD
@@ -90,10 +90,14 @@ endif()
if( UNIX )
install(TARGETS worldserver DESTINATION bin)
- install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
+ if( COPY_CONF )
+ install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
+ endif()
elseif( WIN32 )
install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ if( COPY_CONF )
+ install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
endif()
# Generate precompiled header