-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
86 lines (71 loc) · 2.59 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
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8)
project(sdrlib)
#select the debug build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
message(STATUS "Build type not specified: defaulting to debug.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
########################################################################
# Compiler specific setup
########################################################################
#set(CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG)
########################################################################
# Find build dependencies
########################################################################
if(WIN32)
message(STATUS "Using provided libraries for win32")
include_directories("${PROJECT_SOURCE_DIR}/win32")
link_directories("${PROJECT_SOURCE_DIR}/win32")
else(WIN32)
find_package(PkgConfig)
find_package(fftw3)
find_package(PortAudio)
find_package(Opus)
find_package(Ogg)
find_package(LibRtlSdr)
set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads)
if(NOT FFTW3_FOUND)
message(FATAL_ERROR "fftw required to compile SdrLib")
endif(NOT FFTW3_FOUND)
if(NOT OPUS_FOUND)
message(FATAL_ERROR "opus required to compile SdrLib")
endif(NOT OPUS_FOUND)
if(NOT OGG_FOUND)
message(FATAL_ERROR "libogg required to compile SdrLib")
endif(NOT OGG_FOUND)
if(NOT LIBRTLSDR_FOUND)
message(FATAL_ERROR "librtlsdr required to compile SdrLib")
endif(NOT LIBRTLSDR_FOUND)
if(NOT THREADS_FOUND)
message(FATAL_ERROR "pthreads(-win32) required to compile SdrLib")
endif(NOT THREADS_FOUND)
endif(WIN32)
########################################################################
# Setup the include and linker paths
########################################################################
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src
${OPUS_INCLUDE_DIR}
${LIBRTLSDR_INCLUDE_DIR}
${THREADS_PTHREADS_INCLUDE_DIR}
)
#link_directories(
# ...
#)
# Set component parameters
set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
########################################################################
# Setup the include and linker paths
########################################################################
add_subdirectory(src)
add_subdirectory(device)
add_subdirectory(test)
add_subdirectory(app)
add_subdirectory(qt)