summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2016-08-11 17:05:52 +0200
committerYehonal <yehonal.azeroth@gmail.com>2016-08-11 20:09:10 +0200
commit4330b759b7c240998b56db3f13a91cf305ac6ad7 (patch)
treed74dfa968c81f02fb6c08a90cfa107e43765c316 /src
parent34d4accb5b5204774baba38e39d6405d716e1568 (diff)
always set cmake $CONF_DIR and add in preprocessor defines
Diffstat (limited to 'src')
-rw-r--r--src/cmake/macros/CheckPlatform.cmake2
-rw-r--r--src/cmake/platform/after_platform.cmake4
-rw-r--r--src/cmake/showoptions.cmake5
-rw-r--r--src/server/authserver/CMakeLists.txt4
-rw-r--r--src/server/worldserver/CMakeLists.txt4
5 files changed, 14 insertions, 5 deletions
diff --git a/src/cmake/macros/CheckPlatform.cmake b/src/cmake/macros/CheckPlatform.cmake
index 49bd1b9539..5ef5f6d9a5 100644
--- a/src/cmake/macros/CheckPlatform.cmake
+++ b/src/cmake/macros/CheckPlatform.cmake
@@ -14,3 +14,5 @@ if(WIN32)
elseif(UNIX)
include("${CMAKE_SOURCE_DIR}/src/cmake/platform/unix/settings.cmake")
endif()
+
+include("${CMAKE_SOURCE_DIR}/src/cmake/platform/after_platform.cmake")
diff --git a/src/cmake/platform/after_platform.cmake b/src/cmake/platform/after_platform.cmake
new file mode 100644
index 0000000000..bf02e719d8
--- /dev/null
+++ b/src/cmake/platform/after_platform.cmake
@@ -0,0 +1,4 @@
+if( NOT CONF_DIR )
+ set(CONF_DIR ${CMAKE_INSTALL_PREFIX})
+ message(STATUS "Using installation path for configuration files")
+endif()
diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake
index f1cbc263c5..0b935bd6c1 100644
--- a/src/cmake/showoptions.cmake
+++ b/src/cmake/showoptions.cmake
@@ -11,8 +11,11 @@ message("")
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
if( UNIX )
message("* Install libraries to : ${LIBSDIR}")
- message("* Install configs to : ${CONF_DIR}")
endif()
+
+message("* Install configs to : ${CONF_DIR}")
+add_definitions(-D_CONF_DIR="\\"${CONF_DIR}\\"")
+
message("")
# Show infomation about the options selected during configuration
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index cbf2fa186f..fd918f0dc9 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -98,12 +98,12 @@ endif()
if( UNIX )
install(TARGETS authserver DESTINATION bin)
- install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
elseif( WIN32 )
install(TARGETS authserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(FILES authserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
+install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
+
# Generate precompiled header
if (USE_COREPCH)
add_cxx_pch(authserver ${authserver_PCH_HDR} ${authserver_PCH_SRC})
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 1b6b3ae2b7..72cc040e2f 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -198,12 +198,12 @@ endif()
if( UNIX )
install(TARGETS worldserver DESTINATION bin)
- install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
elseif( WIN32 )
install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
+install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
+
# Generate precompiled header
if( USE_COREPCH )
add_cxx_pch(worldserver ${worldserver_PCH_HDR} ${worldserver_PCH_SRC})