Skip to content

Commit

Permalink
Add GDAL_INCLUDE_DIR to interface include dirs
Browse files Browse the repository at this point in the history
If GDAL is installed to a non-standard location, anything that uses
`PDALUtils.hpp` will fail b/c it can't find `cpl_port.h`. Since we use
`include_directories` instead of `target_include_directories`, the CMake
library interface is not populated with upstream include directories.
This patch fixes that *for GDAL only*.

A more comprehensive population of the target include interface is
probably wise. IMO the best way to be to switch all usages of
`include_directories` to `target_include_directories`, which is some
work.
  • Loading branch information
gadomski committed Nov 4, 2016
1 parent f61435d commit c332360
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -198,6 +198,12 @@ target_link_libraries(${PDAL_BASE_LIB_NAME}
INTERFACE
${PDAL_LIBDIR}
)
# This allows downstream projects to use GDAL_INCLUDE_DIR simply by linking
# against PDAL_BASE_LIB_NAME.
target_include_directories(${PDAL_BASE_LIB_NAME}
INTERFACE
${GDAL_INCLUDE_DIR}
)

if (WITH_GEOTIFF)
target_link_libraries(${PDAL_BASE_LIB_NAME} PUBLIC ${GEOTIFF_LIBRARY})
Expand Down

0 comments on commit c332360

Please sign in to comment.