-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (44 loc) · 1.19 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
50
51
52
53
54
cmake_minimum_required(VERSION 3.24)
project(sensor_test VERSION 1.0.0)
option(BUILD_TESTING "enable tests" OFF)
include(GNUInstallDirs)
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(argparse)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0
)
FetchContent_MakeAvailable(tomlplusplus)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CPUID REQUIRED libcpuid)
add_library(hwmondump_util INTERFACE)
target_sources(hwmondump_util PUBLIC
FILE_SET HEADERS
FILES include/hwmondump_util.hpp
)
target_include_directories(hwmondump_util INTERFACE
include/
"${CPUID_INCLUDE_DIRS}"
"${tomlplusplus_SOURCE_DIR}/include"
)
target_link_libraries(hwmondump_util INTERFACE
sensors
argparse::argparse
"${CPUID_LIBRARIES}"
uuid
)
add_executable(hwmondump bin/hwmondump.cpp)
target_compile_options(hwmondump PRIVATE -std=c++20)
target_link_libraries(hwmondump PUBLIC hwmondump_util)
install(TARGETS hwmondump)
add_subdirectory(man)
if (BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()