-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
92 lines (79 loc) · 3.04 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cmake_minimum_required(VERSION 3.19)
set(CMAKE_CXX_STANDARD 20)
include(cmake/Dependencies.cmake)
include(cmake/Findpicoscope.cmake)
project(opencmw-worker CXX)
include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)
include(GNUInstallDirs)
find_package(Gnuradio "3.10.4" COMPONENTS
blocks
analog
filter
fft
)
find_package(gnuradio-pulsed_power)
#set(PS4000A_EXPORT_NAME ps4000aTargets)
find_package(picoscope)
message("PICOSCOPE_LIB_DIR " ${PICOSCOPE_LIB_DIR})
#add_library(ps4000a SHARED ${PICOSCOPE_LIB_DIR} )
add_library(picoscope SHARED IMPORTED)
set_target_properties(picoscope PROPERTIES IMPORTED_LOCATION ${PICOSCOPE_LIB_DIR})
target_link_libraries( picoscope)
# Check for supported compiler versions
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1.0)
message(FATAL_ERROR "GCC>=12.1.0 required, but gcc ${CMAKE_CXX_COMPILER_VERSION} detected.")
endif ()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0.0)
message(FATAL_ERROR "Clang>=13.0.0 required, but clang ${CMAKE_CXX_COMPILER_VERSION} detected.")
endif ()
else ()
message(WARN "No version check for your compiler (${CMAKE_CXX_COMPILER_ID}) implemented, "
"in case of build problems consider updating your compiler or check if you can switch to gcc or clang")
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF)
if (ENABLE_BUILD_WITH_TIME_TRACE)
target_compile_options(project_options INTERFACE -ftime-trace)
endif ()
endif ()
# enable cache system
include(cmake/Cache.cmake)
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
# standard compiler warnings
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
# allow for static analysis options
include(cmake/StaticAnalyzers.cmake)
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(ENABLE_COVERAGE ON)
else ()
set(ENABLE_COVERAGE OFF)
endif ()
if (ENABLE_COVERAGE)
if (UNIX AND NOT APPLE) # Linux
message("Coverage reporting enabled")
include(cmake/CodeCoverage.cmake) # https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
# (License: BSL-1.0)
append_coverage_compiler_flags()
setup_target_for_coverage_gcovr_xml(
NAME coverage
EXECUTABLE ctest
EXCLUDE "$CMAKE_BUILD_DIR/*" "test/.*")
setup_target_for_coverage_gcovr_html(
NAME coverage_html
EXECUTABLE ctest
EXCLUDE "$CMAKE_BUILD_DIR/*" "test/.*")
else ()
message(WARNING "Coverage is only supported on linux")
endif ()
endif ()
add_subdirectory(src)
include(CTest)
add_subdirectory(test)