-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (33 loc) · 1.11 KB
/
CMakeLists.txt
File metadata and controls
45 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.15)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 26)
project(rsl-xml CXX)
add_library(rsl-xml)
target_include_directories(rsl-xml PUBLIC include)
add_subdirectory(src)
target_compile_options(rsl-xml PUBLIC "-freflection-latest")
target_include_directories(rsl-xml PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>)
find_package(rsl-util REQUIRED)
target_link_libraries(rsl-xml PUBLIC rsl::util)
install(TARGETS rsl-xml)
install(DIRECTORY include/ DESTINATION include)
option(BUILD_EXAMPLES "Enable examples" ON)
if (BUILD_EXAMPLES)
add_subdirectory(example)
endif()
option(BUILD_TESTING "Enable tests" ON)
option(BUILD_EXAMPLES "Enable examples" ON)
if (BUILD_TESTING)
message(STATUS "Building unit tests")
enable_testing()
add_executable(rsl-xml-test)
add_subdirectory(test)
find_package(GTest REQUIRED)
target_link_libraries(rsl-xml-test PRIVATE rsl-xml)
target_link_libraries(rsl-xml-test PRIVATE GTest::gtest)
include(GoogleTest)
gtest_discover_tests(rsl-xml-test)
endif()