diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-03-08 23:18:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-08 23:18:01 +0100 |
| commit | 2f782f927c6a81d6e41d23209fe9170a21fdd950 (patch) | |
| tree | e894ac2626ab6c40905cbc39393b29eccf94968b | |
| parent | 2bc292b0c20e9d59fcebe37bfed5842ed59ea001 (diff) | |
| parent | 7fd9e4ae21d8751fe1ad7c91cd55ee914d5dd665 (diff) | |
| download | PROJ-2f782f927c6a81d6e41d23209fe9170a21fdd950.tar.gz PROJ-2f782f927c6a81d6e41d23209fe9170a21fdd950.zip | |
Merge pull request #3097 from OSGeo/backport-3093-to-9.0
[Backport 9.0] DOC: improve CMake integration example; remove CMake <3 detail
| -rw-r--r-- | docs/source/development/cmake.rst | 15 |
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 |
