-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
64 lines (52 loc) · 1.75 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# SPDX-FileCopyrightText: 2021-2022 Mattéo Delabre <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
cmake_minimum_required(VERSION 3.7)
project(waved VERSION 0.1.0)
find_package(Threads REQUIRED)
# Option: Enable performance measurements and reporting for updates
option(ENABLE_PERF_REPORT "Report performance information" OFF)
if(ENABLE_PERF_REPORT)
add_compile_definitions(ENABLE_PERF_REPORT)
endif()
# Option: Do not interact with the display, only generate frames
# on the main thread
option(DRY_RUN "Dry run: do not actually send updates" OFF)
if(DRY_RUN)
add_compile_definitions(DRY_RUN)
endif()
# Enable C++17 support
if(CMAKE_VERSION VERSION_LESS "3.8")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
else()
message(FATAL_ERROR "Unknown compiler")
endif()
else()
set(CMAKE_CXX_STANDARD 17)
endif()
# Disable optimizations in debug mode
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
endif(CMAKE_COMPILER_IS_GNUCC)
# Main library
add_library(waved SHARED
lib/defs.cpp
lib/display.cpp
lib/file_descriptor.cpp
lib/waveform_table.cpp
)
set_target_properties(waved PROPERTIES
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
target_link_libraries(waved Threads::Threads)
target_include_directories(waved PUBLIC lib)
# Demo program
add_executable(waved-demo src/demo/main.cpp)
target_link_libraries(waved-demo waved)
# WBF dump program
add_executable(waved-dump src/dump/main.cpp)
target_link_libraries(waved-dump waved)
# rm2fb server
add_executable(waved-rm2fb src/rm2fb/main.cpp)
target_link_libraries(waved-rm2fb waved rt)