-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (33 loc) · 990 Bytes
/
CMakeLists.txt
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
46
cmake_minimum_required(VERSION 3.28)
project(unicode_yaml CXX)
set(CMAKE_CXX_STANDARD 23)
option(ENABLE_TEST "" OFF)
include(cmake/msvc.cmake)
set_msvc_utf_8()
include_directories("include")
aux_source_directory("src" SRCS)
add_library(unicode_yaml SHARED
${SRCS}
)
target_compile_definitions(unicode_yaml
PUBLIC -DUYAML_EXPORT
)
add_library(unicode_yaml_static STATIC
${SRCS}
)
target_compile_definitions(unicode_yaml_static
PUBLIC -DUYAML_USE_STATIC
)
install(TARGETS unicode_yaml_static DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(DIRECTORY include/uyaml DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
if (ENABLE_TEST)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.15.0.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_subdirectory(tests)
endif ()