aboutsummaryrefslogtreecommitdiff
path: root/docs/source/development
diff options
context:
space:
mode:
authorCharles Karney <charles@karney.com>2018-02-13 06:30:03 -0500
committerGitHub <noreply@github.com>2018-02-13 06:30:03 -0500
commita0dc7e9362bab037656557bb8d258840183824fa (patch)
tree9bf49e92db0f3bf5559868c5799a36aec8d6b994 /docs/source/development
parentab2d175bf1674e3472576250281e7fdb68f09198 (diff)
parent0199b3fd17fca361bba4eec93209c0b74c0f7340 (diff)
downloadPROJ-a0dc7e9362bab037656557bb8d258840183824fa.tar.gz
PROJ-a0dc7e9362bab037656557bb8d258840183824fa.zip
Merge pull request #789 from cffk/cmake-namespace-targets
Re-do pull request #451 export CMake targets with PROJ4:: namespace
Diffstat (limited to 'docs/source/development')
-rw-r--r--docs/source/development/cmake.rst30
-rw-r--r--docs/source/development/index.rst2
2 files changed, 31 insertions, 1 deletions
diff --git a/docs/source/development/cmake.rst b/docs/source/development/cmake.rst
new file mode 100644
index 00000000..1429ae88
--- /dev/null
+++ b/docs/source/development/cmake.rst
@@ -0,0 +1,30 @@
+.. _cmake:
+
+********************************************************************************
+Using Proj.4 in CMake projects
+********************************************************************************
+
+The recommended way to use the Proj.4 library in a CMake project is to
+link to the imported library target ``${PROJ4_LIBRARIES}`` provided by
+the CMake configuration which comes with the library. Typical usage is:
+
+.. code::
+
+ find_package(PROJ4)
+
+ target_link_libraries(MyApp ${PROJ4_LIBRARIES})
+
+By adding the imported library target ``${PROJ4_LIBRARIES}`` 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(${PROJ4_INCLUDE_DIRS})
+
+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
+the cache variable or environment variable ``CMAKE_PREFIX_PATH``. In
+particular, CMake will consult (and set) the cache variable
+``PROJ4_DIR``.
diff --git a/docs/source/development/index.rst b/docs/source/development/index.rst
index 2e6e5622..712bbdfe 100644
--- a/docs/source/development/index.rst
+++ b/docs/source/development/index.rst
@@ -14,4 +14,4 @@ proj.4 project or using the library in their own software.
api
threads
bindings
-
+ cmake