From d72059aa74542ca8c1b611bbab7e79d8d4ae13f7 Mon Sep 17 00:00:00 2001 From: folling Date: Thu, 15 Feb 2024 22:04:37 +0100 Subject: [PATCH] improve cmake setup Signed-off-by: Folling --- .gitmodules | 3 +++ CMakeLists.txt | 29 +++++++---------------------- vendor/CMakeLists.txt | 3 ++- vendor/catch2 | 1 - vendor/cppbase | 1 + vendor/sqlitecpp | 2 +- 6 files changed, 14 insertions(+), 25 deletions(-) delete mode 160000 vendor/catch2 create mode 160000 vendor/cppbase diff --git a/.gitmodules b/.gitmodules index a26cc62..933638b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "vendor/doxygen-awesome-css"] path = vendor/doxygen-awesome-css url = git@github.com:jothepro/doxygen-awesome-css.git +[submodule "vendor/cppbase"] + path = vendor/cppbase + url = ssh://git@git.rewritesarebliss.com:16658/Folling/cppbase.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fe8e89..92e04cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,13 +5,6 @@ option(LIBIKARUS_ENABLE_TESTS "Enable tests" OFF) option(LIBIKARUS_ENABLE_LINTS "Enable linting" OFF) option(LIBIKARUS_BUILD_DOCS "Build documentation" OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 23) - -set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - add_subdirectory(vendor) add_subdirectory(include) add_subdirectory(src) @@ -24,6 +17,13 @@ add_library( ${SOURCE_FILES} ) +set_target_properties( + ikarus PROPERTIES + CXX_STANDARD 23 + CXX_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE TRUE +) + target_include_directories( ikarus PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include @@ -57,21 +57,6 @@ if (LIBIKARUS_ENABLE_LINTS) ) endif () -if (LIBIKARUS_ENABLE_TESTS) - add_executable(libikarus_tests ${SOURCE_FILES}) - target_link_libraries(libikarus_tests PRIVATE sqlitecpp Catch2::Catch2WithMain) - - target_include_directories( - libikarus_tests PRIVATE - ${CMAKE_CURRENT_LIST_DIR}/include - ${CMAKE_CURRENT_LIST_DIR}/src - ) - - include(CTest) - include(vendor/catch2/extras/Catch.cmake) - catch_discover_tests(libikarus_tests) -endif () - if (LIBIKARUS_BUILD_DOCS) find_program(DOXYGEN_PATH NAMES doxygen REQUIRED) add_custom_target( diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index 9820477..611db2e 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -1,2 +1,3 @@ -add_subdirectory(catch2) +# order is important here since sqlitecpp otherwise duplicates cppbase +add_subdirectory(cppbase) add_subdirectory(sqlitecpp) diff --git a/vendor/catch2 b/vendor/catch2 deleted file mode 160000 index 5bba3e4..0000000 --- a/vendor/catch2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5bba3e4038602badb691da914523f667a2dd1f27 diff --git a/vendor/cppbase b/vendor/cppbase new file mode 160000 index 0000000..6bf80cf --- /dev/null +++ b/vendor/cppbase @@ -0,0 +1 @@ +Subproject commit 6bf80cf9d5ff54ab300f7e88a8cb9996f441dae6 diff --git a/vendor/sqlitecpp b/vendor/sqlitecpp index 7832ea6..4a97c47 160000 --- a/vendor/sqlitecpp +++ b/vendor/sqlitecpp @@ -1 +1 @@ -Subproject commit 7832ea68dca4c8367dd938b079a01ccffe6a7acd +Subproject commit 4a97c47847cbe9cf610a636137f678b447cdde5a