-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
52 lines (44 loc) · 1.3 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 3.21)
project (io-gdal VERSION 0.3.1)
if(PROJECT_IS_TOP_LEVEL)
find_package(geoflow REQUIRED)
include_directories(${geoflow_INCLUDE_DIRS})
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
# GEOS include first for overriding gdal included GEOS
if (DEFINED VCPKG_TOOLCHAIN)
find_package( GEOS CONFIG REQUIRED)
else()
find_package( GEOS REQUIRED)
endif()
if (GEOS_FOUND)
include_directories(${GEOS_INCLUDE_DIR})
endif()
# GDAL
find_package( GDAL 3.5 REQUIRED )
include_directories(${GDAL_INCLUDE_DIR})
set(GF_PLUGIN_NAME ${PROJECT_NAME})
set(GF_PLUGIN_TARGET_NAME "gfp_gdal")
set(GF_PLUGIN_REGISTER ${PROJECT_SOURCE_DIR}/register.hpp)
geoflow_create_plugin(gdal_nodes.cpp geos_nodes.cpp ogr_reader_node.cpp ogr_writer_node.cpp)
if (DEFINED VCPKG_TOOLCHAIN)
target_link_libraries( gfp_gdal PRIVATE
geoflow-core
GEOS::geos_c
${GDAL_LIBRARIES}
)
else()
target_link_libraries( gfp_gdal PRIVATE
geoflow-core
geos_c
${GDAL_LIBRARY}
)
endif()
if (MSVC)
target_compile_options(gfp_gdal PRIVATE "/Zc:__cplusplus")
# collect dll's required for runtime
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/ DESTINATION bin
FILES_MATCHING
PATTERN "*.dll"
PATTERN "gfp*" EXCLUDE)
endif()