From 220a2458c3b857d587800042ff3b468c7954ebe2 Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Tue, 7 May 2024 17:31:38 +0200 Subject: [PATCH 1/6] Update testing.cmake: find_package(doctest) --- cmake/testing.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/testing.cmake b/cmake/testing.cmake index c3cea11..aef91a7 100644 --- a/cmake/testing.cmake +++ b/cmake/testing.cmake @@ -12,6 +12,8 @@ set(DOCTEST_NO_INSTALL True) FetchContent_MakeAvailable(doctest) +find_package(doctest CONFIG REQUIRED) + add_library(doctest_main STATIC ${PROJECT_SOURCE_DIR}/tests/test_main.cpp) set(TEST_FRAMEWORK doctest::doctest) From e59517484b248207a9fa036f7d410d5d7d460bf9 Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Tue, 7 May 2024 17:34:45 +0200 Subject: [PATCH 2/6] Update CMakeLists.txt: set version to 0.1.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da4c73e..9b61fb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.27) -project(astr VERSION 1.0.0 LANGUAGES CXX) +project(astr VERSION 0.1.0 LANGUAGES CXX) if(PROJECT_IS_TOP_LEVEL) # make git ignore the build directory From bc2892dcbfb50b34245944421a797a71c6fcdc8a Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Wed, 8 May 2024 09:46:26 +0200 Subject: [PATCH 3/6] Update CMakeLists.txt: troubleshooting config installation setup --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b61fb0..2e98d51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,29 +78,28 @@ if (ASTR_ADD_INSTALL) # include gnudirs and add installation of the header file of the astr library include(GNUInstallDirs) - install(TARGETS astr EXPORT astrTargets) + install(TARGETS astr EXPORT astrTargets INCLUDES DESTINATION "${CMAKE_INSTALL_DATADIR}") install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(EXPORT astrTargets FILE astrTargets.cmake NAMESPACE a4z:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/a4z + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" ) include(CMakePackageConfigHelpers) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/astrConfigVersion.cmake - VERSION 1.0.0 COMPATIBILITY AnyNewerVersion ) configure_package_config_file( ${CMAKE_CURRENT_LIST_DIR}/cmake/astrConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/astrConfig.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/a4z + INSTALL_DESTINATION "share/cmake/${PROJECT_NAME}" ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/astrConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/astrConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/a4z + DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" ) endif() From 8d6209f473772a0814266f44eec8cc612e57f87e Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Wed, 8 May 2024 09:48:48 +0200 Subject: [PATCH 4/6] Update CMakeLists.txt: incremented version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e98d51..881dac3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.27) -project(astr VERSION 0.1.0 LANGUAGES CXX) +project(astr VERSION 0.1.1 LANGUAGES CXX) if(PROJECT_IS_TOP_LEVEL) # make git ignore the build directory From 76da37b60c9640fdaf4c8a58f9a8298348bc0876 Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Wed, 8 May 2024 10:02:11 +0200 Subject: [PATCH 5/6] Create LICENSE: needed for vcpkg --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6277bd0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Rostyslav Skrypnyk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 45ec33d1fd69837ae6c5ed661e9e4ebd4fd4f476 Mon Sep 17 00:00:00 2001 From: Rostyslav Skrypnyk Date: Wed, 8 May 2024 10:59:48 +0200 Subject: [PATCH 6/6] Update testing.cmake: make fetching doctest optional (default ON) --- cmake/testing.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/testing.cmake b/cmake/testing.cmake index aef91a7..646f8c2 100644 --- a/cmake/testing.cmake +++ b/cmake/testing.cmake @@ -1,16 +1,20 @@ include_guard(GLOBAL) -include(FetchContent) +option(FETCH_DOCTEST "Use fetch content to get doctest" ON) +if (FETCH_DOCTEST) + message(STATUS "Fetching doctest") -FetchContent_Declare( - doctest - GIT_REPOSITORY "https://github.com/onqtam/doctest" - GIT_TAG "v2.4.11" -) + include(FetchContent) -set(DOCTEST_NO_INSTALL True) + FetchContent_Declare( + doctest + GIT_REPOSITORY https://github.com/onqtam/doctest + GIT_TAG v2.4.11 + OVERRIDE_FIND_PACKAGE + ) +endif() -FetchContent_MakeAvailable(doctest) +set(DOCTEST_NO_INSTALL True) find_package(doctest CONFIG REQUIRED)