OSDN Git Service

First version
[st-ro/stro.git] / src / tool / CMakeLists.txt
1
2 #
3 # mapcache
4 #
5 if( WITH_ZLIB )
6         option( BUILD_MAPCACHE "build mapcache executable" ON )
7 else()
8         message( STATUS "Disabled mapcache target (required ZLIB)" )
9 endif()
10 if( BUILD_MAPCACHE )
11 message( STATUS "Creating target mapcache" )
12 set( COMMON_HEADERS
13         ${COMMON_MINI_HEADERS}
14         "${COMMON_SOURCE_DIR}/des.h"
15         "${COMMON_SOURCE_DIR}/grfio.h"
16         "${COMMON_SOURCE_DIR}/utils.h"
17         )
18 set( COMMON_SOURCES
19         ${COMMON_MINI_SOURCES}
20         "${COMMON_SOURCE_DIR}/des.c"
21         "${COMMON_SOURCE_DIR}/grfio.c"
22         "${COMMON_SOURCE_DIR}/utils.c"
23         )
24 set( MAPCACHE_SOURCES
25         "${CMAKE_CURRENT_SOURCE_DIR}/mapcache.c"
26         )
27 set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
28 set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_MINI_INCLUDE_DIRS} )
29 set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS}" )
30 set( SOURCE_FILES ${COMMON_HEADERS} ${COMMON_SOURCES} ${MAPCACHE_SOURCES} )
31 source_group( common FILES ${COMMON_HEADERS} ${COMMON_SOURCES} )
32 source_group( mapcache FILES ${MAPCACHE_SOURCES} )
33 add_executable( mapcache ${SOURCE_FILES} )
34 include_directories( ${INCLUDE_DIRS} )
35 target_link_libraries( mapcache ${LIBRARIES} )
36 set_target_properties( mapcache PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
37 if( INSTALL_COMPONENT_RUNTIME )
38         cpack_add_component( Runtime_mapcache DESCRIPTION "mapcache generator" DISPLAY_NAME "mapcache" GROUP Runtime )
39         install( TARGETS mapcache
40                 DESTINATION "."
41                 COMPONENT Runtime_mapcache )
42 endif( INSTALL_COMPONENT_RUNTIME )
43 set( TARGET_LIST ${TARGET_LIST} mapcache  CACHE INTERNAL "" )
44 message( STATUS "Creating target mapcache - done" )
45 endif( BUILD_MAPCACHE )