aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2022-03-09 09:12:04 +1300
committerGitHub <noreply@github.com>2022-03-09 09:12:04 +1300
commit2fae94ba7be41d3a829db3da55d54ec20ce526da (patch)
tree6fde6d766efb55db6453a073c79e9bca3d5c6860
parent5712659366798b7187d01db868794e6e808fa1eb (diff)
downloadPROJ-2fae94ba7be41d3a829db3da55d54ec20ce526da.tar.gz
PROJ-2fae94ba7be41d3a829db3da55d54ec20ce526da.zip
DOC: improve CMake integration example; remove CMake <3 detail (#3093)
-rw-r--r--docs/source/development/cmake.rst15
1 files changed, 5 insertions, 10 deletions
diff --git a/docs/source/development/cmake.rst b/docs/source/development/cmake.rst
index 477b4f3b..d1bbf42c 100644
--- a/docs/source/development/cmake.rst
+++ b/docs/source/development/cmake.rst
@@ -5,23 +5,18 @@ Using PROJ in CMake projects
********************************************************************************
The recommended way to use the PROJ library in a CMake project is to
-link to the imported library target ``${PROJ_LIBRARIES}`` provided by
+link to the imported library target ``PROJ::proj`` provided by
the CMake configuration which comes with the library. Typical usage is:
.. code::
- find_package(PROJ)
+ find_package(PROJ CONFIG REQUIRED)
- target_link_libraries(MyApp PRIVATE ${PROJ_LIBRARIES})
+ target_link_libraries(MyApp PRIVATE PROJ::proj)
-By adding the imported library target ``${PROJ_LIBRARIES}`` to the
+By adding the imported library target ``PROJ::proj`` to the
target link libraries, CMake will also pass the include directories to
-the compiler. This requires that you use CMake version 2.8.11 or later.
-If you are using an older version of CMake, then add
-
-.. code::
-
- include_directories(${PROJ_INCLUDE_DIRS})
+the compiler.
The CMake command ``find_package`` will look for the configuration in a
number of places. The lookup can be adjusted for all packages by setting