summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/msinttypes/CMakeLists.txt1
-rw-r--r--3rdparty/mt19937ar/CMakeLists.txt7
-rw-r--r--CMakeLists.txt254
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/char/CMakeLists.txt88
-rw-r--r--src/char_sql/CMakeLists.txt98
-rw-r--r--src/common/CMakeLists.txt135
-rw-r--r--src/login/CMakeLists.txt38
-rw-r--r--src/login/sql/CMakeLists.txt46
-rw-r--r--src/login/txt/CMakeLists.txt46
-rw-r--r--src/map/CMakeLists.txt67
-rw-r--r--src/map/sql/CMakeLists.txt108
-rw-r--r--src/map/txt/CMakeLists.txt108
-rw-r--r--src/tool/CMakeLists.txt34
14 files changed, 594 insertions, 437 deletions
diff --git a/3rdparty/msinttypes/CMakeLists.txt b/3rdparty/msinttypes/CMakeLists.txt
index acf17f5b4..f17c6f596 100644
--- a/3rdparty/msinttypes/CMakeLists.txt
+++ b/3rdparty/msinttypes/CMakeLists.txt
@@ -4,4 +4,5 @@ find_path( MSINTTYPES_INCLUDE_DIRS "inttypes.h"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/include"
NO_DEFAULT_PATH )
mark_as_advanced( MSINTTYPES_INCLUDE_DIRS )
+set( GLOBAL_INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MSINTTYPES_INCLUDE_DIRS} CACHE INTERNAL "" )
endif()
diff --git a/3rdparty/mt19937ar/CMakeLists.txt b/3rdparty/mt19937ar/CMakeLists.txt
index 46f155b41..08eff5790 100644
--- a/3rdparty/mt19937ar/CMakeLists.txt
+++ b/3rdparty/mt19937ar/CMakeLists.txt
@@ -7,3 +7,10 @@ find_path( MT19937AR_SOURCE_DIR "mt19937ar.c"
NO_DEFAULT_PATH )
mark_as_advanced( MT19937AR_INCLUDE_DIRS )
mark_as_advanced( MT19937AR_SOURCE_DIR )
+
+set( MT19937AR_HEADERS
+ "${CMAKE_CURRENT_SOURCE_DIR}/mt19937ar.h"
+ CACHE INTERNAL "mt19937ar headers" )
+set( MT19937AR_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/mt19937ar.c"
+ CACHE INTERNAL "mt19937ar sources" )
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a56059956..59529c442 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,128 +23,128 @@ endif()
# Debug stuff
#
if( NOT SKIP_DEBUG )
-message( STATUS "DEBUG: # Variables That Change Behavior" )
-message( STATUS "DEBUG: BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}" )
-message( STATUS "DEBUG: CMAKE_BACKWARDS_COMPATIBILITY=${CMAKE_BACKWARDS_COMPATIBILITY}" )
-message( STATUS "DEBUG: CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" )
-message( STATUS "DEBUG: CMAKE_COLOR_MAKEFILE=${CMAKE_COLOR_MAKEFILE}" )
-message( STATUS "DEBUG: CMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}" )
-message( STATUS "DEBUG: CMAKE_FIND_LIBRARY_PREFIXES=${CMAKE_FIND_LIBRARY_PREFIXES}" )
-message( STATUS "DEBUG: CMAKE_FIND_LIBRARY_SUFFIXES=${CMAKE_FIND_LIBRARY_SUFFIXES}" )
-message( STATUS "DEBUG: CMAKE_IGNORE_PATH=${CMAKE_IGNORE_PATH}" )
-message( STATUS "DEBUG: CMAKE_INCLUDE_PATH=${CMAKE_INCLUDE_PATH}" )
-message( STATUS "DEBUG: CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" )
-message( STATUS "DEBUG: CMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}" )
-message( STATUS "DEBUG: CMAKE_MFC_FLAG=${CMAKE_MFC_FLAG}" )
-message( STATUS "DEBUG: CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" )
-message( STATUS "DEBUG: CMAKE_NOT_USING_CONFIG_FLAGS=${CMAKE_NOT_USING_CONFIG_FLAGS}" )
-message( STATUS "DEBUG: CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" )
-message( STATUS "DEBUG: CMAKE_PROGRAM_PATH=${CMAKE_PROGRAM_PATH}" )
-message( STATUS "DEBUG: CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_IGNORE_PATH=${CMAKE_SYSTEM_IGNORE_PATH}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_SYSTEM_INCLUDE_PATH}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_LIBRARY_PATH=${CMAKE_SYSTEM_LIBRARY_PATH}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_PREFIX_PATH=${CMAKE_SYSTEM_PREFIX_PATH}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_PROGRAM_PATH=${CMAKE_SYSTEM_PROGRAM_PATH}" )
-message( STATUS "DEBUG: CMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}" )
-message( STATUS "DEBUG: # Variables That Describe the System" )
-message( STATUS "DEBUG: APPLE=${APPLE}" )
-message( STATUS "DEBUG: BORLAND=${BORLAND}" )
-message( STATUS "DEBUG: CMAKE_CL_64=${CMAKE_CL_64}" )
-message( STATUS "DEBUG: CMAKE_COMPILER_2005=${CMAKE_COMPILER_2005}" )
-message( STATUS "DEBUG: CMAKE_HOST_APPLE=${CMAKE_HOST_APPLE}" )
-message( STATUS "DEBUG: CMAKE_HOST_SYSTEM=${CMAKE_HOST_SYSTEM}" )
-message( STATUS "DEBUG: CMAKE_HOST_SYSTEM_NAME=${CMAKE_HOST_SYSTEM_NAME}" )
-message( STATUS "DEBUG: CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}" )
-message( STATUS "DEBUG: CMAKE_HOST_SYSTEM_VERSION=${CMAKE_HOST_SYSTEM_VERSION}" )
-message( STATUS "DEBUG: CMAKE_HOST_UNIX=${CMAKE_HOST_UNIX}" )
-message( STATUS "DEBUG: CMAKE_HOST_WIN32=${CMAKE_HOST_WIN32}" )
-message( STATUS "DEBUG: CMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM=${CMAKE_SYSTEM}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}" )
-message( STATUS "DEBUG: CMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}" )
-message( STATUS "DEBUG: CYGWIN=${CYGWIN}" )
-message( STATUS "DEBUG: MSVC=${MSVC}" )
-message( STATUS "DEBUG: MSVC80=${MSVC80}" )
-message( STATUS "DEBUG: MSVC_IDE=${MSVC_IDE}" )
-message( STATUS "DEBUG: MSVC_VERSION=${MSVC_VERSION}" )
-message( STATUS "DEBUG: UNIX=${UNIX}" )
-message( STATUS "DEBUG: WIN32=${WIN32}" )
-message( STATUS "DEBUG: XCODE_VERSION=${XCODE_VERSION}" )
-message( STATUS "DEBUG: # Variables that Control the Build" )
-message( STATUS "DEBUG: CMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" )
-message( STATUS "DEBUG: CMAKE_BUILD_WITH_INSTALL_RPATH=${CMAKE_BUILD_WITH_INSTALL_RPATH}" )
-message( STATUS "DEBUG: CMAKE_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX}" )
-message( STATUS "DEBUG: CMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" )
-message( STATUS "DEBUG: CMAKE_INCLUDE_CURRENT_DIR=${CMAKE_INCLUDE_CURRENT_DIR}" )
-message( STATUS "DEBUG: CMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_NAME_DIR}" )
-message( STATUS "DEBUG: CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}" )
-message( STATUS "DEBUG: CMAKE_INSTALL_RPATH_USE_LINK_PATH=${CMAKE_INSTALL_RPATH_USE_LINK_PATH}" )
-message( STATUS "DEBUG: CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" )
-message( STATUS "DEBUG: CMAKE_LIBRARY_PATH_FLAG=${CMAKE_LIBRARY_PATH_FLAG}" )
-message( STATUS "DEBUG: CMAKE_LINK_DEF_FILE_FLAG=${CMAKE_LINK_DEF_FILE_FLAG}" )
-message( STATUS "DEBUG: CMAKE_LINK_LIBRARY_FILE_FLAG=${CMAKE_LINK_LIBRARY_FILE_FLAG}" )
-message( STATUS "DEBUG: CMAKE_LINK_LIBRARY_FLAG=${CMAKE_LINK_LIBRARY_FLAG}" )
-message( STATUS "DEBUG: CMAKE_NO_BUILTIN_CHRPATH=${CMAKE_NO_BUILTIN_CHRPATH}" )
-message( STATUS "DEBUG: CMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" )
-message( STATUS "DEBUG: CMAKE_SKIP_BUILD_RPATH=${CMAKE_SKIP_BUILD_RPATH}" )
-message( STATUS "DEBUG: CMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION}" )
-message( STATUS "DEBUG: CMAKE_USE_RELATIVE_PATHS=${CMAKE_USE_RELATIVE_PATHS}" )
-message( STATUS "DEBUG: EXECUTABLE_OUTPUT_PATH=${EXECUTABLE_OUTPUT_PATH}" )
-message( STATUS "DEBUG: LIBRARY_OUTPUT_PATH=${LIBRARY_OUTPUT_PATH}" )
-message( STATUS "DEBUG: # Variables that Provide Information" )
-message( STATUS "DEBUG: CMAKE_AR=${CMAKE_AR}" )
-message( STATUS "DEBUG: CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}" )
-message( STATUS "DEBUG: CMAKE_BUILD_TOOL=${CMAKE_BUILD_TOOL}" )
-message( STATUS "DEBUG: CMAKE_CACHEFILE_DIR=${CMAKE_CACHEFILE_DIR}" )
-message( STATUS "DEBUG: CMAKE_CACHE_MAJOR_VERSION=${CMAKE_CACHE_MAJOR_VERSION}" )
-message( STATUS "DEBUG: CMAKE_CACHE_MINOR_VERSION=${CMAKE_CACHE_MINOR_VERSION}" )
-message( STATUS "DEBUG: CMAKE_CACHE_PATCH_VERSION=${CMAKE_CACHE_PATCH_VERSION}" )
-message( STATUS "DEBUG: CMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR}" )
-message( STATUS "DEBUG: CMAKE_COMMAND=${CMAKE_COMMAND}" )
-message( STATUS "DEBUG: CMAKE_CROSSCOMPILING=${CMAKE_CROSSCOMPILING}" )
-message( STATUS "DEBUG: CMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND}" )
-message( STATUS "DEBUG: CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}" )
-message( STATUS "DEBUG: CMAKE_CURRENT_LIST_DIR=${CMAKE_CURRENT_LIST_DIR}" )
-message( STATUS "DEBUG: CMAKE_CURRENT_LIST_FILE=${CMAKE_CURRENT_LIST_FILE}" )
-message( STATUS "DEBUG: CMAKE_CURRENT_LIST_LINE=${CMAKE_CURRENT_LIST_LINE}" )
-message( STATUS "DEBUG: CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" )
-message( STATUS "DEBUG: CMAKE_DL_LIBS=${CMAKE_DL_LIBS}" )
-message( STATUS "DEBUG: CMAKE_EDIT_COMMAND=${CMAKE_EDIT_COMMAND}" )
-message( STATUS "DEBUG: CMAKE_EXECUTABLE_SUFFIX=${CMAKE_EXECUTABLE_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_EXTRA_GENERATOR=${CMAKE_EXTRA_GENERATOR}" )
-message( STATUS "DEBUG: CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES=${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}" )
-message( STATUS "DEBUG: CMAKE_GENERATOR=${CMAKE_GENERATOR}" )
-message( STATUS "DEBUG: CMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}" )
-message( STATUS "DEBUG: CMAKE_IMPORT_LIBRARY_PREFIX=${CMAKE_IMPORT_LIBRARY_PREFIX}" )
-message( STATUS "DEBUG: CMAKE_IMPORT_LIBRARY_SUFFIX=${CMAKE_IMPORT_LIBRARY_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_LINK_LIBRARY_SUFFIX=${CMAKE_LINK_LIBRARY_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_MAJOR_VERSION=${CMAKE_MAJOR_VERSION}" )
-message( STATUS "DEBUG: CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" )
-message( STATUS "DEBUG: CMAKE_MINOR_VERSION=${CMAKE_MINOR_VERSION}" )
-message( STATUS "DEBUG: CMAKE_PARENT_LIST_FILE=${CMAKE_PARENT_LIST_FILE}" )
-message( STATUS "DEBUG: CMAKE_PATCH_VERSION=${CMAKE_PATCH_VERSION}" )
-message( STATUS "DEBUG: CMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME}" )
-message( STATUS "DEBUG: CMAKE_RANLIB=${CMAKE_RANLIB}" )
-message( STATUS "DEBUG: CMAKE_ROOT=${CMAKE_ROOT}" )
-message( STATUS "DEBUG: CMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}" )
-message( STATUS "DEBUG: CMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}" )
-message( STATUS "DEBUG: CMAKE_SHARED_MODULE_SUFFIX=${CMAKE_SHARED_MODULE_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}" )
-message( STATUS "DEBUG: CMAKE_SKIP_RPATH=${CMAKE_SKIP_RPATH}" )
-message( STATUS "DEBUG: CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}" )
-message( STATUS "DEBUG: CMAKE_STANDARD_LIBRARIES=${CMAKE_STANDARD_LIBRARIES}" )
-message( STATUS "DEBUG: CMAKE_STATIC_LIBRARY_PREFIX=${CMAKE_STATIC_LIBRARY_PREFIX}" )
-message( STATUS "DEBUG: CMAKE_STATIC_LIBRARY_SUFFIX=${CMAKE_STATIC_LIBRARY_SUFFIX}" )
-message( STATUS "DEBUG: CMAKE_TWEAK_VERSION=${CMAKE_TWEAK_VERSION}" )
-message( STATUS "DEBUG: CMAKE_USING_VC_FREE_TOOLS=${CMAKE_USING_VC_FREE_TOOLS}" )
-message( STATUS "DEBUG: CMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}" )
-message( STATUS "DEBUG: CMAKE_VERSION=${CMAKE_VERSION}" )
-message( STATUS "DEBUG: PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}" )
-message( STATUS "DEBUG: PROJECT_NAME=${PROJECT_NAME}" )
-message( STATUS "DEBUG: PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" )
+message( "DEBUG: # Variables That Change Behavior" )
+message( "DEBUG: BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}" )
+message( "DEBUG: CMAKE_BACKWARDS_COMPATIBILITY=${CMAKE_BACKWARDS_COMPATIBILITY}" )
+message( "DEBUG: CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" )
+message( "DEBUG: CMAKE_COLOR_MAKEFILE=${CMAKE_COLOR_MAKEFILE}" )
+message( "DEBUG: CMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}" )
+message( "DEBUG: CMAKE_FIND_LIBRARY_PREFIXES=${CMAKE_FIND_LIBRARY_PREFIXES}" )
+message( "DEBUG: CMAKE_FIND_LIBRARY_SUFFIXES=${CMAKE_FIND_LIBRARY_SUFFIXES}" )
+message( "DEBUG: CMAKE_IGNORE_PATH=${CMAKE_IGNORE_PATH}" )
+message( "DEBUG: CMAKE_INCLUDE_PATH=${CMAKE_INCLUDE_PATH}" )
+message( "DEBUG: CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" )
+message( "DEBUG: CMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}" )
+message( "DEBUG: CMAKE_MFC_FLAG=${CMAKE_MFC_FLAG}" )
+message( "DEBUG: CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" )
+message( "DEBUG: CMAKE_NOT_USING_CONFIG_FLAGS=${CMAKE_NOT_USING_CONFIG_FLAGS}" )
+message( "DEBUG: CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" )
+message( "DEBUG: CMAKE_PROGRAM_PATH=${CMAKE_PROGRAM_PATH}" )
+message( "DEBUG: CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY}" )
+message( "DEBUG: CMAKE_SYSTEM_IGNORE_PATH=${CMAKE_SYSTEM_IGNORE_PATH}" )
+message( "DEBUG: CMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_SYSTEM_INCLUDE_PATH}" )
+message( "DEBUG: CMAKE_SYSTEM_LIBRARY_PATH=${CMAKE_SYSTEM_LIBRARY_PATH}" )
+message( "DEBUG: CMAKE_SYSTEM_PREFIX_PATH=${CMAKE_SYSTEM_PREFIX_PATH}" )
+message( "DEBUG: CMAKE_SYSTEM_PROGRAM_PATH=${CMAKE_SYSTEM_PROGRAM_PATH}" )
+message( "DEBUG: CMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}" )
+message( "DEBUG: # Variables That Describe the System" )
+message( "DEBUG: APPLE=${APPLE}" )
+message( "DEBUG: BORLAND=${BORLAND}" )
+message( "DEBUG: CMAKE_CL_64=${CMAKE_CL_64}" )
+message( "DEBUG: CMAKE_COMPILER_2005=${CMAKE_COMPILER_2005}" )
+message( "DEBUG: CMAKE_HOST_APPLE=${CMAKE_HOST_APPLE}" )
+message( "DEBUG: CMAKE_HOST_SYSTEM=${CMAKE_HOST_SYSTEM}" )
+message( "DEBUG: CMAKE_HOST_SYSTEM_NAME=${CMAKE_HOST_SYSTEM_NAME}" )
+message( "DEBUG: CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}" )
+message( "DEBUG: CMAKE_HOST_SYSTEM_VERSION=${CMAKE_HOST_SYSTEM_VERSION}" )
+message( "DEBUG: CMAKE_HOST_UNIX=${CMAKE_HOST_UNIX}" )
+message( "DEBUG: CMAKE_HOST_WIN32=${CMAKE_HOST_WIN32}" )
+message( "DEBUG: CMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}" )
+message( "DEBUG: CMAKE_SYSTEM=${CMAKE_SYSTEM}" )
+message( "DEBUG: CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" )
+message( "DEBUG: CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}" )
+message( "DEBUG: CMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}" )
+message( "DEBUG: CYGWIN=${CYGWIN}" )
+message( "DEBUG: MSVC=${MSVC}" )
+message( "DEBUG: MSVC80=${MSVC80}" )
+message( "DEBUG: MSVC_IDE=${MSVC_IDE}" )
+message( "DEBUG: MSVC_VERSION=${MSVC_VERSION}" )
+message( "DEBUG: UNIX=${UNIX}" )
+message( "DEBUG: WIN32=${WIN32}" )
+message( "DEBUG: XCODE_VERSION=${XCODE_VERSION}" )
+message( "DEBUG: # Variables that Control the Build" )
+message( "DEBUG: CMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" )
+message( "DEBUG: CMAKE_BUILD_WITH_INSTALL_RPATH=${CMAKE_BUILD_WITH_INSTALL_RPATH}" )
+message( "DEBUG: CMAKE_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX}" )
+message( "DEBUG: CMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" )
+message( "DEBUG: CMAKE_INCLUDE_CURRENT_DIR=${CMAKE_INCLUDE_CURRENT_DIR}" )
+message( "DEBUG: CMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_NAME_DIR}" )
+message( "DEBUG: CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}" )
+message( "DEBUG: CMAKE_INSTALL_RPATH_USE_LINK_PATH=${CMAKE_INSTALL_RPATH_USE_LINK_PATH}" )
+message( "DEBUG: CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" )
+message( "DEBUG: CMAKE_LIBRARY_PATH_FLAG=${CMAKE_LIBRARY_PATH_FLAG}" )
+message( "DEBUG: CMAKE_LINK_DEF_FILE_FLAG=${CMAKE_LINK_DEF_FILE_FLAG}" )
+message( "DEBUG: CMAKE_LINK_LIBRARY_FILE_FLAG=${CMAKE_LINK_LIBRARY_FILE_FLAG}" )
+message( "DEBUG: CMAKE_LINK_LIBRARY_FLAG=${CMAKE_LINK_LIBRARY_FLAG}" )
+message( "DEBUG: CMAKE_NO_BUILTIN_CHRPATH=${CMAKE_NO_BUILTIN_CHRPATH}" )
+message( "DEBUG: CMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" )
+message( "DEBUG: CMAKE_SKIP_BUILD_RPATH=${CMAKE_SKIP_BUILD_RPATH}" )
+message( "DEBUG: CMAKE_TRY_COMPILE_CONFIGURATION=${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+message( "DEBUG: CMAKE_USE_RELATIVE_PATHS=${CMAKE_USE_RELATIVE_PATHS}" )
+message( "DEBUG: EXECUTABLE_OUTPUT_PATH=${EXECUTABLE_OUTPUT_PATH}" )
+message( "DEBUG: LIBRARY_OUTPUT_PATH=${LIBRARY_OUTPUT_PATH}" )
+message( "DEBUG: # Variables that Provide Information" )
+message( "DEBUG: CMAKE_AR=${CMAKE_AR}" )
+message( "DEBUG: CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}" )
+message( "DEBUG: CMAKE_BUILD_TOOL=${CMAKE_BUILD_TOOL}" )
+message( "DEBUG: CMAKE_CACHEFILE_DIR=${CMAKE_CACHEFILE_DIR}" )
+message( "DEBUG: CMAKE_CACHE_MAJOR_VERSION=${CMAKE_CACHE_MAJOR_VERSION}" )
+message( "DEBUG: CMAKE_CACHE_MINOR_VERSION=${CMAKE_CACHE_MINOR_VERSION}" )
+message( "DEBUG: CMAKE_CACHE_PATCH_VERSION=${CMAKE_CACHE_PATCH_VERSION}" )
+message( "DEBUG: CMAKE_CFG_INTDIR=${CMAKE_CFG_INTDIR}" )
+message( "DEBUG: CMAKE_COMMAND=${CMAKE_COMMAND}" )
+message( "DEBUG: CMAKE_CROSSCOMPILING=${CMAKE_CROSSCOMPILING}" )
+message( "DEBUG: CMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND}" )
+message( "DEBUG: CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}" )
+message( "DEBUG: CMAKE_CURRENT_LIST_DIR=${CMAKE_CURRENT_LIST_DIR}" )
+message( "DEBUG: CMAKE_CURRENT_LIST_FILE=${CMAKE_CURRENT_LIST_FILE}" )
+message( "DEBUG: CMAKE_CURRENT_LIST_LINE=${CMAKE_CURRENT_LIST_LINE}" )
+message( "DEBUG: CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" )
+message( "DEBUG: CMAKE_DL_LIBS=${CMAKE_DL_LIBS}" )
+message( "DEBUG: CMAKE_EDIT_COMMAND=${CMAKE_EDIT_COMMAND}" )
+message( "DEBUG: CMAKE_EXECUTABLE_SUFFIX=${CMAKE_EXECUTABLE_SUFFIX}" )
+message( "DEBUG: CMAKE_EXTRA_GENERATOR=${CMAKE_EXTRA_GENERATOR}" )
+message( "DEBUG: CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES=${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}" )
+message( "DEBUG: CMAKE_GENERATOR=${CMAKE_GENERATOR}" )
+message( "DEBUG: CMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}" )
+message( "DEBUG: CMAKE_IMPORT_LIBRARY_PREFIX=${CMAKE_IMPORT_LIBRARY_PREFIX}" )
+message( "DEBUG: CMAKE_IMPORT_LIBRARY_SUFFIX=${CMAKE_IMPORT_LIBRARY_SUFFIX}" )
+message( "DEBUG: CMAKE_LINK_LIBRARY_SUFFIX=${CMAKE_LINK_LIBRARY_SUFFIX}" )
+message( "DEBUG: CMAKE_MAJOR_VERSION=${CMAKE_MAJOR_VERSION}" )
+message( "DEBUG: CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" )
+message( "DEBUG: CMAKE_MINOR_VERSION=${CMAKE_MINOR_VERSION}" )
+message( "DEBUG: CMAKE_PARENT_LIST_FILE=${CMAKE_PARENT_LIST_FILE}" )
+message( "DEBUG: CMAKE_PATCH_VERSION=${CMAKE_PATCH_VERSION}" )
+message( "DEBUG: CMAKE_PROJECT_NAME=${CMAKE_PROJECT_NAME}" )
+message( "DEBUG: CMAKE_RANLIB=${CMAKE_RANLIB}" )
+message( "DEBUG: CMAKE_ROOT=${CMAKE_ROOT}" )
+message( "DEBUG: CMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}" )
+message( "DEBUG: CMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX}" )
+message( "DEBUG: CMAKE_SHARED_MODULE_PREFIX=${CMAKE_SHARED_MODULE_PREFIX}" )
+message( "DEBUG: CMAKE_SHARED_MODULE_SUFFIX=${CMAKE_SHARED_MODULE_SUFFIX}" )
+message( "DEBUG: CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}" )
+message( "DEBUG: CMAKE_SKIP_RPATH=${CMAKE_SKIP_RPATH}" )
+message( "DEBUG: CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}" )
+message( "DEBUG: CMAKE_STANDARD_LIBRARIES=${CMAKE_STANDARD_LIBRARIES}" )
+message( "DEBUG: CMAKE_STATIC_LIBRARY_PREFIX=${CMAKE_STATIC_LIBRARY_PREFIX}" )
+message( "DEBUG: CMAKE_STATIC_LIBRARY_SUFFIX=${CMAKE_STATIC_LIBRARY_SUFFIX}" )
+message( "DEBUG: CMAKE_TWEAK_VERSION=${CMAKE_TWEAK_VERSION}" )
+message( "DEBUG: CMAKE_USING_VC_FREE_TOOLS=${CMAKE_USING_VC_FREE_TOOLS}" )
+message( "DEBUG: CMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}" )
+message( "DEBUG: CMAKE_VERSION=${CMAKE_VERSION}" )
+message( "DEBUG: PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}" )
+message( "DEBUG: PROJECT_NAME=${PROJECT_NAME}" )
+message( "DEBUG: PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" )
set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "test install to dir" FORCE )
#set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "test install to source dir" FORCE )
endif( NOT SKIP_DEBUG )
@@ -153,12 +153,13 @@ endif( NOT SKIP_DEBUG )
#
# Global stuff
#
-set( GLOBAL_LIBRARIES "" CACHE INTERNAL "" )
-set( GLOBAL_INCLUDE_DIRS "" CACHE INTERNAL "" )
-set( GLOBAL_DEFINITIONS "" CACHE INTERNAL "" )
+set( GLOBAL_LIBRARIES CACHE INTERNAL "" )
+set( GLOBAL_INCLUDE_DIRS CACHE INTERNAL "" )
+set( GLOBAL_DEFINITIONS CACHE INTERNAL "" )
mark_as_advanced( GLOBAL_LIBRARIES GLOBAL_INCLUDE_DIRS GLOBAL_DEFINITIONS )
if( WIN32 )
list( APPEND GLOBAL_DEFINITIONS FD_SETSIZE=4096 )
+ list( APPEND GLOBAL_LIBRARIES "oldnames.lib" "ws2_32.lib" )
endif()
if( MSVC )
list( APPEND GLOBAL_DEFINITIONS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE DB_MANUAL_CAST_TO_UNION )
@@ -170,6 +171,9 @@ endif()
#
set( PACKETVER ""
CACHE STRING "Sets the PACKETVER define of the servers. (see src/common/mmo.h)" )
+if( PACKETVER )
+ list( APPEND GLOBAL_DEFINITIONS PACKETVER=${PACKETVER} )
+endif()
#####################################################################
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 55b382539..b2747c3c7 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ Date Added
* Changed grfio.c include order and moved zlib include from the header to the source. [FlavioJS]
* Merged decode_zip/encode_zip from eapp's grfio to replace our direct use of zlib's uncompress/compress.
* Fixed strict-aliasing warning in mapcache's GetFloat.
+ * CMake: src/common builds static libraries common_base/common_sql, that are used as dependencies by the other targets.
2011/07/05
* CMake: split txt and sql variants of login-server and map-server. [FlavioJS]
2011/07/04
diff --git a/src/char/CMakeLists.txt b/src/char/CMakeLists.txt
index 5c2d66c3c..1f6f1ea11 100644
--- a/src/char/CMakeLists.txt
+++ b/src/char/CMakeLists.txt
@@ -1,70 +1,50 @@
#
-# setup
+# char txt
#
-set( MT19937AR_SOURCES
-# "${MT19937AR_SOURCE_DIR}/mt19937ar.c"
- )
-set( COMMON_SOURCES
- "${COMMON_SOURCE_DIR}/core.c"
- "${COMMON_SOURCE_DIR}/db.c"
- "${COMMON_SOURCE_DIR}/ers.c"
-# "${COMMON_SOURCE_DIR}/grfio.c"
- "${COMMON_SOURCE_DIR}/lock.c"
- "${COMMON_SOURCE_DIR}/malloc.c"
- "${COMMON_SOURCE_DIR}/mapindex.c"
-# "${COMMON_SOURCE_DIR}/md5calc.c"
-# "${COMMON_SOURCE_DIR}/nullpo.c"
- "${COMMON_SOURCE_DIR}/plugins.c"
-# "${COMMON_SOURCE_DIR}/random.c"
- "${COMMON_SOURCE_DIR}/showmsg.c"
- "${COMMON_SOURCE_DIR}/socket.c"
- "${COMMON_SOURCE_DIR}/strlib.c"
- "${COMMON_SOURCE_DIR}/timer.c"
- "${COMMON_SOURCE_DIR}/utils.c"
+if( HAVE_common_base )
+message( STATUS "Creating target char-server" )
+set( TXT_CHAR_HEADERS
+ "${CMAKE_CURRENT_SOURCE_DIR}/char.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_guild.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_homun.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_party.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_pet.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_status.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_storage.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/inter.h"
)
-set( CHAR_SOURCES
- "char.c"
- "int_guild.c"
- "int_homun.c"
- "int_party.c"
- "int_pet.c"
- "int_status.c"
- "int_storage.c"
- "inter.c"
+set( TXT_CHAR_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/char.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_guild.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_homun.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_party.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_pet.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_status.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_storage.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/inter.c"
)
-
-
-#
-# char txt
-#
-if( USE_ZLIB )
-message ( STATUS "Creating target char-server" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
+set( DEPENDENCIES common_base )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} TXT_ONLY )
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${CHAR_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} )
-source_group( char FILES ${CHAR_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${TXT_CHAR_HEADERS} ${TXT_CHAR_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} )
+source_group( char FILES ${TXT_CHAR_HEADERS} ${TXT_CHAR_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( char-server ${SOURCE_FILES} )
-target_link_libraries( char-server ${LIBRARIES} )
+add_dependencies( char-server ${DEPENDENCIES} )
+target_link_libraries( char-server ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( char-server PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS char-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "char-server" )
endif()
-message ( STATUS "Creating target char-server - done" )
+message( STATUS "Creating target char-server - done" )
+set( HAVE_char-server ON CACHE BOOL "char-server target is available" )
+mark_as_advanced( HAVE_char-server )
else()
-message ( STATUS "Skipping target char-server (requires ZLIB)" )
+message( STATUS "Skipping target char-server (requires common_base)" )
+unset( HAVE_char-server CACHE )
endif()
diff --git a/src/char_sql/CMakeLists.txt b/src/char_sql/CMakeLists.txt
index 412393b21..7d3b7ad7e 100644
--- a/src/char_sql/CMakeLists.txt
+++ b/src/char_sql/CMakeLists.txt
@@ -1,74 +1,56 @@
#
-# setup
+# char sql
#
-set( MT19937AR_SOURCES
-# "${MT19937AR_SOURCE_DIR}/mt19937ar.c"
- )
-set( COMMON_SOURCES
- "${COMMON_SOURCE_DIR}/core.c"
- "${COMMON_SOURCE_DIR}/db.c"
- "${COMMON_SOURCE_DIR}/ers.c"
-# "${COMMON_SOURCE_DIR}/grfio.c"
-# "${COMMON_SOURCE_DIR}/lock.c"
- "${COMMON_SOURCE_DIR}/malloc.c"
- "${COMMON_SOURCE_DIR}/mapindex.c"
-# "${COMMON_SOURCE_DIR}/md5calc.c"
-# "${COMMON_SOURCE_DIR}/nullpo.c"
- "${COMMON_SOURCE_DIR}/plugins.c"
-# "${COMMON_SOURCE_DIR}/random.c"
- "${COMMON_SOURCE_DIR}/showmsg.c"
- "${COMMON_SOURCE_DIR}/socket.c"
- "${COMMON_SOURCE_DIR}/sql.c"
- "${COMMON_SOURCE_DIR}/strlib.c"
- "${COMMON_SOURCE_DIR}/timer.c"
- "${COMMON_SOURCE_DIR}/utils.c"
+if( HAVE_common_sql )
+message( STATUS "Creating target char-server_sql" )
+set( SQL_CHAR_HEADERS
+ "${CMAKE_CURRENT_SOURCE_DIR}/char.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_auction.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_guild.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_homun.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_mail.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_mercenary.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_party.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_pet.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_quest.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_storage.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/inter.h"
)
-set( CHAR_SOURCES
- "char.c"
- "int_auction.c"
- "int_guild.c"
- "int_homun.c"
- "int_mail.c"
- "int_mercenary.c"
- "int_party.c"
- "int_pet.c"
- "int_quest.c"
- "int_storage.c"
- "inter.c"
+set( SQL_CHAR_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/char.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_auction.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_guild.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_homun.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_mail.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_mercenary.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_party.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_pet.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_quest.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/int_storage.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/inter.c"
)
-
-
-#
-# char sql
-#
-if( USE_ZLIB AND USE_MYSQL )
-message ( STATUS "Creating target char-server_sql" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} ${MYSQL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
+set( DEPENDENCIES common_sql )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${CHAR_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} )
-source_group( char FILES ${CHAR_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_CHAR_HEADERS} ${SQL_CHAR_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
+source_group( char FILES ${SQL_CHAR_HEADERS} ${SQL_CHAR_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( char-server_sql ${SOURCE_FILES} )
-target_link_libraries( char-server_sql ${LIBRARIES} )
+add_dependencies( char-server_sql ${DEPENDENCIES} )
+target_link_libraries( char-server_sql ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( char-server_sql PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS char-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "char-server_sql" )
endif()
-message ( STATUS "Creating target char-server_sql - done" )
+message( STATUS "Creating target char-server_sql - done" )
+set( HAVE_char-server_sql ON CACHE BOOL "char-server_sql target is available" )
+mark_as_advanced( HAVE_char-server_sql )
else()
-message ( STATUS "Skipping target char-server_sql (requires ZLIB and MYSQL)" )
+message( STATUS "Skipping target char-server_sql (requires common_sql)" )
+unset( HAVE_char-server_sql CACHE )
endif()
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 7a4443abc..0241dfbca 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -1,13 +1,5 @@
-set( COMMON_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
- CACHE PATH "common include directories" )
-set( COMMON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
- CACHE PATH "common source directory" )
-mark_as_advanced( COMMON_INCLUDE_DIRS )
-mark_as_advanced( COMMON_SOURCE_DIR )
-
-
-#
+#####################################################################
# Find svnversion
#
message( STATUS "Detecting svnversion" )
@@ -31,10 +23,133 @@ if( SVNVERSION )
else()
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h "" )
endif()
-set( GLOBAL_INCLUDE_DIRS "${GLOBAL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "" )
+set( GLOBAL_INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "" )
set( SVNVERSION ${SVNVERSION}
CACHE STRING "SVN version of the source code" )
if( INSTALL_BUILD_DATA )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h DESTINATION ${CMAKE_INSTALL_PREFIX}/src/common )
endif()
message( STATUS "Creating svnversion.h - done" )
+
+#####################################################################
+# setup
+#
+set( COMMON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
+ CACHE PATH "common source directory" )
+mark_as_advanced( COMMON_SOURCE_DIR )
+
+set( COMMON_ALL_HEADERS
+ "${CMAKE_CURRENT_BINARY_DIR}/svnversion.h"
+ "${COMMON_SOURCE_DIR}/cbasetypes.h"
+ "${COMMON_SOURCE_DIR}/mmo.h"
+ "${COMMON_SOURCE_DIR}/plugin.h"
+ "${COMMON_SOURCE_DIR}/version.h"
+ )
+
+set( COMMON_MINI_HEADERS
+ ${COMMON_ALL_HEADERS}
+ "${COMMON_SOURCE_DIR}/core.h"
+ "${COMMON_SOURCE_DIR}/malloc.h"
+ "${COMMON_SOURCE_DIR}/showmsg.h"
+ "${COMMON_SOURCE_DIR}/strlib.h"
+ CACHE INTERNAL "" )
+set( COMMON_MINI_SOURCES
+ "${COMMON_SOURCE_DIR}/core.c"
+ "${COMMON_SOURCE_DIR}/malloc.c"
+ "${COMMON_SOURCE_DIR}/showmsg.c"
+ "${COMMON_SOURCE_DIR}/strlib.c"
+ CACHE INTERNAL "" )
+set( COMMON_MINI_DEFINITIONS MINICORE CACHE INTERNAL "" )
+
+
+#
+# common_base
+#
+if( USE_ZLIB )
+message( STATUS "Creating target common_base" )
+set( COMMON_BASE_HEADERS
+ ${COMMON_ALL_HEADERS}
+ "${COMMON_SOURCE_DIR}/core.h"
+ "${COMMON_SOURCE_DIR}/db.h"
+ "${COMMON_SOURCE_DIR}/ers.h"
+ "${COMMON_SOURCE_DIR}/grfio.h"
+ "${COMMON_SOURCE_DIR}/lock.h"
+ "${COMMON_SOURCE_DIR}/malloc.h"
+ "${COMMON_SOURCE_DIR}/mapindex.h"
+ "${COMMON_SOURCE_DIR}/md5calc.h"
+ "${COMMON_SOURCE_DIR}/nullpo.h"
+ "${COMMON_SOURCE_DIR}/plugins.h"
+ "${COMMON_SOURCE_DIR}/random.h"
+ "${COMMON_SOURCE_DIR}/showmsg.h"
+ "${COMMON_SOURCE_DIR}/socket.h"
+ "${COMMON_SOURCE_DIR}/strlib.h"
+ "${COMMON_SOURCE_DIR}/timer.h"
+ "${COMMON_SOURCE_DIR}/utils.h"
+ CACHE INTERNAL "common_base headers" )
+set( COMMON_BASE_SOURCES
+ "${COMMON_SOURCE_DIR}/core.c"
+ "${COMMON_SOURCE_DIR}/db.c"
+ "${COMMON_SOURCE_DIR}/ers.c"
+ "${COMMON_SOURCE_DIR}/grfio.c"
+ "${COMMON_SOURCE_DIR}/lock.c"
+ "${COMMON_SOURCE_DIR}/malloc.c"
+ "${COMMON_SOURCE_DIR}/mapindex.c"
+ "${COMMON_SOURCE_DIR}/md5calc.c"
+ "${COMMON_SOURCE_DIR}/nullpo.c"
+ "${COMMON_SOURCE_DIR}/plugins.c"
+ "${COMMON_SOURCE_DIR}/random.c"
+ "${COMMON_SOURCE_DIR}/showmsg.c"
+ "${COMMON_SOURCE_DIR}/socket.c"
+ "${COMMON_SOURCE_DIR}/strlib.c"
+ "${COMMON_SOURCE_DIR}/timer.c"
+ "${COMMON_SOURCE_DIR}/utils.c"
+ CACHE INTERNAL "common_base sources" )
+set( LIBRARIES ${ZLIB_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} )
+set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
+set( SOURCE_FILES ${MT19937AR_HEADERS} ${MT19937AR_SOURCES} ${COMMON_BASE_HEADERS} ${COMMON_BASE_SOURCES} )
+source_group( mt19937ar FILES ${MT19937AR_HEADERS} ${MT19937AR_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_BASE_SOURCES} )
+add_library( common_base ${SOURCE_FILES} )
+target_link_libraries( common_base ${LIBRARIES} )
+set_target_properties( common_base PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
+include_directories( ${INCLUDE_DIRS} )
+message( STATUS "Creating target common_base - done" )
+set( HAVE_common_base ON CACHE BOOL "common_base target is available" )
+mark_as_advanced( HAVE_common_base )
+else()
+message( STATUS "Skipping target common_base (requires ZLIB)" )
+unset( HAVE_common_base CACHE )
+endif()
+
+
+#
+# common_sql
+#
+if( HAVE_common_base AND USE_MYSQL )
+message( STATUS "Creating target common_sql" )
+set( COMMON_SQL_HEADERS
+ ${COMMON_ALL_HEADERS}
+ "${CMAKE_CURRENT_SOURCE_DIR}/sql.h"
+ CACHE INTERNAL "common_sql headers" )
+set( COMMON_SQL_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/sql.c"
+ CACHE INTERNAL "common_sql sources" )
+set( DEPENDENCIES common_base )
+set( LIBRARIES ${MYSQL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIRS} )
+set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
+set( SOURCE_FILES ${COMMON_SQL_HEADERS} ${COMMON_SQL_SOURCES} )
+source_group( common FILES ${COMMON_SQL_HEADERS} ${COMMON_SQL_SOURCES} )
+add_library( common_sql ${SOURCE_FILES} )
+add_dependencies( common_sql ${DEPENDENCIES} )
+target_link_libraries( common_sql ${LIBRARIES} ${DEPENDENCIES} )
+set_target_properties( common_sql PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
+include_directories( ${INCLUDE_DIRS} )
+message( STATUS "Creating target common_sql - done" )
+set( HAVE_common_sql ON CACHE BOOL "common_sql target is available" )
+mark_as_advanced( HAVE_common_sql )
+else()
+message( STATUS "Skipping target common_sql (requires common_base and MYSQL)" )
+unset( HAVE_common_sql CACHE )
+endif()
diff --git a/src/login/CMakeLists.txt b/src/login/CMakeLists.txt
index 82390ebd8..afa4e5f20 100644
--- a/src/login/CMakeLists.txt
+++ b/src/login/CMakeLists.txt
@@ -2,43 +2,7 @@
#
# setup
#
-set( MT19937AR_SOURCES
- "${MT19937AR_SOURCE_DIR}/mt19937ar.c"
- )
-set( COMMON_SOURCES
- "${COMMON_SOURCE_DIR}/core.c"
- "${COMMON_SOURCE_DIR}/db.c"
- "${COMMON_SOURCE_DIR}/ers.c"
-# "${COMMON_SOURCE_DIR}/grfio.c"
- "${COMMON_SOURCE_DIR}/lock.c"
- "${COMMON_SOURCE_DIR}/malloc.c"
-# "${COMMON_SOURCE_DIR}/mapindex.c"
- "${COMMON_SOURCE_DIR}/md5calc.c"
-# "${COMMON_SOURCE_DIR}/nullpo.c"
- "${COMMON_SOURCE_DIR}/plugins.c"
- "${COMMON_SOURCE_DIR}/random.c"
- "${COMMON_SOURCE_DIR}/showmsg.c"
- "${COMMON_SOURCE_DIR}/socket.c"
- "${COMMON_SOURCE_DIR}/strlib.c"
- "${COMMON_SOURCE_DIR}/timer.c"
- "${COMMON_SOURCE_DIR}/utils.c"
- )
-set( COMMON_SQL_SOURCES
- "${COMMON_SOURCE_DIR}/sql.c"
- )
-set( LOGIN_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/login.c"
- )
-set( LOGIN_TXT_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/account_txt.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/ipban_txt.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/loginlog_txt.c"
- )
-set( LOGIN_SQL_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/account_sql.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/ipban_sql.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/loginlog_sql.c"
- )
+set( LOGIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
#
diff --git a/src/login/sql/CMakeLists.txt b/src/login/sql/CMakeLists.txt
index 3cecb8840..50bf256e2 100644
--- a/src/login/sql/CMakeLists.txt
+++ b/src/login/sql/CMakeLists.txt
@@ -2,33 +2,41 @@
#
# login sql
#
-if( USE_ZLIB AND USE_MYSQL )
-message ( STATUS "Creating target login-server_sql" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} ${MYSQL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
+if( HAVE_common_sql )
+message( STATUS "Creating target login-server_sql" )
+set( SQL_LOGIN_HEADERS
+ "${LOGIN_SOURCE_DIR}/account.h"
+ "${LOGIN_SOURCE_DIR}/ipban.h"
+ "${LOGIN_SOURCE_DIR}/login.h"
+ "${LOGIN_SOURCE_DIR}/loginlog.h"
+ )
+set( SQL_LOGIN_SOURCES
+ "${LOGIN_SOURCE_DIR}/account_sql.c"
+ "${LOGIN_SOURCE_DIR}/ipban_sql.c"
+ "${LOGIN_SOURCE_DIR}/login.c"
+ "${LOGIN_SOURCE_DIR}/loginlog_sql.c"
+ )
+set( DEPENDENCIES common_sql )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} WITH_SQL )
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${COMMON_SQL_SOURCES} ${LOGIN_SOURCES} ${LOGIN_SQL_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} ${COMMON_SQL_SOURCES} )
-source_group( login FILES ${LOGIN_SOURCES} ${LOGIN_SQL_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_LOGIN_HEADERS} ${SQL_LOGIN_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
+source_group( login FILES ${SQL_LOGIN_HEADERS} ${SQL_LOGIN_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( login-server_sql ${SOURCE_FILES} )
-target_link_libraries( login-server_sql ${LIBRARIES} )
+add_dependencies( login-server_sql ${DEPENDENCIES} )
+target_link_libraries( login-server_sql ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( login-server_sql PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS login-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "login-server_sql" )
endif()
-message ( STATUS "Creating target login-server_sql - done" )
+message( STATUS "Creating target login-server_sql - done" )
+set( HAVE_login-server_sql ON CACHE BOOL "login-server_sql target is available" )
+mark_as_advanced( HAVE_login-server_sql )
else()
-message ( STATUS "Skipping target login-server_sql (requires ZLIB and MYSQL)" )
+message( STATUS "Skipping target login-server_sql (requires common_sql)" )
+unset( HAVE_login-server_sql CACHE )
endif()
diff --git a/src/login/txt/CMakeLists.txt b/src/login/txt/CMakeLists.txt
index 0c567f9e2..dff7d322c 100644
--- a/src/login/txt/CMakeLists.txt
+++ b/src/login/txt/CMakeLists.txt
@@ -2,33 +2,41 @@
#
# login txt
#
-if( USE_ZLIB )
-message ( STATUS "Creating target login-server" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
+if( HAVE_common_base )
+message( STATUS "Creating target login-server" )
+set( TXT_LOGIN_HEADERS
+ "${LOGIN_SOURCE_DIR}/account.h"
+ "${LOGIN_SOURCE_DIR}/ipban.h"
+ "${LOGIN_SOURCE_DIR}/login.h"
+ "${LOGIN_SOURCE_DIR}/loginlog.h"
+ )
+set( TXT_LOGIN_SOURCES
+ "${LOGIN_SOURCE_DIR}/account_txt.c"
+ "${LOGIN_SOURCE_DIR}/ipban_txt.c"
+ "${LOGIN_SOURCE_DIR}/login.c"
+ "${LOGIN_SOURCE_DIR}/loginlog_txt.c"
+ )
+set( DEPENDENCIES common_base )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} WITH_TXT )
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${LOGIN_SOURCES} ${LOGIN_TXT_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} )
-source_group( login FILES ${LOGIN_SOURCES} ${LOGIN_TXT_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${TXT_LOGIN_HEADERS} ${TXT_LOGIN_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} )
+source_group( login FILES ${TXT_LOGIN_HEADERS} ${TXT_LOGIN_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( login-server ${SOURCE_FILES} )
-target_link_libraries( login-server ${LIBRARIES} )
+add_dependencies( login-server ${DEPENDENCIES} )
+target_link_libraries( login-server ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( login-server PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS login-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "login-server" )
endif()
-message ( STATUS "Creating target login-server - done" )
+message( STATUS "Creating target login-server - done" )
+set( HAVE_login-server ON CACHE BOOL "login-server target is available" )
+mark_as_advanced( HAVE_login-server )
else()
-message ( STATUS "Skipping target login-server (requires ZLIB)" )
+message( STATUS "Skipping target login-server (requires common_base)" )
+unset( HAVE_login-server CACHE )
endif()
diff --git a/src/map/CMakeLists.txt b/src/map/CMakeLists.txt
index 4ff85fa19..9199702be 100644
--- a/src/map/CMakeLists.txt
+++ b/src/map/CMakeLists.txt
@@ -2,72 +2,7 @@
#
# setup
#
-set( MT19937AR_SOURCES
- "${MT19937AR_SOURCE_DIR}/mt19937ar.c"
- )
-set( COMMON_SOURCES
- "${COMMON_SOURCE_DIR}/core.c"
- "${COMMON_SOURCE_DIR}/db.c"
- "${COMMON_SOURCE_DIR}/ers.c"
- "${COMMON_SOURCE_DIR}/grfio.c"
- "${COMMON_SOURCE_DIR}/lock.c"
- "${COMMON_SOURCE_DIR}/malloc.c"
- "${COMMON_SOURCE_DIR}/mapindex.c"
- "${COMMON_SOURCE_DIR}/md5calc.c"
- "${COMMON_SOURCE_DIR}/nullpo.c"
- "${COMMON_SOURCE_DIR}/plugins.c"
- "${COMMON_SOURCE_DIR}/random.c"
- "${COMMON_SOURCE_DIR}/showmsg.c"
- "${COMMON_SOURCE_DIR}/socket.c"
- "${COMMON_SOURCE_DIR}/strlib.c"
- "${COMMON_SOURCE_DIR}/timer.c"
- "${COMMON_SOURCE_DIR}/utils.c"
- )
-set( COMMON_SQL_SOURCES
- "${COMMON_SOURCE_DIR}/sql.c"
- )
-set( MAP_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/atcommand.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/battle.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/battleground.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/buyingstore.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/chat.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/chrif.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/clif.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/date.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/duel.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/guild.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/homunculus.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/instance.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/intif.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/itemdb.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/log.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/mail.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/map.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/mercenary.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/mob.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/npc.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/npc_chat.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/party.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/path.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/pc.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/pet.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/quest.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/script.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/searchstore.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/skill.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/status.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/storage.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/trade.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/unit.c"
- "${CMAKE_CURRENT_SOURCE_DIR}/vending.c"
- )
-set( MAP_TXT_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/mapreg_txt.c"
- )
-set( MAP_SQL_SOURCES
- "${CMAKE_CURRENT_SOURCE_DIR}/mapreg_sql.c"
- )
+set( MAP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
#
diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt
index 13b1af32c..c7922f276 100644
--- a/src/map/sql/CMakeLists.txt
+++ b/src/map/sql/CMakeLists.txt
@@ -2,38 +2,108 @@
#
# map sql
#
-if( USE_ZLIB AND USE_MYSQL )
-message ( STATUS "Creating target map-server_sql" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} ${MYSQL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
+if( HAVE_common_sql )
+message( STATUS "Creating target map-server_sql" )
+set( SQL_MAP_HEADERS
+ "${MAP_SOURCE_DIR}/atcommand.h"
+ "${MAP_SOURCE_DIR}/battle.h"
+ "${MAP_SOURCE_DIR}/battleground.h"
+ "${MAP_SOURCE_DIR}/buyingstore.h"
+ "${MAP_SOURCE_DIR}/chat.h"
+ "${MAP_SOURCE_DIR}/chrif.h"
+ "${MAP_SOURCE_DIR}/clif.h"
+ "${MAP_SOURCE_DIR}/date.h"
+ "${MAP_SOURCE_DIR}/duel.h"
+ "${MAP_SOURCE_DIR}/guild.h"
+ "${MAP_SOURCE_DIR}/homunculus.h"
+ "${MAP_SOURCE_DIR}/instance.h"
+ "${MAP_SOURCE_DIR}/intif.h"
+ "${MAP_SOURCE_DIR}/itemdb.h"
+ "${MAP_SOURCE_DIR}/log.h"
+ "${MAP_SOURCE_DIR}/mail.h"
+ "${MAP_SOURCE_DIR}/map.h"
+ "${MAP_SOURCE_DIR}/mapreg.h"
+ "${MAP_SOURCE_DIR}/mercenary.h"
+ "${MAP_SOURCE_DIR}/mob.h"
+ "${MAP_SOURCE_DIR}/npc.h"
+ "${MAP_SOURCE_DIR}/party.h"
+ "${MAP_SOURCE_DIR}/path.h"
+ "${MAP_SOURCE_DIR}/pc.h"
+ "${MAP_SOURCE_DIR}/pet.h"
+ "${MAP_SOURCE_DIR}/quest.h"
+ "${MAP_SOURCE_DIR}/script.h"
+ "${MAP_SOURCE_DIR}/searchstore.h"
+ "${MAP_SOURCE_DIR}/skill.h"
+ "${MAP_SOURCE_DIR}/status.h"
+ "${MAP_SOURCE_DIR}/storage.h"
+ "${MAP_SOURCE_DIR}/trade.h"
+ "${MAP_SOURCE_DIR}/unit.h"
+ "${MAP_SOURCE_DIR}/vending.h"
+ )
+set( SQL_MAP_SOURCES
+ "${MAP_SOURCE_DIR}/atcommand.c"
+ "${MAP_SOURCE_DIR}/battle.c"
+ "${MAP_SOURCE_DIR}/battleground.c"
+ "${MAP_SOURCE_DIR}/buyingstore.c"
+ "${MAP_SOURCE_DIR}/chat.c"
+ "${MAP_SOURCE_DIR}/chrif.c"
+ "${MAP_SOURCE_DIR}/clif.c"
+ "${MAP_SOURCE_DIR}/date.c"
+ "${MAP_SOURCE_DIR}/duel.c"
+ "${MAP_SOURCE_DIR}/guild.c"
+ "${MAP_SOURCE_DIR}/homunculus.c"
+ "${MAP_SOURCE_DIR}/instance.c"
+ "${MAP_SOURCE_DIR}/intif.c"
+ "${MAP_SOURCE_DIR}/itemdb.c"
+ "${MAP_SOURCE_DIR}/log.c"
+ "${MAP_SOURCE_DIR}/mail.c"
+ "${MAP_SOURCE_DIR}/map.c"
+ "${MAP_SOURCE_DIR}/mapreg_sql.c"
+ "${MAP_SOURCE_DIR}/mercenary.c"
+ "${MAP_SOURCE_DIR}/mob.c"
+ "${MAP_SOURCE_DIR}/npc.c"
+ "${MAP_SOURCE_DIR}/npc_chat.c"
+ "${MAP_SOURCE_DIR}/party.c"
+ "${MAP_SOURCE_DIR}/path.c"
+ "${MAP_SOURCE_DIR}/pc.c"
+ "${MAP_SOURCE_DIR}/pet.c"
+ "${MAP_SOURCE_DIR}/quest.c"
+ "${MAP_SOURCE_DIR}/script.c"
+ "${MAP_SOURCE_DIR}/searchstore.c"
+ "${MAP_SOURCE_DIR}/skill.c"
+ "${MAP_SOURCE_DIR}/status.c"
+ "${MAP_SOURCE_DIR}/storage.c"
+ "${MAP_SOURCE_DIR}/trade.c"
+ "${MAP_SOURCE_DIR}/unit.c"
+ "${MAP_SOURCE_DIR}/vending.c"
+ )
+set( DEPENDENCIES common_sql )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
if( USE_PCRE )
message( STATUS "Using PCRE" )
list( APPEND LIBRARIES ${PCRE_LIBRARIES} )
list( APPEND INCLUDE_DIRS ${PCRE_INCLUDE_DIRS} )
+ list( APPEND DEFINITIONS PCRE_SUPPORT )
endif()
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${COMMON_SQL_SOURCES} ${MAP_SOURCES} ${MAP_SQL_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} ${COMMON_SQL_SOURCES} )
-source_group( map FILES ${MAP_SOURCES} ${MAP_SQL_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
+source_group( map FILES ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( map-server_sql ${SOURCE_FILES} )
-target_link_libraries( map-server_sql ${LIBRARIES} )
+add_dependencies( map-server_sql ${DEPENDENCIES} )
+target_link_libraries( map-server_sql ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( map-server_sql PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS map-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "map-server_sql" )
endif()
-message ( STATUS "Creating target map-server_sql - done" )
+message( STATUS "Creating target map-server_sql - done" )
+set( HAVE_map-server_sql ON CACHE BOOL "map-server_sql target is available" )
+mark_as_advanced( HAVE_map-server_sql )
else()
-message ( STATUS "Skipping target map-server_sql (requires ZLIB and MYSQL; optional PCRE)" )
+message( STATUS "Skipping target map-server_sql (requires common_sql; optional PCRE)" )
+unset( HAVE_map-server_sql CACHE )
endif()
diff --git a/src/map/txt/CMakeLists.txt b/src/map/txt/CMakeLists.txt
index f62885b7a..544e00c87 100644
--- a/src/map/txt/CMakeLists.txt
+++ b/src/map/txt/CMakeLists.txt
@@ -2,38 +2,108 @@
#
# map txt
#
-if( USE_ZLIB )
-message ( STATUS "Creating target map-server" )
-set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} )
+if( HAVE_common_base )
+message( STATUS "Creating target map-server" )
+set( TXT_MAP_HEADERS
+ "${MAP_SOURCE_DIR}/atcommand.h"
+ "${MAP_SOURCE_DIR}/battle.h"
+ "${MAP_SOURCE_DIR}/battleground.h"
+ "${MAP_SOURCE_DIR}/buyingstore.h"
+ "${MAP_SOURCE_DIR}/chat.h"
+ "${MAP_SOURCE_DIR}/chrif.h"
+ "${MAP_SOURCE_DIR}/clif.h"
+ "${MAP_SOURCE_DIR}/date.h"
+ "${MAP_SOURCE_DIR}/duel.h"
+ "${MAP_SOURCE_DIR}/guild.h"
+ "${MAP_SOURCE_DIR}/homunculus.h"
+ "${MAP_SOURCE_DIR}/instance.h"
+ "${MAP_SOURCE_DIR}/intif.h"
+ "${MAP_SOURCE_DIR}/itemdb.h"
+ "${MAP_SOURCE_DIR}/log.h"
+ "${MAP_SOURCE_DIR}/mail.h"
+ "${MAP_SOURCE_DIR}/map.h"
+ "${MAP_SOURCE_DIR}/mapreg.h"
+ "${MAP_SOURCE_DIR}/mercenary.h"
+ "${MAP_SOURCE_DIR}/mob.h"
+ "${MAP_SOURCE_DIR}/npc.h"
+ "${MAP_SOURCE_DIR}/party.h"
+ "${MAP_SOURCE_DIR}/path.h"
+ "${MAP_SOURCE_DIR}/pc.h"
+ "${MAP_SOURCE_DIR}/pet.h"
+ "${MAP_SOURCE_DIR}/quest.h"
+ "${MAP_SOURCE_DIR}/script.h"
+ "${MAP_SOURCE_DIR}/searchstore.h"
+ "${MAP_SOURCE_DIR}/skill.h"
+ "${MAP_SOURCE_DIR}/status.h"
+ "${MAP_SOURCE_DIR}/storage.h"
+ "${MAP_SOURCE_DIR}/trade.h"
+ "${MAP_SOURCE_DIR}/unit.h"
+ "${MAP_SOURCE_DIR}/vending.h"
+ )
+set( TXT_MAP_SOURCES
+ "${MAP_SOURCE_DIR}/atcommand.c"
+ "${MAP_SOURCE_DIR}/battle.c"
+ "${MAP_SOURCE_DIR}/battleground.c"
+ "${MAP_SOURCE_DIR}/buyingstore.c"
+ "${MAP_SOURCE_DIR}/chat.c"
+ "${MAP_SOURCE_DIR}/chrif.c"
+ "${MAP_SOURCE_DIR}/clif.c"
+ "${MAP_SOURCE_DIR}/date.c"
+ "${MAP_SOURCE_DIR}/duel.c"
+ "${MAP_SOURCE_DIR}/guild.c"
+ "${MAP_SOURCE_DIR}/homunculus.c"
+ "${MAP_SOURCE_DIR}/instance.c"
+ "${MAP_SOURCE_DIR}/intif.c"
+ "${MAP_SOURCE_DIR}/itemdb.c"
+ "${MAP_SOURCE_DIR}/log.c"
+ "${MAP_SOURCE_DIR}/mail.c"
+ "${MAP_SOURCE_DIR}/map.c"
+ "${MAP_SOURCE_DIR}/mapreg_txt.c"
+ "${MAP_SOURCE_DIR}/mercenary.c"
+ "${MAP_SOURCE_DIR}/mob.c"
+ "${MAP_SOURCE_DIR}/npc.c"
+ "${MAP_SOURCE_DIR}/npc_chat.c"
+ "${MAP_SOURCE_DIR}/party.c"
+ "${MAP_SOURCE_DIR}/path.c"
+ "${MAP_SOURCE_DIR}/pc.c"
+ "${MAP_SOURCE_DIR}/pet.c"
+ "${MAP_SOURCE_DIR}/quest.c"
+ "${MAP_SOURCE_DIR}/script.c"
+ "${MAP_SOURCE_DIR}/searchstore.c"
+ "${MAP_SOURCE_DIR}/skill.c"
+ "${MAP_SOURCE_DIR}/status.c"
+ "${MAP_SOURCE_DIR}/storage.c"
+ "${MAP_SOURCE_DIR}/trade.c"
+ "${MAP_SOURCE_DIR}/unit.c"
+ "${MAP_SOURCE_DIR}/vending.c"
+ )
+set( DEPENDENCIES common_base )
+set( LIBRARIES ${GLOBAL_LIBRARIES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} TXT_ONLY )
if( USE_PCRE )
message( STATUS "Using PCRE" )
list( APPEND LIBRARIES ${PCRE_LIBRARIES} )
list( APPEND INCLUDE_DIRS ${PCRE_INCLUDE_DIRS} )
+ list( APPEND DEFINITIONS PCRE_SUPPORT )
endif()
-if( PACKETVER )
- message( STATUS "Using PACKETVER=${PACKETVER}" )
- list( APPEND DEFINITIONS PACKETVER=${PACKETVER} )
-endif()
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${MT19937AR_SOURCES} ${COMMON_SOURCES} ${MAP_SOURCES} ${MAP_TXT_SOURCES} )
-source_group( 3rdparty FILES ${MT19937AR_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} )
-source_group( map FILES ${MAP_SOURCES} ${MAP_TXT_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${TXT_MAP_HEADERS} ${TXT_MAP_SOURCES} )
+source_group( common FILES ${COMMON_BASE_HEADERS} )
+source_group( map FILES ${TXT_MAP_HEADERS} ${TXT_MAP_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_executable( map-server ${SOURCE_FILES} )
-target_link_libraries( map-server ${LIBRARIES} )
+add_dependencies( map-server ${DEPENDENCIES} )
+target_link_libraries( map-server ${LIBRARIES} ${DEPENDENCIES} )
set_target_properties( map-server PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
install( TARGETS map-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "map-server" )
endif()
-message ( STATUS "Creating target map-server - done" )
+message( STATUS "Creating target map-server - done" )
+set( HAVE_map-server ON CACHE BOOL "map-server target is available" )
+mark_as_advanced( HAVE_map-server )
else()
-message ( STATUS "Skipping target map-server (requires ZLIB; optional PCRE)" )
+message( STATUS "Skipping target map-server (requires common_base; optional PCRE)" )
+unset( HAVE_map-server CACHE )
endif()
diff --git a/src/tool/CMakeLists.txt b/src/tool/CMakeLists.txt
index 4f69174b9..e39b174dd 100644
--- a/src/tool/CMakeLists.txt
+++ b/src/tool/CMakeLists.txt
@@ -25,16 +25,25 @@ set( MAPCACHE_SOURCES
# mapcache
if( USE_ZLIB )
-message ( STATUS "Creating target mapcache" )
+message( STATUS "Creating target mapcache" )
+set( COMMON_HEADERS
+ ${COMMON_MINI_HEADERS}
+ "${COMMON_SOURCE_DIR}/grfio.h"
+ "${COMMON_SOURCE_DIR}/utils.h"
+ )
+set( COMMON_SOURCES
+ ${COMMON_MINI_SOURCES}
+ "${COMMON_SOURCE_DIR}/grfio.c"
+ "${COMMON_SOURCE_DIR}/utils.c"
+ )
+set( MAPCACHE_SOURCES
+ "${CMAKE_CURRENT_SOURCE_DIR}/mapcache.c"
+ )
set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_INCLUDE_DIRS} )
-set( DEFINITIONS ${GLOBAL_DEFINITIONS} MINICORE )
-if( WIN32 )
- list( APPEND LIBRARIES "oldnames.lib" "ws2_32.lib" )
- list( APPEND INCLUDE_DIRS ${MSINTTYPES_INCLUDE_DIRS} )
-endif()
-set( SOURCE_FILES ${COMMON_SOURCES} ${MAPCACHE_SOURCES} )
-source_group( common FILES ${COMMON_SOURCES} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} )
+set( DEFINITIONS ${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS} )
+set( SOURCE_FILES ${COMMON_HEADERS} ${COMMON_SOURCES} ${MAPCACHE_SOURCES} )
+source_group( common FILES ${COMMON_HEADERS} ${COMMON_SOURCES} )
source_group( mapcache FILES ${MAPCACHE_SOURCES} )
add_executable( mapcache ${SOURCE_FILES} )
include_directories( ${INCLUDE_DIRS} )
@@ -45,7 +54,10 @@ if( INSTALL_RUN_DATA )
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "mapcache" )
endif()
-message ( STATUS "Creating target mapcache - done" )
+message( STATUS "Creating target mapcache - done" )
+set( HAVE_mapcache ON CACHE BOOL "mapcache target is available" )
+mark_as_advanced( HAVE_mapcache )
else()
-message ( STATUS "Skipping target mapcache (requires ZLIB)" )
+message( STATUS "Skipping target mapcache (requires ZLIB)" )
+unset( HAVE_mapcache CACHE )
endif()