-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (30 loc) · 1.03 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
cmake_minimum_required(VERSION 3.14.2)
project(system-monitor C)
include(CTest)
enable_testing()
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/source
)
link_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/source)
file(GLOB all_SRCS
"${PROJECT_SOURCE_DIR}/include/*.h"
"${PROJECT_SOURCE_DIR}/source/*.c"
"${PROJECT_SOURCE_DIR}/source/threads/*.c"
"${PROJECT_SOURCE_DIR}/main.c"
)
add_executable(${PROJECT_NAME} ${all_SRCS})
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
# target_link_libraries(${PROJECT_NAME} -L /opt/X11/lib -lpthread -lX11)
target_link_libraries(${PROJECT_NAME} -lpthread -lX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
# Add warning flags
if(CMAKE_COMPILER_IS_GNUCC)
target_compile_options(${PROJECT_NAME} PUBLIC -Wall --pedantic -Wextra -pthread -fno-stack-protector)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "clang")
add_compile_options(${PROJECT_NAME} PUBLIC -Weverything -pthread)
endif()