* CMake: normalized variable names, added ability to create a package/installer.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14890 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
flaviojs 2011-07-07 03:21:42 +00:00
parent 9be2d9dbbd
commit 7e4a0b3266
14 changed files with 206 additions and 315 deletions

View File

@ -8,20 +8,20 @@
# ${name}_SYSTEM_LIBRARIES - libraries of the system version
# ${name}_SYSTEM_INCLUDE_DIRS - include directories of the system version
# Generates:
# USE_LOCAL_${name} - use the local version of the package (only when local is available)
# USE_${name} - use this package
# WITH_LOCAL_${name} - use the local version of the package (only when local is available)
# WITH_${name} - use this package
# ${name}_LIBRARIES - libraries
# ${name}_INCLUDE_DIRS - include directories
macro( CONFIGURE_USE_LOCAL_OR_SYSTEM name )
macro( CONFIGURE_WITH_LOCAL_OR_SYSTEM name )
unset( ${name}_LIBRARIES CACHE )
unset( ${name}_INCLUDE_DIRS CACHE )
if( HAVE_LOCAL_${name} )
set( USE_LOCAL_${name} ON
set( WITH_LOCAL_${name} ON
CACHE BOOL "use local version of ${name}" )
else()
unset( USE_LOCAL_${name} CACHE )
unset( WITH_LOCAL_${name} CACHE )
endif()
if( USE_LOCAL_${name} )
if( WITH_LOCAL_${name} )
message( STATUS "Configuring for local ${name}" )
set( ${name}_LIBRARIES ${${name}_LOCAL_LIBRARIES} )
set( ${name}_INCLUDE_DIRS ${${name}_LOCAL_INCLUDE_DIRS} )
@ -32,11 +32,11 @@ macro( CONFIGURE_USE_LOCAL_OR_SYSTEM name )
set( ${name}_INCLUDE_DIRS ${${name}_SYSTEM_INCLUDE_DIRS} )
message( STATUS "Configuring for system ${name} - done" )
endif()
if( USE_LOCAL_${name} OR HAVE_SYSTEM_${name} )
set( USE_${name} ON
if( WITH_LOCAL_${name} OR HAVE_SYSTEM_${name} )
set( WITH_${name} ON
CACHE BOOL "use ${name}" )
else()
unset( USE_${name} CACHE )
unset( WITH_${name} CACHE )
endif()
set( ${name}_LIBRARIES ${${name}_LIBRARIES}
CACHE PATH "${name} libraries" )
@ -44,7 +44,7 @@ macro( CONFIGURE_USE_LOCAL_OR_SYSTEM name )
CACHE PATH "${name} include directories" )
mark_as_advanced( ${name}_LIBRARIES )
mark_as_advanced( ${name}_INCLUDE_DIRS )
endmacro( CONFIGURE_USE_LOCAL_OR_SYSTEM )
endmacro( CONFIGURE_WITH_LOCAL_OR_SYSTEM )
add_subdirectory( msinttypes )

View File

@ -24,6 +24,7 @@ if( MYSQL_LOCAL_LIBRARIES AND MYSQL_LOCAL_INCLUDE_DIRS )
endif()
set( HAVE_LOCAL_MYSQL ON
CACHE BOOL "mysql client is available as a local copy")
mark_as_advanced( HAVE_LOCAL_MYSQL )
else()
foreach( _VAR MYSQL_LOCAL_LIBRARIES MYSQL_LOCAL_INCLUDE_DIRS )
if( NOT "${_VAR}" )
@ -70,6 +71,9 @@ mark_as_advanced( MYSQL_SYSTEM_INCLUDE_DIRS )
if( MYSQL_SYSTEM_LIBRARIES AND MYSQL_SYSTEM_INCLUDE_DIRS )
set( HAVE_SYSTEM_MYSQL ON
CACHE BOOL "mysql client is available on the system" )
mark_as_advanced( HAVE_SYSTEM_MYSQL )
else()
unset( HAVE_SYSTEM_MYSQL CACHE )
endif()
message( STATUS "Detecting system MYSQL - done" )
@ -77,4 +81,4 @@ message( STATUS "Detecting system MYSQL - done" )
#
# configure
#
CONFIGURE_USE_LOCAL_OR_SYSTEM( MYSQL )
CONFIGURE_WITH_LOCAL_OR_SYSTEM( MYSQL )

View File

@ -21,6 +21,7 @@ if( PCRE_LOCAL_LIBRARIES AND PCRE_LOCAL_INCLUDE_DIRS )
message( STATUS "Found PCRE: ${PCRE_LOCAL_LIBRARIES} (found version ${PCRE_MAJOR}.${PCRE_MINOR})" )
set( HAVE_LOCAL_PCRE ON
CACHE BOOL "pcre is available as a local copy" )
mark_as_advanced( HAVE_LOCAL_PCRE )
else()
foreach( _VAR PCRE_LOCAL_LIBRARIES PCRE_LOCAL_INCLUDE_DIRS )
if( NOT "${_VAR}" )
@ -52,6 +53,7 @@ mark_as_advanced( PCRE_SYSTEM_INCLUDE_DIRS )
if( PCRE_SYSTEM_LIBRARIES AND PCRE_SYSTEM_INCLUDE_DIRS )
set( HAVE_SYSTEM_PCRE ON
CACHE BOOL "pcre is available on the system" )
mark_as_advanced( HAVE_SYSTEM_PCRE )
else()
unset( HAVE_SYSTEM_PCRE CACHE )
endif()
@ -61,4 +63,4 @@ message( STATUS "Detecting system PCRE - done" )
#
# configure
#
CONFIGURE_USE_LOCAL_OR_SYSTEM( PCRE )
CONFIGURE_WITH_LOCAL_OR_SYSTEM( PCRE )

View File

@ -20,6 +20,7 @@ if( ZLIB_LOCAL_LIBRARIES AND ZLIB_LOCAL_INCLUDE_DIRS )
message( STATUS "Found local ZLIB: ${ZLIB_LOCAL_LIBRARIES} (found version ${ZLIB_VERSION})" )
set( HAVE_LOCAL_ZLIB ON
CACHE BOOL "zlib is available as a local copy" )
mark_as_advanced( HAVE_LOCAL_ZLIB )
else()
foreach( _VAR ZLIB_LOCAL_LIBRARIES ZLIB_LOCAL_INCLUDE_DIRS )
if( NOT "${_VAR}" )
@ -50,6 +51,7 @@ mark_as_advanced( ZLIB_SYSTEM_INCLUDE_DIRS )
if( ZLIB_SYSTEM_LIBRARIES AND ZLIB_SYSTEM_INCLUDE_DIRS )
set( HAVE_SYSTEM_ZLIB ON
CACHE BOOL "zlib is available on the system" )
mark_as_advanced( HAVE_SYSTEM_ZLIB )
else()
unset( HAVE_SYSTEM_ZLIB CACHE )
endif()
@ -59,4 +61,4 @@ message( STATUS "Detecting system ZLIB - done" )
#
# configure
#
CONFIGURE_USE_LOCAL_OR_SYSTEM( ZLIB )
CONFIGURE_WITH_LOCAL_OR_SYSTEM( ZLIB )

View File

@ -5,6 +5,12 @@
# Part 4 of 6: http://www.youtube.com/watch?v=JICZOkyNXbg
# Part 5 of 6: http://www.youtube.com/watch?v=lAiuLHy4dCk
# Part 6 of 6: http://www.youtube.com/watch?v=fAtJNzDZdH8
#
# You can use notepad++ for syntax highlighting.
# Naming conventions:
# WITH_* : option to use an external package or not
# ENABLE_* : option to use an internal feature/code or not
# HAVE_* : internal variable indicating if we have and are using something
cmake_minimum_required( VERSION 2.8.4 )
project( eAthena )
@ -19,218 +25,134 @@ elseif( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" )
endif()
#
# Debug stuff
#
if( NOT SKIP_DEBUG )
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 )
#
# Global stuff
#
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 )
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" )
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 )
list( APPEND GLOBAL_DEFINITIONS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE DB_MANUAL_CAST_TO_UNION )
endif()
#
# packetver
# Find svnversion
#
set( PACKETVER ""
CACHE STRING "Sets the PACKETVER define of the servers. (see src/common/mmo.h)" )
message( STATUS "Detecting svnversion" )
find_program( SVNVERSION_EXECUTABLE svnversion )
mark_as_advanced( SVNVERSION_EXECUTABLE )
message( STATUS "Detecting svnversion - done" )
#
# Find Subversion
#
message( STATUS "Detecting Subversion" )
find_package( Subversion )
message( STATUS "Detecting Subversion - done" )
#
# PACKETVER
#
set( PACKETVER CACHE STRING "Sets the PACKETVER define of the servers. (see src/common/mmo.h)" )
if( PACKETVER )
list( APPEND GLOBAL_DEFINITIONS PACKETVER=${PACKETVER} )
list( APPEND GLOBAL_DEFINITIONS PACKETVER=${PACKETVER} )
endif()
#
# SVNVERSION
#
if( SVNVERSION_EXECUTABLE )
execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SVNVERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
string( REGEX REPLACE "[^1234567890MSexported]" "_" SVNVERSION ${SVNVERSION} )
endif()
if( Subversion_FOUND AND SVNVERSION )
Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} eAthena )
if( eAthena_WC_URL )
string( REGEX MATCH "[^/]+$" BRANCH ${eAthena_WC_URL} )
set( SVNVERSION "${BRANCH}-${SVNVERSION}" )
endif()
endif()
#####################################################################
# package stuff
#
if( OFF )
set( CPACK_PACKAGE_NAME "eAthena" )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "MMORPG server package" )
set( CPACK_PACKAGE_FILE_NAME )
set( CPACK_PACKAGE_INSTALL_DIRECTORY )
set( CPACK_PROJECT_CONFIG_FILE )
set( CPACK_PACKAGE_VERSION ${SVNVERSION} )
set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE )
set( CPACK_RESOURCE_FILE_README )
set( CPACK_RESOURCE_FILE_WELCOME )
set( CPACK_MONOLITHIC_INSTALL ON )
set( CPACK_GENERATOR "ZIP" )
set( CPACK_OUTPUT_CONFIG_FILE )
set( CPACK_PACKAGE_EXECUTABLES )
set( CPACK_STRIP_FILES )
#source
set( CPACK_SOURCE_PACKAGE_FILE_NAME )
set( CPACK_SOURCE_STRIP_FILES )
set( CPACK_SOURCE_GENERATOR "ZIP" )
set( CPACK_SOURCE_OUTPUT_CONFIG_FILE )
set( CPACK_SOURCE_IGNORE_FILES )
include(CPACK)
endif()
#set( CPACK_MONOLITHIC_INSTALL ON )
include( CPACK )
set( Runtime "Runtime files" CACHE INTERNAL "" )
set( Runtime_base "configurations, dbs, npcs, docs, ..." CACHE INTERNAL "" )
set( Runtime_templates "conf/import and save (generated from conf/import-tmpl and save-tmpl)" CACHE INTERNAL "" )
cpack_add_component_group( Runtime DESCRIPTION ${Runtime} DISPLAY_NAME "Runtime" )
cpack_add_component( Runtime_base DESCRIPTION ${Runtime_base} DISPLAY_NAME "Base files" GROUP Runtime )
cpack_add_component( Runtime_templates DESCRIPTION ${Runtime_templates} DISPLAY_NAME "Base templates" GROUP Runtime )
set( Development "Development files" CACHE INTERNAL "" )
set( Development_base "projects, 3rdparty, sources, templates" CACHE INTERNAL "" )
cpack_add_component_group( Development DESCRIPTION ${Development} DISPLAY_NAME "Development" )
cpack_add_component( Development_base DESCRIPTION ${Development_base} DISPLAY_NAME "Base files" GROUP Development )
#
# install stuff
#
set( COMPONENT_SOURCE "Source code, librarires and project files" CACHE INTERNAL "" )
set( COMPONENT_BASE "Base files" CACHE INTERNAL "" )
option( INSTALL_RUN_DATA "install files needed to run the project" ON )
option( INSTALL_BUILD_DATA "install files needed to build the project" OFF )
set( SVN_FOLDER_PATTERN "[\\.]svn"
CACHE STRING "pattern of svn folder that we exclude from instalations" )
mark_as_advanced( SVN_FOLDER_PATTERN )
if( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}" )
set( INSTALLING_TO_SOURCE ON
CACHE INTERNAL "we are installing to the source folder, skip uneeded stuff" )
else()
unset( INSTALLING_TO_SOURCE CACHE )
option( WITH_COMPONENT_RUNTIME "install files needed to run the project" ON )
option( WITH_COMPONENT_DEVELOPMENT "install files needed to build the project" OFF )
option( INSTALL_TO_PATH "copy files to INSTALL_PATH" OFF )
option( INSTALL_TO_SOURCE "copy files to source directory (${CMAKE_CURRENT_SOURCE_DIR})" OFF )
option( INSTALL_TO_SUBDIR "copy files to subdirectory (${CMAKE_CURRENT_BINARY_DIR}/install)" OFF )
set( INSTALL_PATH "${CMAKE_INSTALL_PREFIX}" CACHE STRING "install path (only used when INSTALL_TO_PATH is set)" )
mark_as_advanced( CMAKE_INSTALL_PREFIX )
if( INSTALL_TO_PATH AND NOT ("${INSTALL_TO}" STREQUAL "path") )# changed to path
set_property( CACHE INSTALL_TO_SOURCE INSTALL_TO_SUBDIR PROPERTY VALUE OFF )
elseif( INSTALL_TO_SOURCE AND NOT ("${INSTALL_TO}" STREQUAL "source") )# changed to source
set_property( CACHE INSTALL_TO_PATH INSTALL_TO_SUBDIR PROPERTY VALUE OFF )
elseif( INSTALL_TO_SUBDIR AND NOT ("${INSTALL_TO}" STREQUAL "subdir") )# changed to subdir
set_property( CACHE INSTALL_TO_PATH INSTALL_TO_SOURCE PROPERTY VALUE OFF )
elseif( NOT INSTALL_TO_PATH AND NOT INSTALL_TO_SOURCE AND NOT INSTALL_TO_SUBDIR )# default
set_property( CACHE INSTALL_TO_SUBDIR PROPERTY VALUE ON )
endif()
set( LOCAL_BUILD_FILES
"CMakeLists.txt"
"configure"
"configure.in"
"eAthena-6.dsw"
"eAthena-7.1.sln"
"eAthena-8.sln"
"eAthena-9.sln"
"eAthena-10.sln"
if( INSTALL_TO_PATH )
set( INSTALL_TO "path" CACHE INTERNAL "" )
set_property( CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${INSTALL_PATH}" )
elseif( INSTALL_TO_SOURCE )
set( INSTALL_TO "source" CACHE INTERNAL "" )
set_property( CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_CURRENT_SOURCE_DIR}" )
elseif( INSTALL_TO_SUBDIR )
set( INSTALL_TO "subdir" CACHE INTERNAL "" )
set_property( CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_CURRENT_BINARY_DIR}/install" )
endif()
set( SVN_FOLDER_PATTERN "[\\.]svn" CACHE STRING "pattern of svn folder that we exclude from instalations" )
mark_as_advanced( SVN_FOLDER_PATTERN )
set( DEVELOPMENT_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/configure"
"${CMAKE_CURRENT_SOURCE_DIR}/configure.in"
"${CMAKE_CURRENT_SOURCE_DIR}/eAthena-6.dsw"
"${CMAKE_CURRENT_SOURCE_DIR}/eAthena-7.1.sln"
"${CMAKE_CURRENT_SOURCE_DIR}/eAthena-8.sln"
"${CMAKE_CURRENT_SOURCE_DIR}/eAthena-9.sln"
"${CMAKE_CURRENT_SOURCE_DIR}/eAthena-10.sln"
)
set( LOCAL_BUILD_DIRECTORIES
set( DEVELOPMENT_DIRECTORIES
"3rdparty"
"conf/import-tmpl"
"save-tmpl"
"src"
"vcproj-6"
"vcproj-7.1"
@ -238,28 +160,31 @@ set( LOCAL_BUILD_DIRECTORIES
"vcproj-9"
"vcproj-10"
)
set( LOCAL_RUN_FILES
"athena-start"
"Changelog-Trunk.txt"
"char-server.sh"
"charserv-sql.bat"
"charserv.bat"
"dbghelp.dll"
"LICENSE"
"login-server.sh"
"logserv-sql.bat"
"logserv.bat"
"map-server.sh"
"mapserv-sql.bat"
"mapserv.bat"
"notice.txt"
"readme.html"
"runserver-sql.bat"
"runserver.bat"
"serv.bat"
"start"
set( RUNTIME_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/athena-start"
"${CMAKE_CURRENT_SOURCE_DIR}/Changelog-Trunk.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/char-server.sh"
"${CMAKE_CURRENT_SOURCE_DIR}/charserv-sql.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/charserv.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/dbghelp.dll"
"${CMAKE_CURRENT_SOURCE_DIR}/libmysql.dll"
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/login-server.sh"
"${CMAKE_CURRENT_SOURCE_DIR}/logserv-sql.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/logserv.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/map-server.sh"
"${CMAKE_CURRENT_SOURCE_DIR}/mapserv-sql.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/mapserv.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/notice.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/pcre3.dll"
"${CMAKE_CURRENT_SOURCE_DIR}/readme.html"
"${CMAKE_CURRENT_SOURCE_DIR}/runserver-sql.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/runserver.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/serv.bat"
"${CMAKE_CURRENT_SOURCE_DIR}/start"
"${CMAKE_CURRENT_SOURCE_DIR}/zlib1.dll"
)
set( LOCAL_RUN_DIRECTORIES
set( RUNTIME_DIRECTORIES
"conf"
"db"
"doc"
@ -270,58 +195,41 @@ set( LOCAL_RUN_DIRECTORIES
"sql-files"
"tools"
)
if( USE_LOCAL_MYSQL )
list( APPEND LOCAL_RUN_FILES "libmysql.dll" )
endif()
if( USE_LOCAL_PCRE )
list( APPEND LOCAL_RUN_FILES "pcre3.dll" )
endif()
if( USE_LOCAL_ZLIB )
list( APPEND LOCAL_RUN_FILES "zlib1.dll" )
endif()
function( INSTALL_DIRECTORY DIR DEST EXCLUDE_PATTERN )
# warning: that slash(/) is important here, otherwise the whole directory (not its content) will be copied!
install( DIRECTORY ${DIR}/
DESTINATION ${DEST}
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE
PATTERN "${EXCLUDE_PATTERN}" EXCLUDE )
endfunction()
function( INSTALL_DIRECTORIES DIRS EXCLUDE_PATTERN )
foreach( DIR IN ITEMS ${DIRS} )
INSTALL_DIRECTORY( ${DIR} ${DIR} "${EXCLUDE_PATTERN}" )
endforeach()
endfunction()
if( NOT INSTALLING_TO_SOURCE )
# skipped if in-source
if( INSTALL_RUN_DATA )
# base
install( FILES ${LOCAL_RUN_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX} )
foreach( DIR IN ITEMS ${LOCAL_RUN_DIRECTORIES} )
if( INSTALL_TO_SOURCE )# skip, already in the source dir
else()
if( WITH_COMPONENT_RUNTIME )
install( FILES ${RUNTIME_FILES}
DESTINATION "."
COMPONENT Runtime_base )
foreach( DIR IN ITEMS ${RUNTIME_DIRECTORIES} )
install( DIRECTORY "${DIR}/"
DESTINATION "${DIR}"
COMPONENT Runtime_base
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE
PATTERN "conf/import-tmpl" EXCLUDE )
endforeach()
endif()
if( INSTALL_BUILD_DATA )
# source
install( FILES ${LOCAL_BUILD_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX} )
foreach( DIR IN ITEMS ${LOCAL_BUILD_DIRECTORIES} )
if( WITH_COMPONENT_DEVELOPMENT )
install( FILES ${DEVELOPMENT_FILES}
DESTINATION "."
COMPONENT Development_base )
foreach( DIR IN ITEMS ${DEVELOPMENT_DIRECTORIES} )
install( DIRECTORY "${DIR}/"
DESTINATION "${DIR}"
COMPONENT Development_base
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE )
endforeach()
endif()
endif()
if( INSTALL_RUN_DATA )
# base templates
if( WITH_COMPONENT_RUNTIME )
# templates
install( DIRECTORY "save-tmpl/"
DESTINATION "save"
COMPONENT Runtime_templates
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE )
install( DIRECTORY "conf/import-tmpl/"
DESTINATION "conf/import"
COMPONENT Runtime_templates
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE )
endif()

View File

@ -5,6 +5,7 @@ Date Added
* 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.
* CMake: normalized variable names, added ability to create a package/installer.
2011/07/05
* CMake: split txt and sql variants of login-server and map-server. [FlavioJS]
2011/07/04

View File

@ -36,10 +36,11 @@ add_executable( char-server ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_charserver_txt DESCRIPTION "char-server (txt version)" DISPLAY_NAME "char-server" GROUP Runtime )
install( TARGETS char-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "char-server" )
DESTINATION "."
COMPONENT Runtime_charserver_txt )
endif()
message( STATUS "Creating target char-server - done" )
set( HAVE_char-server ON CACHE BOOL "char-server target is available" )

View File

@ -42,10 +42,11 @@ add_executable( char-server_sql ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_charserver_sql DESCRIPTION "char-server (sql version)" DISPLAY_NAME "char-server_sql" GROUP Runtime )
install( TARGETS char-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "char-server_sql" )
DESTINATION "."
COMPONENT Runtime_charserver_sql )
endif()
message( STATUS "Creating target char-server_sql - done" )
set( HAVE_char-server_sql ON CACHE BOOL "char-server_sql target is available" )

View File

@ -1,22 +1,8 @@
#####################################################################
# Find svnversion
#
message( STATUS "Detecting svnversion" )
find_program( SVNVERSION_EXECUTABLE svnversion )
mark_as_advanced( SVNVERSION_EXECUTABLE )
message( STATUS "Detecting svnversion - done" )
#
# Create svnversion.h
#
message( STATUS "Creating svnversion.h" )
if( SVNVERSION_EXECUTABLE )
execute_process( COMMAND ${SVNVERSION_EXECUTABLE} ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SVNVERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
endif()
if( SVNVERSION )
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
"#ifndef SVNVERSION\n#define SVNVERSION ${SVNVERSION}\n#endif\n" )
@ -26,11 +12,14 @@ endif()
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 )
if( WITH_COMPONENT_DEVELOPMENT )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
DESTINATION "src/common"
COMPONENT Development_base )
endif()
message( STATUS "Creating svnversion.h - done" )
#####################################################################
# setup
#
@ -65,7 +54,7 @@ set( COMMON_MINI_DEFINITIONS MINICORE CACHE INTERNAL "" )
#
# common_base
#
if( USE_ZLIB )
if( WITH_ZLIB )
message( STATUS "Creating target common_base" )
set( COMMON_BASE_HEADERS
${COMMON_ALL_HEADERS}
@ -126,7 +115,7 @@ endif()
#
# common_sql
#
if( HAVE_common_base AND USE_MYSQL )
if( HAVE_common_base AND WITH_MYSQL )
message( STATUS "Creating target common_sql" )
set( COMMON_SQL_HEADERS
${COMMON_ALL_HEADERS}

View File

@ -28,10 +28,11 @@ add_executable( login-server_sql ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_loginserver_sql DESCRIPTION "login-server (sql version)" DISPLAY_NAME "login-server_sql" GROUP Runtime )
install( TARGETS login-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "login-server_sql" )
DESTINATION "."
COMPONENT Runtime_loginserver_sql )
endif()
message( STATUS "Creating target login-server_sql - done" )
set( HAVE_login-server_sql ON CACHE BOOL "login-server_sql target is available" )

View File

@ -28,10 +28,11 @@ add_executable( login-server ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_loginserver_txt DESCRIPTION "login-server (txt version)" DISPLAY_NAME "login-server" GROUP Runtime )
install( TARGETS login-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "login-server" )
DESTINATION "."
COMPONENT Runtime_loginserver_txt )
endif()
message( STATUS "Creating target login-server - done" )
set( HAVE_login-server ON CACHE BOOL "login-server target is available" )

View File

@ -81,7 +81,7 @@ set( DEPENDENCIES common_sql )
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
if( USE_PCRE )
if( WITH_PCRE )
message( STATUS "Using PCRE" )
list( APPEND LIBRARIES ${PCRE_LIBRARIES} )
list( APPEND INCLUDE_DIRS ${PCRE_INCLUDE_DIRS} )
@ -95,10 +95,11 @@ add_executable( map-server_sql ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_mapserver_sql DESCRIPTION "map-server (sql version)" DISPLAY_NAME "map-server_sql" GROUP Runtime )
install( TARGETS map-server_sql
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "map-server_sql" )
DESTINATION "."
COMPONENT Runtime_mapserver_sql )
endif()
message( STATUS "Creating target map-server_sql - done" )
set( HAVE_map-server_sql ON CACHE BOOL "map-server_sql target is available" )

View File

@ -81,7 +81,7 @@ set( DEPENDENCIES common_base )
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} TXT_ONLY )
if( USE_PCRE )
if( WITH_PCRE )
message( STATUS "Using PCRE" )
list( APPEND LIBRARIES ${PCRE_LIBRARIES} )
list( APPEND INCLUDE_DIRS ${PCRE_INCLUDE_DIRS} )
@ -95,10 +95,11 @@ add_executable( map-server ${SOURCE_FILES} )
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 )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_mapserver_txt DESCRIPTION "map-server (txt version)" DISPLAY_NAME "map-server" GROUP Runtime )
install( TARGETS map-server
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "map-server" )
DESTINATION "."
COMPONENT Runtime_mapserver_txt )
endif()
message( STATUS "Creating target map-server - done" )
set( HAVE_map-server ON CACHE BOOL "map-server target is available" )

View File

@ -1,30 +1,8 @@
# setup
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( MAPCACHE_SOURCES
mapcache.c
)
#
# mapcache
if( USE_ZLIB )
#
if( WITH_ZLIB )
message( STATUS "Creating target mapcache" )
set( COMMON_HEADERS
${COMMON_MINI_HEADERS}
@ -49,10 +27,11 @@ add_executable( mapcache ${SOURCE_FILES} )
include_directories( ${INCLUDE_DIRS} )
target_link_libraries( mapcache ${ZLIB_LIBRARIES} )
set_target_properties( mapcache PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
if( INSTALL_RUN_DATA )
if( WITH_COMPONENT_RUNTIME )
cpack_add_component( Runtime_mapcache DESCRIPTION "mapcache generator" DISPLAY_NAME "mapcache" GROUP Runtime )
install( TARGETS mapcache
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT "mapcache" )
DESTINATION "."
COMPONENT Runtime_mapcache )
endif()
message( STATUS "Creating target mapcache - done" )
set( HAVE_mapcache ON CACHE BOOL "mapcache target is available" )