From 40aacbe0dead526ad97faef415006b4bed7f7bd8 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 12 Nov 2024 11:29:35 +0100 Subject: [PATCH 1/4] Update CMakeLists.txt add Config file --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42d4335..960bc8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ endif() include(GNUInstallDirs) include(CMakePackageConfigHelpers) + set(NAPP_TARGET_NAME ${PROJECT_NAME}) set(NAPP_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}") if(NOT DEFINED NAPP_CONFIG_INSTALL_DIR ) @@ -91,8 +92,26 @@ install( EXPORT ${NAPP_TARGETS_EXPORT_NAME} INCLUDES DESTINATION ${NAPP_INCLUDE_INSTALL_DIR} ) +# Install CMake package configuration files +write_basic_package_version_file( + "${NAPP_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in" # Create this file as explained below + "${NAPP_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION ${NAPP_CONFIG_INSTALL_DIR} +) install( EXPORT ${NAPP_TARGETS_EXPORT_NAME} NAMESPACE ${PROJECT_NAME}:: DESTINATION ${NAPP_CONFIG_INSTALL_DIR} ) +install( + FILES + "${NAPP_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake" + "${NAPP_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION ${NAPP_CONFIG_INSTALL_DIR} +) From a14fa158331e5bd45b7512545b8d8fa9959fabf3 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 12 Nov 2024 11:30:07 +0100 Subject: [PATCH 2/4] Create nappConfig.cmake.in --- nappConfig.cmake.in | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 nappConfig.cmake.in diff --git a/nappConfig.cmake.in b/nappConfig.cmake.in new file mode 100644 index 0000000..c39a53a --- /dev/null +++ b/nappConfig.cmake.in @@ -0,0 +1,3 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/nappTargets.cmake") From 50bc9f49187b8a6452177f727e2a1a5824ab5ede Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 12 Nov 2024 11:31:28 +0100 Subject: [PATCH 3/4] Update ci.yml bump up action version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4fbf09..6f75b7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: # runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{matrix.cxx-compiler}} From 6e7b233e607f3121b7b5dde61cd9c0aa29b35500 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Tue, 12 Nov 2024 11:34:57 +0100 Subject: [PATCH 4/4] up vincentchabannes/napp#2 --- CMakeLists.txt | 2 +- nappConfig.cmake.in => cmake/nappConfig.cmake.in | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename nappConfig.cmake.in => cmake/nappConfig.cmake.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 960bc8d..a75b2a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(napp VERSION 0.1 LANGUAGES CXX) +project(napp VERSION 0.3 LANGUAGES CXX) ## ## MAIN_PROJECT CHECK diff --git a/nappConfig.cmake.in b/cmake/nappConfig.cmake.in similarity index 100% rename from nappConfig.cmake.in rename to cmake/nappConfig.cmake.in