From 0199b3fd17fca361bba4eec93209c0b74c0f7340 Mon Sep 17 00:00:00 2001 From: Charles Karney Date: Sat, 10 Feb 2018 17:17:27 -0500 Subject: Re-do pull request #451 export CMake targets with PROJ4:: namespace This version takes to add the include path to the target definition for cmake 2.8.11 and later. Also the documentation sticks to the existing convention of using cmake variables ${PROJ4_LIBRARIES} and ${PROJ4_INCLUDE_DIRS}. However, the namespace variables are still being included. Here's the roll-out plan (0) Version 4.9.x: The target is proj and PROJ4_LIBRARIES is set to this. (1) Version 5.0.x: Two targets, proj and PROJ4::proj, are defined; PROJ4_LIBRARIES = proj. (2) In a year or two: Two targets, proj and PROJ4::proj, are defined; PROJ4_LIBRARIES = PROJ4::proj. (3) With a change in the library which breaks backwards compatibility: The target is PROJ4::proj and PROJ4_LIBRARIES = PROJ4::proj. --- src/lib_proj.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index f1337a54..c9e4d9e6 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -284,6 +284,10 @@ add_library( ${PROJ_CORE_TARGET} ${ALL_LIBPROJ_HEADERS} ${PROJ_RESOURCES} ) +if (NOT CMAKE_VERSION VERSION_LESS 2.8.11) + target_include_directories (${PROJ_CORE_TARGET} INTERFACE + $) +endif () if(WIN32) set_target_properties(${PROJ_CORE_TARGET} -- cgit v1.2.3