Skip to content

Commit 70961f6

Browse files
authored
Merge pull request OSGeo#12217 from dbaston/cmake-exports
CMake: Export GDAL library targets
2 parents 4aa3135 + 7e096e3 commit 70961f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gdal.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ install(
553553
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
554554
FRAMEWORK DESTINATION "${FRAMEWORK_DESTINATION}")
555555

556+
# Generate targets file for importing directly from GDAL build tree
557+
export(TARGETS ${GDAL_LIB_TARGET_NAME}
558+
NAMESPACE GDAL::
559+
FILE "GDAL-targets.cmake")
560+
556561
if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK)
557562
# Generate GdalConfig.cmake and GdalConfigVersion.cmake
558563
install(

0 commit comments

Comments
 (0)