-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
35 lines (28 loc) · 960 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
project(FortYamlShackle Fortran C CXX)
# Find the yaml module
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/tools/cmake/Modules")
include(ExternalProject)
include(GoogleTest)
include(CTest)
# Set default ExternalProject root directory
set(EXTERNALS_DIR ${CMAKE_BINARY_DIR}/ThirdParty)
# Add libyaml
ExternalProject_Add(yaml-cpp
PREFIX ${EXTERNALS_DIR}
GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${EXTERNALS_DIR}/installed
# Log output
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)
# Specify include dir
include_directories(include ${EXTERNALS_DIR}/installed/include)
add_subdirectory(src)
add_subdirectory(tests)
install (FILES ${CMAKE_BINARY_DIR}/src/fort_yaml.exe
PERMISSIONS GROUP_READ GROUP_EXECUTE
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
DESTINATION ${PROJECT_SOURCE_DIR}/bin)