Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also create a static library for wms (same to oauth2)
  • Loading branch information
3nids committed Jun 21, 2021
1 parent d170710 commit 51c8cb8
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions src/server/services/wms/CMakeLists.txt
Expand Up @@ -32,39 +32,41 @@ set (WMS_HDRS
########################################################
# Build

add_library (wms MODULE ${WMS_SRCS} ${WMS_HDRS})
set(_library_suffix_MODULE "")
set(_library_suffix_STATIC "_static")

# require c++17
target_compile_features(wms PRIVATE cxx_std_17)
foreach(_library_type MODULE STATIC)
set(_library_name "wms${_library_suffix_${_library_type}}")

include_directories(SYSTEM
${GDAL_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
)

include_directories(
${CMAKE_SOURCE_DIR}/src/server
${CMAKE_SOURCE_DIR}/src/server/services
${CMAKE_SOURCE_DIR}/src/server/services/wms
add_library(${_library_name} ${_library_type} ${WMS_SRCS} ${WMS_HDRS})

${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/server
${CMAKE_CURRENT_BINARY_DIR}
)
# require c++17
target_compile_features(${_library_name} PRIVATE cxx_std_17)

include_directories(${_library_name} SYSTEM PUBLIC
${GDAL_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
)

target_link_libraries(wms
qgis_core
qgis_server
)
target_include_directories(${_library_name} PUBLIC
${CMAKE_SOURCE_DIR}/src/server
${CMAKE_SOURCE_DIR}/src/server/services
${CMAKE_SOURCE_DIR}/src/server/services/wms

${CMAKE_BINARY_DIR}/src/python
${CMAKE_BINARY_DIR}/src/analysis
${CMAKE_BINARY_DIR}/src/server
${CMAKE_CURRENT_BINARY_DIR}
)

########################################################
# Install
target_link_libraries(${_library_name}
qgis_core
qgis_server
)

install(TARGETS wms
RUNTIME DESTINATION ${QGIS_SERVER_MODULE_DIR}
LIBRARY DESTINATION ${QGIS_SERVER_MODULE_DIR}
)
install(TARGETS ${_library_name}
RUNTIME DESTINATION ${QGIS_SERVER_MODULE_DIR}
LIBRARY DESTINATION ${QGIS_SERVER_MODULE_DIR}
)
endforeach()

0 comments on commit 51c8cb8

Please sign in to comment.