From 2fae94ba7be41d3a829db3da55d54ec20ce526da Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Wed, 9 Mar 2022 09:12:04 +1300 Subject: DOC: improve CMake integration example; remove CMake <3 detail (#3093) --- docs/source/development/cmake.rst | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'docs/source/development') 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 -- cgit v1.2.3