* CMake: Only install template files if they don't already exist.
* CMake: Added plugin targets. * CMake: Added options BUILD_* to build the converters and individual plugins. (default=OFF) * CMake: Added option WITH_CPACK for package creation. (default=ON) git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14918 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
b8704518db
commit
bdfa11d86e
@ -402,13 +402,16 @@ set( CPACK_PACKAGE_VERSION ${SVNVERSION} )
|
||||
set( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE )
|
||||
#set( CPACK_MONOLITHIC_INSTALL ON )
|
||||
include( CPACK OPTIONAL RESULT_VARIABLE HAVE_CPACK )
|
||||
if( NOT HAVE_CPACK )
|
||||
if( HAVE_CPACK )
|
||||
option( WITH_CPACK "enable building packages with CPack ('package' target)" ON )
|
||||
endif()
|
||||
if( NOT WITH_CPACK )
|
||||
# empty replacements
|
||||
macro( cpack_add_component_group )
|
||||
endmacro()
|
||||
macro( cpack_add_component )
|
||||
endmacro()
|
||||
message( STATUS "CPACK not found, package creation disabled" )
|
||||
message( STATUS "Disabled package creation" )
|
||||
endif()
|
||||
|
||||
set( Runtime "Runtime files" CACHE INTERNAL "" )
|
||||
@ -427,8 +430,8 @@ cpack_add_component( Development_base DESCRIPTION ${Development_base} DISPLAY_NA
|
||||
#
|
||||
# install stuff
|
||||
#
|
||||
option( WITH_COMPONENT_RUNTIME "install/package files needed to run the project" ON )
|
||||
option( WITH_COMPONENT_DEVELOPMENT "install/package files needed to build the project" OFF )
|
||||
option( INSTALL_COMPONENT_RUNTIME "install/package files needed to run the project" ON )
|
||||
option( INSTALL_COMPONENT_DEVELOPMENT "install/package 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, skips what is already there (${CMAKE_CURRENT_SOURCE_DIR})" OFF )
|
||||
option( INSTALL_TO_SUBDIR "copy files to subdirectory (${CMAKE_CURRENT_BINARY_DIR}/install)" OFF )
|
||||
@ -513,7 +516,7 @@ set( RUNTIME_DIRECTORIES
|
||||
)
|
||||
if( INSTALL_TO_SOURCE )# skip, already in the source dir
|
||||
else()
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
install( FILES ${RUNTIME_FILES}
|
||||
DESTINATION "."
|
||||
COMPONENT Runtime_base )
|
||||
@ -524,8 +527,8 @@ else()
|
||||
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE
|
||||
PATTERN "conf/import-tmpl" EXCLUDE )
|
||||
endforeach()
|
||||
endif()
|
||||
if( WITH_COMPONENT_DEVELOPMENT )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_DEVELOPMENT )
|
||||
install( FILES ${DEVELOPMENT_FILES}
|
||||
DESTINATION "."
|
||||
COMPONENT Development_base )
|
||||
@ -535,19 +538,46 @@ else()
|
||||
COMPONENT Development_base
|
||||
PATTERN ${SVN_FOLDER_PATTERN} EXCLUDE )
|
||||
endforeach()
|
||||
endif()
|
||||
endif( INSTALL_COMPONENT_DEVELOPMENT )
|
||||
endif()
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_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()
|
||||
set( _TEMPLATES
|
||||
"save-tmpl" "save"
|
||||
"conf/import-tmpl" "conf/import"
|
||||
)
|
||||
set( INSTALL_TEMPLATES_FILE "${CMAKE_CURRENT_BINARY_DIR}/InstallTemplates.cmake" )
|
||||
file( WRITE "${INSTALL_TEMPLATES_FILE}"
|
||||
"macro( INSTALL_TEMPLATE _SRC _DST )\n"
|
||||
" set( SRC \"${CMAKE_CURRENT_SOURCE_DIR}/\${_SRC}\" )\n"
|
||||
" set( DST \"\${CMAKE_INSTALL_PREFIX}/\${_DST}\" )\n"
|
||||
" if( EXISTS \"\${DST}\" )\n"
|
||||
" message( \"-- Already exists: \${DST}\" )\n"
|
||||
" else()\n"
|
||||
" message( \"-- Installing template: \${DST}\" )\n"
|
||||
" execute_process( COMMAND \"${CMAKE_COMMAND}\" -E copy \"\${SRC}\" \"\${DST}\" )\n"
|
||||
" endif()\n"
|
||||
"endmacro()\n"
|
||||
)
|
||||
while( _TEMPLATES )
|
||||
list( GET _TEMPLATES 0 _SRC )
|
||||
list( GET _TEMPLATES 1 _DST )
|
||||
list( REMOVE_AT _TEMPLATES 0 1 )
|
||||
if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}" )
|
||||
file( GLOB _PATHS "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}/*" )
|
||||
foreach( _PATH IN ITEMS ${_PATHS} )
|
||||
string( REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${_SRC}/" "" _PATH "${_PATH}" )
|
||||
if( NOT "${_PATH}" MATCHES "${SVN_FOLDER_PATTERN}" )
|
||||
list( APPEND _TEMPLATES "${_SRC}/${_PATH}" "${_DST}/${_PATH}" )
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
file( APPEND "${INSTALL_TEMPLATES_FILE}" "INSTALL_TEMPLATE( \"${_SRC}\" \"${_DST}\" )\n" )
|
||||
endif()
|
||||
endwhile()
|
||||
install( SCRIPT "${INSTALL_TEMPLATES_FILE}"
|
||||
COMPONENT Runtime_templates )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
|
||||
|
||||
#
|
||||
|
@ -1,5 +1,10 @@
|
||||
Date Added
|
||||
|
||||
2011/07/21
|
||||
* CMake: Only install template files if they don't already exist. [FlavioJS]
|
||||
* CMake: Added plugin targets.
|
||||
* CMake: Added options BUILD_* to build the converters and individual plugins. (default=OFF)
|
||||
* CMake: Added option WITH_CPACK for package creation. (default=ON)
|
||||
2011/07/20
|
||||
* Made GCOLLECT use it's debug functions. [FlavioJS]
|
||||
* Turned off garbage collection for GCOLLECT since there's nothing to do with explicit frees.
|
||||
|
@ -6,4 +6,4 @@ add_subdirectory( char_sql )
|
||||
add_subdirectory( map )
|
||||
add_subdirectory( tool )
|
||||
add_subdirectory( txt-converter )
|
||||
#add_subdirectory( plugins )
|
||||
add_subdirectory( plugins )
|
||||
|
@ -42,17 +42,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_charserver_txt DESCRIPTION "char-server (txt version)" DISPLAY_NAME "char-server" GROUP Runtime )
|
||||
install( TARGETS char-server
|
||||
DESTINATION "."
|
||||
COMPONENT Runtime_charserver_txt )
|
||||
endif()
|
||||
set( HAVE_char-server ON CACHE BOOL "char-server target is available" )
|
||||
mark_as_advanced( HAVE_char-server )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} char-server CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target char-server - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target char-server (requires common_base)" )
|
||||
unset( HAVE_char-server CACHE )
|
||||
endif()
|
||||
|
@ -48,17 +48,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_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 "."
|
||||
COMPONENT Runtime_charserver_sql )
|
||||
endif()
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( HAVE_char-server_sql ON CACHE BOOL "char-server_sql target is available" )
|
||||
mark_as_advanced( HAVE_char-server_sql )
|
||||
set( TARGET_LIST ${TARGET_LIST} char-server_sql CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target char-server_sql - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target char-server_sql (requires common_sql)" )
|
||||
unset( HAVE_char-server_sql CACHE )
|
||||
endif()
|
||||
|
@ -12,11 +12,11 @@ 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( WITH_COMPONENT_DEVELOPMENT )
|
||||
if( INSTALL_COMPONENT_DEVELOPMENT )
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
|
||||
DESTINATION "src/common"
|
||||
COMPONENT Development_base )
|
||||
endif()
|
||||
endif( INSTALL_COMPONENT_DEVELOPMENT )
|
||||
message( STATUS "Creating svnversion.h - done" )
|
||||
|
||||
|
||||
|
@ -28,17 +28,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_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 "."
|
||||
COMPONENT Runtime_loginserver_sql )
|
||||
endif()
|
||||
set( HAVE_login-server_sql ON CACHE BOOL "login-server_sql target is available" )
|
||||
mark_as_advanced( HAVE_login-server_sql )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} login-server_sql CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target login-server_sql - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target login-server_sql (requires common_sql)" )
|
||||
unset( HAVE_login-server_sql CACHE )
|
||||
endif()
|
||||
|
@ -28,17 +28,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_loginserver_txt DESCRIPTION "login-server (txt version)" DISPLAY_NAME "login-server" GROUP Runtime )
|
||||
install( TARGETS login-server
|
||||
DESTINATION "."
|
||||
COMPONENT Runtime_loginserver_txt )
|
||||
endif()
|
||||
set( HAVE_login-server ON CACHE BOOL "login-server target is available" )
|
||||
mark_as_advanced( HAVE_login-server )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} login-server CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target login-server - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target login-server (requires common_base)" )
|
||||
unset( HAVE_login-server CACHE )
|
||||
endif()
|
||||
|
@ -95,17 +95,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_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 "."
|
||||
COMPONENT Runtime_mapserver_sql )
|
||||
endif()
|
||||
set( HAVE_map-server_sql ON CACHE BOOL "map-server_sql target is available" )
|
||||
mark_as_advanced( HAVE_map-server_sql )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} map-server_sql CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target map-server_sql - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target map-server_sql (requires common_sql; optional PCRE)" )
|
||||
unset( HAVE_map-server_sql CACHE )
|
||||
endif()
|
||||
|
@ -95,17 +95,14 @@ 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_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_mapserver_txt DESCRIPTION "map-server (txt version)" DISPLAY_NAME "map-server" GROUP Runtime )
|
||||
install( TARGETS map-server
|
||||
DESTINATION "."
|
||||
COMPONENT Runtime_mapserver_txt )
|
||||
endif()
|
||||
set( HAVE_map-server ON CACHE BOOL "map-server target is available" )
|
||||
mark_as_advanced( HAVE_map-server )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} map-server CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target map-server - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target map-server (requires common_base; optional PCRE)" )
|
||||
unset( HAVE_map-server CACHE )
|
||||
endif()
|
||||
|
175
src/plugins/CMakeLists.txt
Normal file
175
src/plugins/CMakeLists.txt
Normal file
@ -0,0 +1,175 @@
|
||||
|
||||
#
|
||||
# setup
|
||||
#
|
||||
get_property( CAN_BUILD_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS )
|
||||
if( NOT CAN_BUILD_SHARED_LIBS )
|
||||
return()
|
||||
endif()
|
||||
|
||||
#
|
||||
# console
|
||||
#
|
||||
option( BUILD_PLUGIN_console "build console plugin" OFF )
|
||||
if( BUILD_PLUGIN_console )
|
||||
message( STATUS "Creating target console" )
|
||||
set( CONSOLE_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/console.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/console.def"
|
||||
)
|
||||
set( LIBRARIES ${GLOBAL_LIBRARIES} )
|
||||
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
|
||||
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
|
||||
set( SOURCE_FILES ${CONSOLE_SOURCES} )
|
||||
source_group( console FILES ${CONSOLE_SOURCES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
add_library( console SHARED ${SOURCE_FILES} )
|
||||
target_link_libraries( console ${LIBRARIES} )
|
||||
set_target_properties( console PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
set_target_properties( console PROPERTIES PREFIX "" )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_console DESCRIPTION "console plugin" DISPLAY_NAME "console" GROUP Runtime )
|
||||
install( TARGETS console
|
||||
DESTINATION "plugins"
|
||||
COMPONENT Runtime_console )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} console CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target console - done" )
|
||||
endif( BUILD_PLUGIN_console )
|
||||
|
||||
|
||||
#
|
||||
# dbghelpplug
|
||||
#
|
||||
if( WIN32 )
|
||||
find_path( HAVE_DBGHELP_H dbghelp.h )
|
||||
mark_as_advanced( HAVE_DBGHELP_H )
|
||||
if( HAVE_DBGHELP_H )
|
||||
option( BUILD_PLUGIN_dbghelpplug "build dbghelpplug plugin" OFF )
|
||||
endif()
|
||||
endif()
|
||||
if( BUILD_PLUGIN_dbghelpplug )
|
||||
message( STATUS "Creating target dbghelpplug" )
|
||||
set( DBGHELPPLUG_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.rc"
|
||||
)
|
||||
set( LIBRARIES ${GLOBAL_LIBRARIES} )
|
||||
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
|
||||
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
|
||||
set( SOURCE_FILES ${DBGHELPPLUG_SOURCES} )
|
||||
source_group( dbghelpplug FILES ${DBGHELPPLUG_SOURCES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
add_library( dbghelpplug SHARED ${SOURCE_FILES} )
|
||||
target_link_libraries( dbghelpplug ${LIBRARIES} )
|
||||
set_target_properties( dbghelpplug PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
set_target_properties( dbghelpplug PROPERTIES PREFIX "" )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_dbghelpplug DESCRIPTION "dbghelpplug plugin" DISPLAY_NAME "dbghelpplug" GROUP Runtime )
|
||||
install( TARGETS dbghelpplug
|
||||
DESTINATION "plugins"
|
||||
COMPONENT Runtime_dbghelpplug )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} dbghelpplug CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target dbghelpplug - done" )
|
||||
endif( BUILD_PLUGIN_dbghelpplug )
|
||||
|
||||
|
||||
#
|
||||
# pid
|
||||
#
|
||||
if( WIN32 OR HAVE_GETPID )
|
||||
option( BUILD_PLUGIN_pid "build pid plugin" OFF )
|
||||
endif()
|
||||
if( BUILD_PLUGIN_pid )
|
||||
message( STATUS "Creating target pid" )
|
||||
set( PID_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pid.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pid.def"
|
||||
)
|
||||
set( LIBRARIES ${GLOBAL_LIBRARIES} )
|
||||
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
|
||||
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
|
||||
set( SOURCE_FILES ${PID_SOURCES} )
|
||||
source_group( pid FILES ${PID_SOURCES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
add_library( pid SHARED ${SOURCE_FILES} )
|
||||
target_link_libraries( pid ${LIBRARIES} )
|
||||
set_target_properties( pid PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
set_target_properties( pid PROPERTIES PREFIX "" )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_pid DESCRIPTION "pid plugin" DISPLAY_NAME "pid" GROUP Runtime )
|
||||
install( TARGETS pid
|
||||
DESTINATION "plugins"
|
||||
COMPONENT Runtime_pid )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} pid CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target pid - done" )
|
||||
endif( BUILD_PLUGIN_pid )
|
||||
|
||||
|
||||
#
|
||||
# sample
|
||||
#
|
||||
option( BUILD_PLUGIN_sample "build sample plugin" OFF )
|
||||
if( BUILD_PLUGIN_sample )
|
||||
message( STATUS "Creating target sample" )
|
||||
set( SAMPLE_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sample.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sample.def"
|
||||
)
|
||||
set( LIBRARIES ${GLOBAL_LIBRARIES} )
|
||||
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
|
||||
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
|
||||
set( SOURCE_FILES ${SAMPLE_SOURCES} )
|
||||
source_group( sample FILES ${SAMPLE_SOURCES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
add_library( sample SHARED ${SOURCE_FILES} )
|
||||
target_link_libraries( sample ${LIBRARIES} )
|
||||
set_target_properties( sample PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
set_target_properties( sample PROPERTIES PREFIX "" )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_sample DESCRIPTION "sample plugin" DISPLAY_NAME "sample" GROUP Runtime )
|
||||
install( TARGETS sample
|
||||
DESTINATION "plugins"
|
||||
COMPONENT Runtime_sample )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} sample CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target sample - done" )
|
||||
endif( BUILD_PLUGIN_sample )
|
||||
|
||||
|
||||
#
|
||||
# sig
|
||||
#
|
||||
option( BUILD_PLUGIN_sig "build sig plugin" OFF )
|
||||
if( BUILD_PLUGIN_sig )
|
||||
message( STATUS "Creating target sig" )
|
||||
set( SIG_SOURCES
|
||||
"${COMMON_SOURCE_DIR}/malloc.c"
|
||||
"${COMMON_SOURCE_DIR}/malloc.h"
|
||||
"${COMMON_SOURCE_DIR}/showmsg.c"
|
||||
"${COMMON_SOURCE_DIR}/showmsg.h"
|
||||
"${COMMON_SOURCE_DIR}/strlib.c"
|
||||
"${COMMON_SOURCE_DIR}/strlib.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/sig.c"
|
||||
)
|
||||
set( LIBRARIES ${GLOBAL_LIBRARIES} )
|
||||
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
|
||||
set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS} -DNO_MEMMGR" )
|
||||
set( SOURCE_FILES ${SIG_SOURCES} )
|
||||
source_group( sig FILES ${SIG_SOURCES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
add_library( sig SHARED ${SOURCE_FILES} )
|
||||
target_link_libraries( sig ${LIBRARIES} )
|
||||
set_target_properties( sig PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
set_target_properties( sig PROPERTIES PREFIX "" )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_sig DESCRIPTION "sig plugin" DISPLAY_NAME "sig" GROUP Runtime )
|
||||
install( TARGETS sig
|
||||
DESTINATION "plugins"
|
||||
COMPONENT Runtime_sig )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} sig CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target sig - done" )
|
||||
endif( BUILD_PLUGIN_sig )
|
@ -27,14 +27,12 @@ add_executable( mapcache ${SOURCE_FILES} )
|
||||
include_directories( ${INCLUDE_DIRS} )
|
||||
target_link_libraries( mapcache ${LIBRARIES} )
|
||||
set_target_properties( mapcache PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_mapcache DESCRIPTION "mapcache generator" DISPLAY_NAME "mapcache" GROUP Runtime )
|
||||
install( TARGETS mapcache
|
||||
DESTINATION "."
|
||||
COMPONENT Runtime_mapcache )
|
||||
endif()
|
||||
set( HAVE_mapcache ON CACHE BOOL "mapcache target is available" )
|
||||
mark_as_advanced( HAVE_mapcache )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} mapcache CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target mapcache - done" )
|
||||
else()
|
||||
|
@ -3,6 +3,9 @@
|
||||
# setup
|
||||
#
|
||||
set( CONVERTER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "" )
|
||||
if( WITH_MYSQL )
|
||||
option( BUILD_CONVERTERS "build login-converter and char-converter" OFF )
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# char-converter
|
||||
#
|
||||
if( WITH_MYSQL )
|
||||
if( BUILD_CONVERTERS )
|
||||
message( STATUS "Creating target char-converter" )
|
||||
set( COMMON_HEADERS
|
||||
${COMMON_MINI_HEADERS}
|
||||
@ -65,17 +65,12 @@ include_directories( ${INCLUDE_DIRS} )
|
||||
add_executable( char-converter ${SOURCE_FILES} )
|
||||
target_link_libraries( char-converter ${LIBRARIES} )
|
||||
set_target_properties( char-converter PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_charconverter DESCRIPTION "char-converter" DISPLAY_NAME "char-converter" GROUP Runtime )
|
||||
install( TARGETS char-converter
|
||||
DESTINATION "tools"
|
||||
COMPONENT Runtime_charconverter )
|
||||
endif()
|
||||
set( HAVE_char-converter ON CACHE BOOL "char-converter target is available" )
|
||||
mark_as_advanced( HAVE_char-converter )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} char-converter CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target char-converter - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target char-converter (requires MYSQL)" )
|
||||
unset( HAVE_char-converter CACHE )
|
||||
endif()
|
||||
endif( BUILD_CONVERTERS )
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# login-converter
|
||||
#
|
||||
if( WITH_MYSQL )
|
||||
if( BUILD_CONVERTERS )
|
||||
message( STATUS "Creating target login-converter" )
|
||||
set( COMMON_HEADERS
|
||||
${COMMON_MINI_HEADERS}
|
||||
@ -49,17 +49,12 @@ include_directories( ${INCLUDE_DIRS} )
|
||||
add_executable( login-converter ${SOURCE_FILES} )
|
||||
target_link_libraries( login-converter ${LIBRARIES} )
|
||||
set_target_properties( login-converter PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
|
||||
if( WITH_COMPONENT_RUNTIME )
|
||||
if( INSTALL_COMPONENT_RUNTIME )
|
||||
cpack_add_component( Runtime_loginconverter DESCRIPTION "login-converter" DISPLAY_NAME "login-converter" GROUP Runtime )
|
||||
install( TARGETS login-converter
|
||||
DESTINATION "tools"
|
||||
COMPONENT Runtime_loginconverter )
|
||||
endif()
|
||||
set( HAVE_login-converter ON CACHE BOOL "login-converter target is available" )
|
||||
mark_as_advanced( HAVE_login-converter )
|
||||
endif( INSTALL_COMPONENT_RUNTIME )
|
||||
set( TARGET_LIST ${TARGET_LIST} login-converter CACHE INTERNAL "" )
|
||||
message( STATUS "Creating target login-converter - done" )
|
||||
else()
|
||||
message( STATUS "Skipping target login-converter (requires MYSQL)" )
|
||||
unset( HAVE_login-converter CACHE )
|
||||
endif()
|
||||
endif( BUILD_CONVERTERS )
|
||||
|
Loading…
x
Reference in New Issue
Block a user