[pdal] delete and replace different find modules (#6603)

* [pdal] delete and replace different find modules

* [pdal] add geotiff as a dependency to the config of pdal

* remove version
This commit is contained in:
Alexander Neumann 2019-06-03 22:31:35 +02:00 committed by Victor Romero
parent 785dd6d0eb
commit 35c8538e2c
3 changed files with 25 additions and 17 deletions

View File

@ -1,13 +0,0 @@
find_path(GDAL_INCLUDE_DIR gdal.h)
find_library(GDAL_LIBRARY_DEBUG NAMES gdald)
find_library(GDAL_LIBRARY_RELEASE NAMES gdal)
include(SelectLibraryConfigurations)
select_library_configurations(GDAL)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
GDAL DEFAULT_MSG
GDAL_LIBRARY GDAL_INCLUDE_DIR
)

View File

@ -0,0 +1,13 @@
diff --git a/PDALConfig.cmake.in b/PDALConfig.cmake.in
index a03ef142e..2d06a2937 100644
--- a/PDALConfig.cmake.in
+++ b/PDALConfig.cmake.in
@@ -15,6 +15,8 @@ foreach(_dir @PDAL_CONFIG_LIBRARY_DIRS@)
list(APPEND PDAL_LIBRARY_DIRS ${_foo})
endforeach(_dir)
+include(CMakeFindDependencyMacro)
+find_dependency(GeoTIFF)
include("${CMAKE_CURRENT_LIST_DIR}/PDALTargets.cmake")
if (WIN32)

View File

@ -18,13 +18,21 @@ vcpkg_extract_source_archive_ex(
0001-win32_compiler_options.cmake.patch
0002-no-source-dir-writes.patch
0003-fix-copy-vendor.patch
PDALConfig.patch
)
file(REMOVE "${SOURCE_PATH}/pdal/gitsha.cpp")
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindGDAL.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindGEOS.cmake")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindGDAL.cmake DESTINATION ${SOURCE_PATH}/cmake/modules/)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindGEOS.cmake DESTINATION ${SOURCE_PATH}/cmake/modules/)
# Deploy custom CMake modules to enforce expected dependencies look-up
foreach(_module IN ITEMS FindGDAL FindGEOS FindGeoTIFF FindCurl) # Outdated; Supplied by CMake
file(REMOVE "${SOURCE_PATH}/cmake/modules/${_module}.cmake")
endforeach()
foreach(_module IN ITEMS FindGEOS) # Overwritten Modules.
file(REMOVE "${SOURCE_PATH}/cmake/modules/${_module}.cmake")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/${_module}.cmake
DESTINATION ${SOURCE_PATH}/cmake/modules/
)
endforeach()
# NOTE: CMake native BUILD_SHARED_LIBS option will be set by vcpkg_configure_cmake
# TODO: Remove this as soon as PDAL switches to use BUILD_SHARED_LIBS