improve cmake setup
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
ff0eda005d
commit
aec7e62545
6 changed files with 14 additions and 25 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue