-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathCMakeLists.txt
32 lines (23 loc) · 1.02 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
project(thinkfan)
cmake_minimum_required(VERSION 2.6)
option(USE_ATASMART "Enable reading temperatures from HDDs via S.M.A.R.T")
set(MAXERR 2 CACHE STRING "Fail after this many consecutive errors when in DANGEROUS
mode")
add_executable(thinkfan src/thinkfan.c src/config.c src/message.c src/parser.c src/system.c)
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -Wall -DDEBUG")
if(NOT DEFINED CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "-O3 -Wall")
endif(NOT DEFINED CMAKE_C_FLAGS)
if(MAXERR)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DMAXERR=${MAXERR}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMAXERR=${MAXERR}")
endif(MAXERR)
if(USE_ATASMART)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUSE_ATASMART")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_ATASMART")
target_link_libraries(thinkfan atasmart)
endif(USE_ATASMART)
install(TARGETS thinkfan DESTINATION sbin)
install(FILES NEWS COPYING README examples/thinkfan.conf.complex
examples/thinkfan.conf.simple DESTINATION share/doc/thinkfan)
install(FILES thinkfan.1 DESTINATION share/man/man1)