-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (26 loc) · 926 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
32
33
# -*- mode: cmake; cmake-tab-width: 4 -*-
# Just reduce this version if needed and send me a patch if it
# works. This is just the version I have.
cmake_minimum_required(VERSION 3.16)
project("Possujuna" C)
# the `pkg_check_modules` function is created with this call
find_package(PkgConfig REQUIRED)
# these calls create special `PkgConfig::<MODULE>` variables
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(ZMQ REQUIRED IMPORTED_TARGET libczmq)
pkg_check_modules(MODBUS REQUIRED IMPORTED_TARGET libmodbus)
pkg_check_modules(PQ REQUIRED IMPORTED_TARGET libpq)
add_compile_options(
-std=gnu17 # C17 standard
-O0 # optimize
-Wall # enable warnings
-g
)
file(GLOB SRC_FILES "src/*.c") # Load all files in src folder
add_executable(possujuna ${SRC_FILES})
target_link_libraries(possujuna PUBLIC
PkgConfig::GLIB
PkgConfig::ZMQ
PkgConfig::MODBUS
PkgConfig::PQ
)