* CMake: added search for math library, made CPack existence optional, updated the search for mysqlclient and corrected misspelled variables (tested with FreeBSD-8.2-i386)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14893 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
ac908248b5
commit
31cbbf1917
15
3rdparty/mysql/CMakeLists.txt
vendored
15
3rdparty/mysql/CMakeLists.txt
vendored
@ -42,25 +42,10 @@ endif( WIN32 )
|
|||||||
# system
|
# system
|
||||||
#
|
#
|
||||||
message( STATUS "Detecting system MYSQL" )
|
message( STATUS "Detecting system MYSQL" )
|
||||||
find_program( MYSQL_CONFIG_EXECUTABLE "mysql_config" )
|
|
||||||
mark_as_advanced( MYSQL_CONFIG_EXECUTABLE )
|
|
||||||
if( MYSQL_CONFIG_EXECUTABLE )
|
|
||||||
# use mysql_config data
|
|
||||||
message( "Found mysql_config: ${MYSQL_CONFIG_EXECUTABLE}" )
|
|
||||||
execute_process( COMMAND "${MYSQL_CONFIG_EXECUTABLE} --libs"
|
|
||||||
OUTPUT_VARIABLE MYSQL_LIBRARIES )
|
|
||||||
execute_process( COMMAND "${MYSQL_CONFIG_EXECUTABLE} --include"
|
|
||||||
OUTPUT_VARIABLE MYSQL_INCLUDE_DIRS )
|
|
||||||
execute_process( COMMAND "${MYSQL_CONFIG_EXECUTABLE} --version"
|
|
||||||
OUTPUT_VARIABLE MYSQL_VERSION )
|
|
||||||
message( STATUS "Found MYSQL: ${MYSQL_LIBRARIES} (found version ${MYSQL_VERSION})" )
|
|
||||||
else()
|
|
||||||
# find mysql package
|
|
||||||
unset( MYSQL_LIBRARIES CACHE )
|
unset( MYSQL_LIBRARIES CACHE )
|
||||||
unset( MYSQL_INCLUDE_DIRS CACHE )
|
unset( MYSQL_INCLUDE_DIRS CACHE )
|
||||||
set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} )
|
set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH} )
|
||||||
find_package( MYSQL )
|
find_package( MYSQL )
|
||||||
endif()
|
|
||||||
set( MYSQL_SYSTEM_LIBRARIES "${MYSQL_LIBRARIES}"
|
set( MYSQL_SYSTEM_LIBRARIES "${MYSQL_LIBRARIES}"
|
||||||
CACHE PATH "system mysql libraries" )
|
CACHE PATH "system mysql libraries" )
|
||||||
set( MYSQL_SYSTEM_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}"
|
set( MYSQL_SYSTEM_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}"
|
||||||
|
39
3rdparty/mysql/FindMYSQL.cmake
vendored
39
3rdparty/mysql/FindMYSQL.cmake
vendored
@ -1,23 +1,29 @@
|
|||||||
# - Find mysqlclient
|
# - Find mysqlclient
|
||||||
# Find the native MySQL includes and library
|
# Find the native MySQL includes and library
|
||||||
#
|
#
|
||||||
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
|
# MYSQL_INCLUDE_DIRS - where to find mysql.h, etc.
|
||||||
# MYSQL_LIBRARIES - List of libraries when using MySQL.
|
# MYSQL_LIBRARIES - mysqlclient library.
|
||||||
# MYSQL_FOUND - True if MySQL found.
|
# MYSQL_FOUND - True if mysqlclient is found.
|
||||||
#
|
#
|
||||||
# Based on: http://www.itk.org/Wiki/CMakeUserFindMySQL
|
|
||||||
|
|
||||||
find_path( MYSQL_INCLUDE_DIR "mysql.h"
|
find_path( MYSQL_INCLUDE_DIRS "mysql.h"
|
||||||
PATH_SUFFIXES "mysql" )
|
PATHS
|
||||||
|
"/usr/include/mysql"
|
||||||
|
"/usr/local/include/mysql"
|
||||||
|
"$ENV{PROGRAMFILES}/MySQL/*/include"
|
||||||
|
"$ENV{SYSTEMDRIVE}/MySQL/*/include" )
|
||||||
|
|
||||||
set( MYSQL_NAMES mysqlclient mysqlclient_r )
|
find_library( MYSQL_LIBRARIES
|
||||||
find_library( MYSQL_LIBRARY
|
NAMES "mysqlclient" "mysqlclient_r"
|
||||||
NAMES ${MYSQL_NAMES}
|
PATHS
|
||||||
PATH_SUFFIXES "mysql" )
|
"/usr/lib/mysql"
|
||||||
mark_as_advanced( MYSQL_LIBRARY MYSQL_INCLUDE_DIR )
|
"/usr/local/lib/mysql"
|
||||||
|
"$ENV{PROGRAMFILES}/MySQL/*/lib"
|
||||||
|
"$ENV{SYSTEMDRIVE}/MySQL/*/lib" )
|
||||||
|
mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS )
|
||||||
|
|
||||||
if( MYSQL_INCLUDE_DIR AND EXISTS "${MYSQL_INCLUDE_DIR}/mysql_version.h" )
|
if( MYSQL_INCLUDE_DIRS AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" )
|
||||||
file( STRINGS "${MYSQL_INCLUDE_DIR}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" )
|
file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" )
|
||||||
string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" )
|
string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -25,10 +31,5 @@ endif()
|
|||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
include( FindPackageHandleStandardArgs )
|
include( FindPackageHandleStandardArgs )
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( MYSQL
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS( MYSQL
|
||||||
REQUIRED_VARS MYSQL_LIBRARY MYSQL_INCLUDE_DIR
|
REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS
|
||||||
VERSION_VAR MYSQL_VERSION_STRING )
|
VERSION_VAR MYSQL_VERSION_STRING )
|
||||||
|
|
||||||
if( MYSQL_FOUND )
|
|
||||||
set( MYSQL_LIBRARIES ${PCRE_LIBRARY} )
|
|
||||||
set( MYSQL_INCLUDE_DIRS ${PCRE_INCLUDE_DIR} )
|
|
||||||
endif()
|
|
||||||
|
@ -47,6 +47,9 @@ endif()
|
|||||||
message( STATUS "Detecting svnversion" )
|
message( STATUS "Detecting svnversion" )
|
||||||
find_program( SVNVERSION_EXECUTABLE svnversion )
|
find_program( SVNVERSION_EXECUTABLE svnversion )
|
||||||
mark_as_advanced( SVNVERSION_EXECUTABLE )
|
mark_as_advanced( SVNVERSION_EXECUTABLE )
|
||||||
|
if( SVNVERSION_EXECUTABLE )
|
||||||
|
message( STATUS "Found svnversion: ${SVNVERSION_EXECUTABLE}" )
|
||||||
|
endif()
|
||||||
message( STATUS "Detecting svnversion - done" )
|
message( STATUS "Detecting svnversion - done" )
|
||||||
|
|
||||||
|
|
||||||
@ -58,6 +61,19 @@ find_package( Subversion )
|
|||||||
message( STATUS "Detecting Subversion - done" )
|
message( STATUS "Detecting Subversion - done" )
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Find math library (FreeBSD)
|
||||||
|
#
|
||||||
|
message( STATUS "Detecting math library" )
|
||||||
|
find_library( M_LIBRARIES m )
|
||||||
|
mark_as_advanced( M_LIBRARIES )
|
||||||
|
if( M_LIBRARIES )
|
||||||
|
message( STATUS "Found m: ${M_LIBRARIES}" )
|
||||||
|
list( APPEND GLOBAL_LIBRARIES ${M_LIBRARIES} )
|
||||||
|
endif()
|
||||||
|
message( STATUS "Detecting math library - done" )
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# PACKETVER
|
# PACKETVER
|
||||||
#
|
#
|
||||||
@ -93,7 +109,15 @@ set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "MMORPG server package" )
|
|||||||
set( CPACK_PACKAGE_VERSION ${SVNVERSION} )
|
set( CPACK_PACKAGE_VERSION ${SVNVERSION} )
|
||||||
set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE )
|
set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE )
|
||||||
#set( CPACK_MONOLITHIC_INSTALL ON )
|
#set( CPACK_MONOLITHIC_INSTALL ON )
|
||||||
include( CPACK )
|
include( CPACK OPTIONAL RESULT_VARIABLE HAVE_CPACK )
|
||||||
|
if( NOT HAVE_CPACK )
|
||||||
|
# empty replacements
|
||||||
|
macro( cpack_add_component_group )
|
||||||
|
endmacro()
|
||||||
|
macro( cpack_add_component )
|
||||||
|
endmacro()
|
||||||
|
message( STATUS "CPACK not found, package creation disabled" )
|
||||||
|
endif()
|
||||||
|
|
||||||
set( Runtime "Runtime files" CACHE INTERNAL "" )
|
set( Runtime "Runtime files" CACHE INTERNAL "" )
|
||||||
set( Runtime_base "configurations, dbs, npcs, docs, ..." CACHE INTERNAL "" )
|
set( Runtime_base "configurations, dbs, npcs, docs, ..." CACHE INTERNAL "" )
|
||||||
@ -111,10 +135,10 @@ cpack_add_component( Development_base DESCRIPTION ${Development_base} DISPLAY_NA
|
|||||||
#
|
#
|
||||||
# install stuff
|
# install stuff
|
||||||
#
|
#
|
||||||
option( WITH_COMPONENT_RUNTIME "install files needed to run the project" ON )
|
option( WITH_COMPONENT_RUNTIME "install/package files needed to run the project" ON )
|
||||||
option( WITH_COMPONENT_DEVELOPMENT "install files needed to build the project" OFF )
|
option( WITH_COMPONENT_DEVELOPMENT "install/package files needed to build the project" OFF )
|
||||||
option( INSTALL_TO_PATH "copy files to INSTALL_PATH" 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_SOURCE "copy files to source directory, skips what is already there (${CMAKE_CURRENT_SOURCE_DIR})" OFF )
|
||||||
option( INSTALL_TO_SUBDIR "copy files to subdirectory (${CMAKE_CURRENT_BINARY_DIR}/install)" 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)" )
|
set( INSTALL_PATH "${CMAKE_INSTALL_PREFIX}" CACHE STRING "install path (only used when INSTALL_TO_PATH is set)" )
|
||||||
mark_as_advanced( CMAKE_INSTALL_PREFIX )
|
mark_as_advanced( CMAKE_INSTALL_PREFIX )
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
2011/07/09
|
2011/07/09
|
||||||
|
* CMake: added search for math library, made CPack existence optional, updated the search for mysqlclient and corrected misspelled variables (tested with FreeBSD-8.2-i386) [FlavioJS]
|
||||||
* Removed duplicate entries for Gunslinger and Ninja in msg_athena.conf (since r5506). [Ai4rei]
|
* Removed duplicate entries for Gunslinger and Ninja in msg_athena.conf (since r5506). [Ai4rei]
|
||||||
2011/07/07
|
2011/07/07
|
||||||
* Replaced compress/uncompress inline code (encode_zip/decode_zip) with the respective zlib library calls while keeping 3rdparty calls inside common code (follow up to r14888, related r14808). [Ai4rei]
|
* Replaced compress/uncompress inline code (encode_zip/decode_zip) with the respective zlib library calls while keeping 3rdparty calls inside common code (follow up to r14888, related r14808). [Ai4rei]
|
||||||
|
@ -25,7 +25,7 @@ source_group( common FILES ${COMMON_HEADERS} ${COMMON_SOURCES} )
|
|||||||
source_group( mapcache FILES ${MAPCACHE_SOURCES} )
|
source_group( mapcache FILES ${MAPCACHE_SOURCES} )
|
||||||
add_executable( mapcache ${SOURCE_FILES} )
|
add_executable( mapcache ${SOURCE_FILES} )
|
||||||
include_directories( ${INCLUDE_DIRS} )
|
include_directories( ${INCLUDE_DIRS} )
|
||||||
target_link_libraries( mapcache ${ZLIB_LIBRARIES} )
|
target_link_libraries( mapcache ${LIBRARIES} )
|
||||||
set_target_properties( mapcache PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
|
set_target_properties( mapcache PROPERTIES COMPILE_DEFINITIONS "${DEFINITIONS}" )
|
||||||
if( WITH_COMPONENT_RUNTIME )
|
if( WITH_COMPONENT_RUNTIME )
|
||||||
cpack_add_component( Runtime_mapcache DESCRIPTION "mapcache generator" DISPLAY_NAME "mapcache" GROUP Runtime )
|
cpack_add_component( Runtime_mapcache DESCRIPTION "mapcache generator" DISPLAY_NAME "mapcache" GROUP Runtime )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user