[libsigcplusplus/cmake-integration] cmake: generate cmake *Config and *ConfigVersion files
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus/cmake-integration] cmake: generate cmake *Config and *ConfigVersion files
- Date: Sat, 12 Mar 2016 14:32:53 +0000 (UTC)
commit d5b8ffd69207b63f6f7cf9be0926261233ac84a8
Author: Marcin Kolny <marcin kolny gmail com>
Date: Sat Mar 12 15:00:24 2016 +0100
cmake: generate cmake *Config and *ConfigVersion files
CMakeLists.txt | 13 ++++++++++++-
cmake/libsigcxx-3Config.cmake.in | 3 +++
2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d70f93..8b89b26 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,18 @@ set (datarootdir \${prefix})
set (datadir \${datarootdir})
set (includedir \${prefix}/include)
configure_file (sigc++.pc.in sigc++-${SIGCXX_API_VERSION}.pc @ONLY)
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/sigc++-${SIGCXX_API_VERSION}.pc DESTINATION
${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
+
+
+set(version_config "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
+set(project_config "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
+set(config_install_dir "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}")
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file("${version_config}" VERSION ${PACKAGE_VERSION} COMPATIBILITY
SameMajorVersion)
+configure_package_config_file(cmake/libsigcxx-3Config.cmake.in "${project_config}" INSTALL_DESTINATION
"${config_install_dir}")
+
+install (FILES "${CMAKE_CURRENT_BINARY_DIR}/sigc++-${SIGCXX_API_VERSION}.pc" DESTINATION
"${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+install (FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}")
enable_testing()
diff --git a/cmake/libsigcxx-3Config.cmake.in b/cmake/libsigcxx-3Config.cmake.in
new file mode 100644
index 0000000..e0e8728
--- /dev/null
+++ b/cmake/libsigcxx-3Config.cmake.in
@@ -0,0 +1,3 @@
+ PACKAGE_INIT@
+
+check_required_components("@PROJECT_NAME@")
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]