generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
49 lines (36 loc) · 1.6 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
43
44
45
46
47
48
49
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")
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-setup/use-the-command-line/use-cmake-with-the-compiler.html
# Incidentally... MUST COME AFTER `project(...)`!
if (INTEL_DPCPP)
#cmake_minimum_required(VERSION 3.20)
find_package(IntelDPCPP REQUIRED)
endif()
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)