aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2022-03-09 09:12:04 +1300
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-03-08 20:12:35 +0000
commit7fd9e4ae21d8751fe1ad7c91cd55ee914d5dd665 (patch)
treee894ac2626ab6c40905cbc39393b29eccf94968b
parent2bc292b0c20e9d59fcebe37bfed5842ed59ea001 (diff)
downloadPROJ-7fd9e4ae21d8751fe1ad7c91cd55ee914d5dd665.tar.gz
PROJ-7fd9e4ae21d8751fe1ad7c91cd55ee914d5dd665.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