forked from altillimity/AltiWx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (61 loc) · 2.15 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required (VERSION 3.0.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT MINGW)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
project (AltiWx)
file(GLOB_RECURSE AltiWx_CPPS src/*.cpp src/*.c)
if(APPLE)
include_directories(/usr/local/include)
link_directories(/usr/local/lib)
endif()
add_executable(AltiWx ${AltiWx_CPPS})
target_include_directories(AltiWx PUBLIC src)
target_link_libraries(AltiWx PUBLIC stdc++fs dl)
# Plugins
add_subdirectory(altiwx_plugins)
# Libraries
find_package(PkgConfig REQUIRED)
# Spdlog
find_package(Spdlog REQUIRED)
target_include_directories(AltiWx PUBLIC ${SPDLOG_INCLUDE_DIR})
target_link_libraries(AltiWx PUBLIC Spdlog::Spdlog)
# RTL-SDR
find_package(RTLSDR REQUIRED)
target_include_directories(AltiWx PUBLIC ${RTLSDR_INCLUDE_DIR})
target_link_libraries(AltiWx PUBLIC ${RTLSDR_LIBRARIES})
# Liquid-DSP
find_package(LIQUID REQUIRED)
target_include_directories(AltiWx PUBLIC ${LIQUID_INCLUDE_DIR})
target_link_libraries(AltiWx PUBLIC ${LIQUID_LIBRARIES})
# Threads
find_package(Threads REQUIRED)
target_link_libraries(AltiWx PUBLIC Threads::Threads)
# Predict
pkg_check_modules(predict REQUIRED predict)
target_include_directories(AltiWx PUBLIC ${PREDICT_INCLUDE_DIR})
target_link_libraries(AltiWx PUBLIC predict)
# Yaml-CPP
find_package(yaml-cpp REQUIRED)
pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
target_include_directories(AltiWx PUBLIC ${YAML_CPP_INCLUDE_DIR})
target_link_libraries(AltiWx PUBLIC yaml-cpp)
# LibDSP
find_library(DSP_LIBRARY dsp REQUIRED)
target_link_libraries(AltiWx PUBLIC ${DSP_LIBRARY})
# PyBind11
find_package(pybind11 REQUIRED)
target_link_libraries(AltiWx PUBLIC pybind11::embed)
target_include_directories(AltiWx PUBLIC ${PYBIND11_INCLUDE_DIR})
# FMT
find_package(fmt REQUIRED)
target_include_directories(AltiWx PUBLIC ${fmt_INCLUDE_DIRS})
target_link_libraries(AltiWx PUBLIC fmt)
# Mingw requires some manual stuff... There definitely is a better way to do it
if(MINGW)
target_link_libraries(AltiWx PUBLIC yaml-cpp ws2_32)
endif()