summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-03 16:20:39 +0100
committertastytea2020-01-03 16:20:39 +0100
commita7fe14da27ca6badcdbe6d2e81f20a8298bd7aeb (patch)
tree527338554c0fe4ef3740fa484491c12ad063b44a
parente88238a37c48328bce214972f87cd8fa4c7fa3f6 (diff)
downloadmastodonpp-a7fe14da27ca6badcdbe6d2e81f20a8298bd7aeb.tar
mastodonpp-a7fe14da27ca6badcdbe6d2e81f20a8298bd7aeb.tar.gz
mastodonpp-a7fe14da27ca6badcdbe6d2e81f20a8298bd7aeb.zip
Generate and install mastodonppConfig.cmake and so on.
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/CMakeLists.txt19
-rw-r--r--cmake/mastodonppConfig.cmake.in5
3 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0704b03..f71128a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,7 @@ include(debug_flags)
add_subdirectory(src)
add_subdirectory(include)
+add_subdirectory(cmake)
if(WITH_TESTS)
add_subdirectory(tests)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644
index 0000000..fd94154
--- /dev/null
+++ b/cmake/CMakeLists.txt
@@ -0,0 +1,19 @@
+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
+
+write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
+ VERSION ${PACKAGE_VERSION}
+ COMPATIBILITY SameMajorVersion)
+
+configure_file("${PROJECT_NAME}Config.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
+
+install(EXPORT ${PROJECT_NAME}Targets
+ FILE "${PROJECT_NAME}Targets.cmake"
+ NAMESPACE "${PROJECT_NAME}::"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
diff --git a/cmake/mastodonppConfig.cmake.in b/cmake/mastodonppConfig.cmake.in
new file mode 100644
index 0000000..1c07bc4
--- /dev/null
+++ b/cmake/mastodonppConfig.cmake.in
@@ -0,0 +1,5 @@
+include(CMakeFindDependencyMacro)
+
+
+
+include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")