-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (47 loc) · 1.72 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (47 loc) · 1.72 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
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.16)
project(thermox_if97 VERSION 0.4.0 LANGUAGES C)
option(THERMOX_IF97_BUILD_TESTS "Build IF97 regression tests" ON)
option(THERMOX_IF97_BUILD_LEGACY_CLI "Build the legacy file-based CLI" OFF)
add_library(thermox_if97 SHARED
if97_general.c
region1.c
region2.c
region3.c
region5.c
region_calc.c
steam_property_calc.c
thermox_if97.c
)
add_library(thermox::if97 ALIAS thermox_if97)
target_include_directories(thermox_if97
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(thermox_if97 PRIVATE THERMOX_IF97_BUILDING_LIBRARY)
set_target_properties(thermox_if97 PROPERTIES
C_STANDARD 11 C_STANDARD_REQUIRED YES
C_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN YES
VERSION ${PROJECT_VERSION} SOVERSION 0
)
if(NOT MSVC)
target_link_libraries(thermox_if97 PRIVATE m)
set_source_files_properties(thermox_if97.c PROPERTIES
COMPILE_OPTIONS "-Wall;-Wextra;-Wpedantic"
)
endif()
if(THERMOX_IF97_BUILD_LEGACY_CLI)
add_executable(if97_legacy_cli ws-if97-main.c)
target_link_libraries(if97_legacy_cli PRIVATE thermox_if97)
target_include_directories(if97_legacy_cli PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(THERMOX_IF97_BUILD_TESTS)
include(CTest)
add_executable(thermox_if97_api_test tests/api_test.c)
target_link_libraries(thermox_if97_api_test PRIVATE thermox_if97)
add_test(NAME thermox_if97_api_test COMMAND thermox_if97_api_test)
endif()
include(GNUInstallDirs)
install(TARGETS thermox_if97 EXPORT thermox_if97_targets)
install(FILES include/thermox_if97.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})