forked from NOAA-OWP/SLoTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
42 lines (30 loc) · 1.27 KB
/
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
cmake_minimum_required(VERSION 3.10)
# Uncomment this and rebuild artifacts to enable debugging
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(slothmodel VERSION 1.0.0 DESCRIPTION "Simple Logical Tautology Handler (SLoTH) Model Shared Library")
if(WIN32)
add_library(slothmodel src/sloth.cpp)
else()
add_library(slothmodel SHARED src/sloth.cpp)
endif()
include_directories(PRIVATE include)
#target_include_directories(slothmodel PRIVATE include)
#Where to look for bmi header, depending on where cmake is run from
include_directories(PRIVATE extern/bmi-cxx)
#target_include_directories(slothmodel PRIVATE ../bmi-cxx/ )
set_target_properties(slothmodel PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(slothmodel PROPERTIES PUBLIC_HEADER include/sloth.hpp)
include(GNUInstallDirs)
install(TARGETS slothmodel
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
configure_file(slothmodel.pc.in slothmodel.pc @ONLY)
option(PACKAGE_TESTS "Build the tests" ON)
if(PACKAGE_TESTS)
enable_testing()
include(GoogleTest)
add_subdirectory(test)
endif()
install(FILES ${CMAKE_BINARY_DIR}/slothmodel.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)