generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
38 lines (25 loc) · 1.12 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
cmake_minimum_required(VERSION 3.12)
# Uncomment this and rebuild artifacts to enable debugging
set(CMAKE_BUILD_TYPE Debug)
project(petbmi VERSION 1.0.0 DESCRIPTION "OWP PET BMI Module Shared Library")
# PET
set(PET_LIB_NAME_CMAKE petbmi)
set(PET_LIB_DESC_CMAKE "OWP PET BMI Module Shared Library")
# Make sure these are compiled with this directive
add_compile_definitions(BMI_ACTIVE)
if(WIN32)
add_library(petbmi src/bmi_pet.c src/pet.c)
else()
add_library(petbmi SHARED src/bmi_pet.c src/pet.c)
endif()
target_include_directories(petbmi PRIVATE include)
set_target_properties(petbmi PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(petbmi PROPERTIES PUBLIC_HEADER bmi_pet.h)
# Code requires minimum of C99 standard to compile
set_target_properties(petbmi PROPERTIES C_STANDARD 99 C_STANDARD_REQUIRED ON)
include(GNUInstallDirs)
install(TARGETS petbmi
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
configure_file(petbmi.pc.in petbmi.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/petbmi.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)