-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
21 lines (19 loc) · 912 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
cmake_minimum_required(VERSION 3.20)
project(nix-monitored)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
add_executable(${PROJECT_NAME} monitored.cc)
target_compile_definitions(${PROJECT_NAME} PRIVATE "PATH=\"${PATH}\"")
option(NOTIFY "use libnotify" OFF)
if(NOTIFY)
target_compile_definitions(${PROJECT_NAME} PRIVATE "NOTIFY")
target_compile_definitions(${PROJECT_NAME} PRIVATE "NOTIFY_ICON=\"${NOTIFY_ICON}\"")
find_package(PkgConfig REQUIRED)
pkg_check_modules(deps REQUIRED IMPORTED_TARGET glib-2.0 gdk-pixbuf-2.0 libnotify)
target_link_libraries(${PROJECT_NAME} PkgConfig::deps)
endif(NOTIFY)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)