forked from castvoid/xserve-frontpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (23 loc) · 818 Bytes
/
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
cmake_minimum_required(VERSION 3.0)
project(hwmond)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
set(SOURCE_FILES
hwmond.c cpu_usage.c cpu_usage.h)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/modules")
find_package(LibUSB REQUIRED)
add_executable(hwmond ${SOURCE_FILES})
if (APPLE)
find_library(CoreFoundation CoreFoundation)
find_library(IOKit IOKit)
target_link_libraries(hwmond ${CoreFoundation} ${IOKit} objc)
endif()
include_directories(${LIBUSB_INCLUDE_DIR})
target_link_libraries(hwmond ${LIBUSB_LIBRARY})
target_link_libraries(hwmond m)
target_link_libraries(hwmond pthread)