From 443309c5dbfdeaa70dea4adcf206c463587c3e5f Mon Sep 17 00:00:00 2001 From: dizzy Date: Thu, 23 Aug 2007 07:44:18 +0000 Subject: [PATCH] Second try for the hardcoded configs default path, this time putting them in config.h where having spaces in path shouldnt matter. Removed the old solution. Also removed the base source dir from searched included paths because it's not needed (we only need base binary dir for "config.h") and it was "hiding" the config.h from the out of source build because #include saw a config.h (generated from an autotools build) in the source dir first. --- pvpgn/ConfigureChecks.cmake | 5 +++++ pvpgn/config.h.cmake | 4 ++++ pvpgn/src/CMakeLists.txt | 2 +- pvpgn/src/bnetd/CMakeLists.txt | 2 -- pvpgn/src/d2cs/CMakeLists.txt | 2 -- pvpgn/src/d2dbs/CMakeLists.txt | 2 -- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pvpgn/ConfigureChecks.cmake b/pvpgn/ConfigureChecks.cmake index 6a0e53d..6938a48 100644 --- a/pvpgn/ConfigureChecks.cmake +++ b/pvpgn/ConfigureChecks.cmake @@ -31,6 +31,11 @@ check_library_exists(socket socket "" HAVE_LIBSOCKET) check_library_exists(resolv inet_aton "" HAVE_LIBRESOLV) check_library_exists(bind __inet_aton "" HAVE_LIBBIND) +# set default hardcoded config paths +set(BNETD_DEFAULT_CONF_FILE "${SYSCONFDIR}/bnetd.conf") +set(D2CS_DEFAULT_CONF_FILE "${SYSCONFDIR}/d2cs.conf") +set(D2DBS_DEFAULT_CONF_FILE "${SYSCONFDIR}/d2dbs.conf") + # storage module checks if(WITH_MYSQL) find_package(MySQL REQUIRED) diff --git a/pvpgn/config.h.cmake b/pvpgn/config.h.cmake index 7896c4b..0132d01 100644 --- a/pvpgn/config.h.cmake +++ b/pvpgn/config.h.cmake @@ -112,4 +112,8 @@ #cmakedefine HAVE__SNPRINTF #cmakedefine HAVE_SETPGRP +#cmakedefine BNETD_DEFAULT_CONF_FILE "${BNETD_DEFAULT_CONF_FILE}" +#cmakedefine D2CS_DEFAULT_CONF_FILE "${D2CS_DEFAULT_CONF_FILE}" +#cmakedefine D2DBS_DEFAULT_CONF_FILE "${D2DBS_DEFAULT_CONF_FILE}" + #endif diff --git a/pvpgn/src/CMakeLists.txt b/pvpgn/src/CMakeLists.txt index 8dbe1ae..61c0475 100644 --- a/pvpgn/src/CMakeLists.txt +++ b/pvpgn/src/CMakeLists.txt @@ -1,5 +1,5 @@ #first setup the includes and link paths -include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} +include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${ZLIB_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${SQLITE3_INCLUDE_DIR}) diff --git a/pvpgn/src/bnetd/CMakeLists.txt b/pvpgn/src/bnetd/CMakeLists.txt index 4590b39..52e0f27 100644 --- a/pvpgn/src/bnetd/CMakeLists.txt +++ b/pvpgn/src/bnetd/CMakeLists.txt @@ -1,5 +1,3 @@ -add_definitions("-DBNETD_DEFAULT_CONF_FILE=\\\"${SYSCONFDIR}/bnetd.conf\\\"") - add_executable(bnetd account.cpp account.h account_wrap.cpp account_wrap.h adbanner.cpp adbanner.h alias_command.cpp alias_command.h anongame.cpp diff --git a/pvpgn/src/d2cs/CMakeLists.txt b/pvpgn/src/d2cs/CMakeLists.txt index ccee012..7238b23 100644 --- a/pvpgn/src/d2cs/CMakeLists.txt +++ b/pvpgn/src/d2cs/CMakeLists.txt @@ -1,5 +1,3 @@ -add_definitions("-DD2CS_DEFAULT_CONF_FILE=\\\"${SYSCONFDIR}/d2cs.conf\\\"") - add_executable(d2cs bit.h bnetd.cpp bnetd.h cmdline.cpp cmdline.h connection.cpp connection.h d2charfile.cpp d2charfile.h d2charlist.cpp d2charlist.h diff --git a/pvpgn/src/d2dbs/CMakeLists.txt b/pvpgn/src/d2dbs/CMakeLists.txt index 0c109eb..c0b00e4 100644 --- a/pvpgn/src/d2dbs/CMakeLists.txt +++ b/pvpgn/src/d2dbs/CMakeLists.txt @@ -1,5 +1,3 @@ -add_definitions("-DD2DBS_DEFAULT_CONF_FILE=\\\"${SYSCONFDIR}/d2dbs.conf\\\"") - add_executable(d2dbs charlock.cpp charlock.h cmdline.cpp cmdline.h d2ladder.cpp d2ladder.h dbsdupecheck.cpp dbsdupecheck.h dbserver.cpp dbserver.h dbspacket.cpp