aboutsummaryrefslogtreecommitdiff
path: root/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorHoward Butler <howard@hobu.co>2015-02-22 23:06:13 +0000
committerHoward Butler <howard@hobu.co>2015-02-22 23:06:13 +0000
commit4f2ff5857f6f554b7e5c25c139d8064e031c7b73 (patch)
treea94374c80c26ee16a3ce9440a6dcd9f2b5712b98 /cmake/CMakeLists.txt
parent41d8647cdff0c7550b77e7d225e2578ea736d777 (diff)
downloadPROJ-4f2ff5857f6f554b7e5c25c139d8064e031c7b73.tar.gz
PROJ-4f2ff5857f6f554b7e5c25c139d8064e031c7b73.zip
More CMake churn #264
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2632 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r--cmake/CMakeLists.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644
index 00000000..dcb0a61a
--- /dev/null
+++ b/cmake/CMakeLists.txt
@@ -0,0 +1,29 @@
+# proj-config.cmake for the install tree. It's installed in
+# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
+# path to the root from there. (Note that the whole install tree can
+# be relocated.)
+if (NOT WIN32)
+ set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_INTERN_NAME}")
+ set (PROJECT_ROOT_DIR "../../..")
+else ()
+ set (INSTALL_CMAKE_DIR "cmake")
+ set (PROJECT_ROOT_DIR "..")
+endif ()
+
+string(TOLOWER "${PROJECT_INTERN_NAME}" PROJECT_NAME_LOWER)
+configure_file (project-config.cmake.in project-config.cmake @ONLY)
+configure_file (project-config-version.cmake.in
+ project-config-version.cmake @ONLY)
+install (FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ RENAME "${PROJECT_NAME_LOWER}-config.cmake")
+install (FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
+# Make information about the cmake targets (the library and the tools)
+# available.
+install (EXPORT targets
+ FILE ${PROJECT_NAME_LOWER}-targets.cmake
+ DESTINATION "${INSTALL_CMAKE_DIR}")