-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
39 lines (30 loc) · 1.01 KB
/
CMakeLists.txt
File metadata and controls
39 lines (30 loc) · 1.01 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
cmake_minimum_required(VERSION 3.16)
project(YAMLWrapper)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
enable_testing()
include(FetchContent)
FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG yaml-cpp-0.9.0
)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.2
)
FetchContent_MakeAvailable(yaml-cpp)
FetchContent_MakeAvailable(Catch2)
add_subdirectory(tests)
file(COPY ${CMAKE_SOURCE_DIR}/lattice_files/
DESTINATION ${CMAKE_BINARY_DIR}/lattice_files/)
add_library(yaml_c_wrapper SHARED src/yaml_c_wrapper.cpp)
target_link_libraries(yaml_c_wrapper PUBLIC yaml-cpp)
add_executable(example_rw examples/example_rw.cpp)
target_link_libraries(example_rw yaml_c_wrapper yaml-cpp)
add_executable(get_lattices src/get_lattices.cpp)
target_link_libraries(get_lattices yaml_c_wrapper yaml-cpp)