From 260db3689dbeaa946c1af6e1790aac989bcff85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Thu, 8 Feb 2024 16:09:59 +0100 Subject: [PATCH 01/17] chaing install targets so that io1-money is installed and not io1. --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a89360..deb32ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(GNUInstallDirs) add_library(${PROJECT_NAME} INTERFACE include/io1/money.hpp) target_include_directories( ${PROJECT_NAME} - INTERFACE $ + INTERFACE $ $) target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20) @@ -39,16 +39,16 @@ write_basic_package_version_file( configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" "${PROJECT_NAME}Config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) install( EXPORT ${PROJECT_NAME} NAMESPACE io1:: - DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) if(IO1_WITH_TESTS) include(CTest) @@ -63,5 +63,5 @@ if(IO1_WITH_TESTS) NAME test_${PROJECT_NAME} COMMAND test_${PROJECT_NAME} --reporters=junit --out=junit_test_${PROJECT_NAME}.xml - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) endif() From 6b5dc685ca2e9cd062796e46cd6786eaae0f6ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 09:36:29 +0100 Subject: [PATCH 02/17] added install unit tests --- .github/workflows/install.yml | 66 +++++++++++++++++++++++++++++++++++ test-install/CMakeLists.txt | 6 ++++ test-install/main.cpp | 0 3 files changed, 72 insertions(+) create mode 100644 .github/workflows/install.yml create mode 100644 test-install/CMakeLists.txt create mode 100644 test-install/main.cpp diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml new file mode 100644 index 0000000..40746ab --- /dev/null +++ b/.github/workflows/install.yml @@ -0,0 +1,66 @@ +name: install +on: [push] + +jobs: + install: + runs-on: ${{ matrix.os }} + strategy: + matrix: + config: [Release, Debug] + os: [ubuntu-latest, windows-latest] + compiler: [gcc, clang, msvc] + exclude: + - os: windows-latest + compiler: gcc + - os: windows-latest + compiler: clang + - os: ubuntu-latest + compiler: msvc + steps: + - uses: actions/checkout@v4 + + - name: Get latest cmake + uses: lukka/get-cmake@latest + + - name: Configure + shell: cmake -P {0} + run: | + if ("${{ matrix.compiler }}" STREQUAL "msvc") + set(vcpkg_triplet x64-windows) + set(compiler_flags "/EHsc /W4") + else() + set(vcpkg_triplet x64-linux) + set(compiler_flags "-Wall -Wextra -Wpedantic -Wconversion -Wshadow") + if ("${{ matrix.compiler }}" STREQUAL "gcc") + set(ENV{CC} "gcc-13") + set(ENV{CXX} "g++-13") + else() + set(ENV{CC} "clang-15") + set(ENV{CXX} "clang++-15") + endif() + endif() + execute_process( + COMMAND cmake + -S . + -B build + -D IO1_WITH_TESTS=OFF + -D CMAKE_BUILD_TYPE=${{ matrix.config }} + -D "CMAKE_CXX_FLAGS=${compiler_flags}" + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + + - name: Build + run: cmake --build build --config ${{ matrix.config }} --parallel --target io1-money + + - name: Install + run: cmake --install build --prefix install --config ${{ matrix.config }} + + - name: Test + run: | + pushd test-install + cmake -S . -B build -DIO1-MONEY_DIR=../install -D CMAKE_BUILD_TYPE=${{ matrix.config }} + cmake --build build --config ${{ matrix.config }} --parallel + popd diff --git a/test-install/CMakeLists.txt b/test-install/CMakeLists.txt new file mode 100644 index 0000000..d650dd7 --- /dev/null +++ b/test-install/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.25) +project(test) + +find_package(io1-money REQUIRED) +add_executable(test main.cpp) +target_link_libraries(test PRIVATE io1::money) diff --git a/test-install/main.cpp b/test-install/main.cpp new file mode 100644 index 0000000..e69de29 From 562c33ce37967ce9a5b2e77396dd87236b05a70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 10:36:24 +0100 Subject: [PATCH 03/17] trying another strategy --- lint/.clang-tidy => .clang-tidy | 0 .github/workflows/install.yml | 8 ++++---- .github/workflows/lint.yml | 2 ++ lint/lint.cpp | 1 - test-install/CMakeLists.txt | 6 ------ test-install/main.cpp | 0 6 files changed, 6 insertions(+), 11 deletions(-) rename lint/.clang-tidy => .clang-tidy (100%) delete mode 100644 lint/lint.cpp delete mode 100644 test-install/CMakeLists.txt delete mode 100644 test-install/main.cpp diff --git a/lint/.clang-tidy b/.clang-tidy similarity index 100% rename from lint/.clang-tidy rename to .clang-tidy diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 40746ab..eb4e8b5 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -59,8 +59,8 @@ jobs: run: cmake --install build --prefix install --config ${{ matrix.config }} - name: Test + shell: cmake -P {0} run: | - pushd test-install - cmake -S . -B build -DIO1-MONEY_DIR=../install -D CMAKE_BUILD_TYPE=${{ matrix.config }} - cmake --build build --config ${{ matrix.config }} --parallel - popd + set (io1-money_DIR install) + find_package(io1-money REQUIRED) + \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c176716..b6b9caa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,8 @@ jobs: - name: Lint run: | + mkdir lint + echo "#include "io1/money.hpp\n" > lint/lint.cpp clang-tidy-15 lint/lint.cpp --export-fixes=clang-fixes.yaml --header-filter=io1/* -- -Iinclude -std=c++20 - name: Process clang-tidy warnings diff --git a/lint/lint.cpp b/lint/lint.cpp deleted file mode 100644 index fb9f0ab..0000000 --- a/lint/lint.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "io1/money.hpp" diff --git a/test-install/CMakeLists.txt b/test-install/CMakeLists.txt deleted file mode 100644 index d650dd7..0000000 --- a/test-install/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 3.25) -project(test) - -find_package(io1-money REQUIRED) -add_executable(test main.cpp) -target_link_libraries(test PRIVATE io1::money) diff --git a/test-install/main.cpp b/test-install/main.cpp deleted file mode 100644 index e69de29..0000000 From 905b52986bffe82edcc5f20f4e8bbf2be5805b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 10:39:20 +0100 Subject: [PATCH 04/17] fixed mistake --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b6b9caa..dac8c09 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: - name: Lint run: | mkdir lint - echo "#include "io1/money.hpp\n" > lint/lint.cpp + echo "#include \"io1/money.hpp\n\"" > lint/lint.cpp clang-tidy-15 lint/lint.cpp --export-fixes=clang-fixes.yaml --header-filter=io1/* -- -Iinclude -std=c++20 - name: Process clang-tidy warnings From 59c6efb3e9fc80dd5498b7e02ec19e7bf99215ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 10:40:21 +0100 Subject: [PATCH 05/17] fixing --- .github/workflows/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index eb4e8b5..5c4e17c 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -61,6 +61,6 @@ jobs: - name: Test shell: cmake -P {0} run: | - set (io1-money_DIR install) + set (io1-money_DIR "install/share/io1-money/cmake") find_package(io1-money REQUIRED) \ No newline at end of file From 85c4f16532635ae86b976a4239e54732a9372acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 10:47:51 +0100 Subject: [PATCH 06/17] lint fix --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dac8c09..6583723 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: - name: Lint run: | mkdir lint - echo "#include \"io1/money.hpp\n\"" > lint/lint.cpp + echo "#include \"io1/money.hpp\"\n" > lint/lint.cpp clang-tidy-15 lint/lint.cpp --export-fixes=clang-fixes.yaml --header-filter=io1/* -- -Iinclude -std=c++20 - name: Process clang-tidy warnings From 2a4def81097033d660f5b6bf6b69c925fc3c32bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 10:49:50 +0100 Subject: [PATCH 07/17] fix lint finally --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6583723..06e6a40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: - name: Lint run: | mkdir lint - echo "#include \"io1/money.hpp\"\n" > lint/lint.cpp + echo "#include \"io1/money.hpp\"" > lint/lint.cpp clang-tidy-15 lint/lint.cpp --export-fixes=clang-fixes.yaml --header-filter=io1/* -- -Iinclude -std=c++20 - name: Process clang-tidy warnings From ad321e2296293881bd710e3fd33750611b3c56fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 11:02:48 +0100 Subject: [PATCH 08/17] reusing unit tests to test installation --- .github/workflows/install.yml | 7 ++++--- .github/workflows/unit_tests.yml | 2 +- CMakeLists.txt | 14 +------------- test/CMakeLists.txt | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 test/CMakeLists.txt diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 5c4e17c..4716861 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -59,8 +59,9 @@ jobs: run: cmake --install build --prefix install --config ${{ matrix.config }} - name: Test - shell: cmake -P {0} run: | - set (io1-money_DIR "install/share/io1-money/cmake") - find_package(io1-money REQUIRED) + pushd test + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} "-Dio1-money_DIR=../install/share/io1-money/cmake" + cmake --build build --config ${{ matrix.config }} --parallel + popd \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0f8e9c9..24bccd9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -62,4 +62,4 @@ jobs: - name: Publish test report uses: mikepenz/action-junit-report@v3 with: - report_paths: 'build/junit_*.xml' \ No newline at end of file + report_paths: 'build/test/junit_*.xml' \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index deb32ab..572c49d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,17 +51,5 @@ install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) if(IO1_WITH_TESTS) - include(CTest) - - find_package(doctest CONFIG REQUIRED) - - add_executable(test_${PROJECT_NAME} test/test_money.cpp test/tutorial.cpp) - target_link_libraries(test_${PROJECT_NAME} PRIVATE io1::money - doctest::doctest) - - add_test( - NAME test_${PROJECT_NAME} - COMMAND test_${PROJECT_NAME} --reporters=junit - --out=junit_test_${PROJECT_NAME}.xml - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + add_subdirectory(test) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..0cf873d --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.25) + +project(test_io1-money LANGUAGES CXX) + +include(CTest) + +find_package(doctest REQUIRED) +if (NOT TARGET io1::money) + find_package(io1_money REQUIRED) +endif() + +add_executable(${PROJECT_NAME} test/test_money.cpp test/tutorial.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE io1::money + doctest::doctest) +add_test( +NAME ${PROJECT_NAME} +COMMAND ${PROJECT_NAME} --reporters=junit + --out=junit_${PROJECT_NAME}.xml +WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) From 8422b2f5d8f089d4715ea4e7503166f3bc363920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Fri, 9 Feb 2024 17:56:53 +0100 Subject: [PATCH 09/17] simple lint --- .github/workflows/lint.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 06e6a40..2571f0e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,7 @@ jobs: - uses: actions/checkout@v4 - name: Lint - run: | - mkdir lint - echo "#include \"io1/money.hpp\"" > lint/lint.cpp - clang-tidy-15 lint/lint.cpp --export-fixes=clang-fixes.yaml --header-filter=io1/* -- -Iinclude -std=c++20 + run: clang-tidy-15 include/io1/money.hpp --export-fixes=clang-fixes.yaml -- -std=c++20 - name: Process clang-tidy warnings uses: asarium/clang-tidy-action@v1 From 64e9a6ae8f8516691ea667cdcf81cc2de2dd387c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 08:46:34 +0100 Subject: [PATCH 10/17] everything ok now ? --- .github/workflows/install.yml | 67 -------------------------------- .github/workflows/unit_tests.yml | 10 ++++- CMakeLists.txt | 22 ++++++++--- test/CMakeLists.txt | 19 ++------- test/test_install.cpp | 6 +++ 5 files changed, 36 insertions(+), 88 deletions(-) delete mode 100644 .github/workflows/install.yml create mode 100644 test/test_install.cpp diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml deleted file mode 100644 index 4716861..0000000 --- a/.github/workflows/install.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: install -on: [push] - -jobs: - install: - runs-on: ${{ matrix.os }} - strategy: - matrix: - config: [Release, Debug] - os: [ubuntu-latest, windows-latest] - compiler: [gcc, clang, msvc] - exclude: - - os: windows-latest - compiler: gcc - - os: windows-latest - compiler: clang - - os: ubuntu-latest - compiler: msvc - steps: - - uses: actions/checkout@v4 - - - name: Get latest cmake - uses: lukka/get-cmake@latest - - - name: Configure - shell: cmake -P {0} - run: | - if ("${{ matrix.compiler }}" STREQUAL "msvc") - set(vcpkg_triplet x64-windows) - set(compiler_flags "/EHsc /W4") - else() - set(vcpkg_triplet x64-linux) - set(compiler_flags "-Wall -Wextra -Wpedantic -Wconversion -Wshadow") - if ("${{ matrix.compiler }}" STREQUAL "gcc") - set(ENV{CC} "gcc-13") - set(ENV{CXX} "g++-13") - else() - set(ENV{CC} "clang-15") - set(ENV{CXX} "clang++-15") - endif() - endif() - execute_process( - COMMAND cmake - -S . - -B build - -D IO1_WITH_TESTS=OFF - -D CMAKE_BUILD_TYPE=${{ matrix.config }} - -D "CMAKE_CXX_FLAGS=${compiler_flags}" - RESULT_VARIABLE result - ) - if (NOT result EQUAL 0) - message(FATAL_ERROR "Bad exit status") - endif() - - - name: Build - run: cmake --build build --config ${{ matrix.config }} --parallel --target io1-money - - - name: Install - run: cmake --install build --prefix install --config ${{ matrix.config }} - - - name: Test - run: | - pushd test - cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} "-Dio1-money_DIR=../install/share/io1-money/cmake" - cmake --build build --config ${{ matrix.config }} --parallel - popd - \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 24bccd9..7b30b0a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -62,4 +62,12 @@ jobs: - name: Publish test report uses: mikepenz/action-junit-report@v3 with: - report_paths: 'build/test/junit_*.xml' \ No newline at end of file + report_paths: 'build/test/junit_*.xml' + + - name: Install + run: cmake --install build --prefix install --config ${{ matrix.config }} + + - name: Use install + run: | + cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" + cmake --build install_build --config ${{ matrix.config }} --parallel diff --git a/CMakeLists.txt b/CMakeLists.txt index 572c49d..8a89360 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(GNUInstallDirs) add_library(${PROJECT_NAME} INTERFACE include/io1/money.hpp) target_include_directories( ${PROJECT_NAME} - INTERFACE $ + INTERFACE $ $) target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20) @@ -39,17 +39,29 @@ write_basic_package_version_file( configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" "${PROJECT_NAME}Config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) install( EXPORT ${PROJECT_NAME} NAMESPACE io1:: - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) if(IO1_WITH_TESTS) - add_subdirectory(test) + include(CTest) + + find_package(doctest CONFIG REQUIRED) + + add_executable(test_${PROJECT_NAME} test/test_money.cpp test/tutorial.cpp) + target_link_libraries(test_${PROJECT_NAME} PRIVATE io1::money + doctest::doctest) + + add_test( + NAME test_${PROJECT_NAME} + COMMAND test_${PROJECT_NAME} --reporters=junit + --out=junit_test_${PROJECT_NAME}.xml + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0cf873d..9668055 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,19 +1,8 @@ cmake_minimum_required(VERSION 3.25) -project(test_io1-money LANGUAGES CXX) +project(test_io1-money_install LANGUAGES CXX) -include(CTest) +find_package(io1_money REQUIRED) -find_package(doctest REQUIRED) -if (NOT TARGET io1::money) - find_package(io1_money REQUIRED) -endif() - -add_executable(${PROJECT_NAME} test/test_money.cpp test/tutorial.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE io1::money - doctest::doctest) -add_test( -NAME ${PROJECT_NAME} -COMMAND ${PROJECT_NAME} --reporters=junit - --out=junit_${PROJECT_NAME}.xml -WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) +add_library(${PROJECT_NAME} test_install.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE io1::money) diff --git a/test/test_install.cpp b/test/test_install.cpp new file mode 100644 index 0000000..92492eb --- /dev/null +++ b/test/test_install.cpp @@ -0,0 +1,6 @@ +#include "io1/money.hpp" + +io1::money add_twice(io1::money const & lhs, io1::money const & rhs) noexcept +{ + return lhs + 2 * rhs; +} From 66c6fc5f37bcf038fde55e76167691e1e9a99990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 08:47:49 +0100 Subject: [PATCH 11/17] qsd --- .github/workflows/unit_tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7b30b0a..d3bc6c9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -64,10 +64,10 @@ jobs: with: report_paths: 'build/test/junit_*.xml' - - name: Install - run: cmake --install build --prefix install --config ${{ matrix.config }} + - name: Install + run: cmake --install build --prefix install --config ${{ matrix.config }} - - name: Use install - run: | - cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" - cmake --build install_build --config ${{ matrix.config }} --parallel + - name: Use install + run: | + cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" + cmake --build install_build --config ${{ matrix.config }} --parallel From a65c539f037fc13da63639e7a256ab8d7eba3069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 08:48:51 +0100 Subject: [PATCH 12/17] lhg --- .github/workflows/unit_tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d3bc6c9..f471435 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -64,10 +64,10 @@ jobs: with: report_paths: 'build/test/junit_*.xml' - - name: Install - run: cmake --install build --prefix install --config ${{ matrix.config }} + - name: Install + run: cmake --install build --prefix install --config ${{ matrix.config }} - - name: Use install - run: | - cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" - cmake --build install_build --config ${{ matrix.config }} --parallel + - name: Use install + run: | + cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" + cmake --build install_build --config ${{ matrix.config }} --parallel From 8ac4c9a8c7d8bc38cb123b791b49837004cdfb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 08:52:32 +0100 Subject: [PATCH 13/17] lkjlkjh --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f471435..df721a9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -69,5 +69,5 @@ jobs: - name: Use install run: | - cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=install/share/io1-money/cmake" + cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1_money_DIR=install/share/io1-money/cmake" cmake --build install_build --config ${{ matrix.config }} --parallel From 28cb4487d3e2e605b5dd79c9da07a4d6fba1e850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 08:57:47 +0100 Subject: [PATCH 14/17] sdf --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a89360..21a7b43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,16 +39,16 @@ write_basic_package_version_file( configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/config.cmake.in" "${PROJECT_NAME}Config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) install( EXPORT ${PROJECT_NAME} NAMESPACE io1:: - DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - DESTINATION ${CMAKE_INSTALL_DATADIR}/io1/cmake) + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake) if(IO1_WITH_TESTS) include(CTest) From 31061aad99f93c191b7806ce7f122582e46c8008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 09:18:41 +0100 Subject: [PATCH 15/17] dfwsdg --- .github/workflows/unit_tests.yml | 2 +- test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index df721a9..1f36d09 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -69,5 +69,5 @@ jobs: - name: Use install run: | - cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1_money_DIR=install/share/io1-money/cmake" + cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=../install/share/io1-money/cmake" cmake --build install_build --config ${{ matrix.config }} --parallel diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9668055..bdbe76a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25) project(test_io1-money_install LANGUAGES CXX) -find_package(io1_money REQUIRED) +find_package(io1-money REQUIRED) add_library(${PROJECT_NAME} test_install.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE io1::money) From 761f5f44174306e607194a8ca858af297486aa24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 09:32:15 +0100 Subject: [PATCH 16/17] dsf --- cmake/config.cmake.in | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in index f333eff..3f40f35 100644 --- a/cmake/config.cmake.in +++ b/cmake/config.cmake.in @@ -5,4 +5,5 @@ check_required_components("@PROJECT_NAME@") if (TARGET io1::@PROJECT_NAME@) string(REGEX REPLACE "^io1-" "" ALIAS_TARGET_NAME @PROJECT_NAME@) add_library(io1::${ALIAS_TARGET_NAME} ALIAS io1::@PROJECT_NAME@) + target_compile_features(io1::${ALIAS_TARGET_NAME} INTERFACE cxx_std_20) endif() \ No newline at end of file From 767a39fa0dfe53e3aed2fc8ba522e5f8c683c6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yohann=20B=C3=A9n=C3=A9dic?= Date: Sat, 10 Feb 2024 09:38:48 +0100 Subject: [PATCH 17/17] dsghhj --- .github/workflows/unit_tests.yml | 25 ++++++++++++++++++++++--- cmake/config.cmake.in | 1 - 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 1f36d09..c299a74 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -67,7 +67,26 @@ jobs: - name: Install run: cmake --install build --prefix install --config ${{ matrix.config }} - - name: Use install + - name: Configure with install + shell: cmake -P {0} run: | - cmake -B install_build -S test -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D "io1-money_DIR=../install/share/io1-money/cmake" - cmake --build install_build --config ${{ matrix.config }} --parallel + if ("${{ matrix.compiler }}" STREQUAL "gcc") + set(ENV{CC} "gcc-13") + set(ENV{CXX} "g++-13") + else() + set(ENV{CC} "clang-15") + set(ENV{CXX} "clang++-15") + endif() + execute_process( + COMMAND cmake + -S test + -B install_build + -D CMAKE_BUILD_TYPE=${{ matrix.config }} + -D "io1-money_DIR=../install/share/io1-money/cmake" + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + - name: Build with install + run: cmake --build install_build --config ${{ matrix.config }} --parallel diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in index 3f40f35..f333eff 100644 --- a/cmake/config.cmake.in +++ b/cmake/config.cmake.in @@ -5,5 +5,4 @@ check_required_components("@PROJECT_NAME@") if (TARGET io1::@PROJECT_NAME@) string(REGEX REPLACE "^io1-" "" ALIAS_TARGET_NAME @PROJECT_NAME@) add_library(io1::${ALIAS_TARGET_NAME} ALIAS io1::@PROJECT_NAME@) - target_compile_features(io1::${ALIAS_TARGET_NAME} INTERFACE cxx_std_20) endif() \ No newline at end of file