-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (34 loc) · 1.45 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
cmake_minimum_required(VERSION 3.2)
project(zerotune
VERSION 0.1.0)
set(PROJCT_DESCRIPTION
"Playground Tuner with a WebRTC DataChannel for the Pi Zero")
set(PROJECT_URL
"https://github.com/kpe/zerotune")
set(ENV{PKG_CONFIG_PATH} "{CMAKE_INSTALL_PREFIX}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
# Debug build type as default
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, using RELEASE")
set(CMAKE_BUILD_TYPE "RELEASE")
endif ()
# Use pkg-config
find_package(PkgConfig REQUIRED)
# Dependency list
set(zerotune_DEP_LIBRARIES)
link_directories(${LIB_RAWRTC_LIBRARY_DIRS})
list(APPEND zerotune_DEP_LIBRARIES ${LIB_RAWRTC_LIBRARIES})
# Linker flags (includes libs that have no pkg-config files)
set(PKG_CONFIG_LIB_DIRS "-L\${libdir}")
set(PKG_CONFIG_LIBRARIES "-lrawrtc")
set(PKG_CONFIG_LIBS "${PKG_CONFIG_LIB_DIRS} ${PKG_CONFIG_LIBRARIES}")
set(PKG_CONFIG_LIB_DIRS_PRIVATE "${PKG_CONFIG_LIB_DIRS} -L${LIB_USRSCTP_LIBRARY_DIRS}")
set(PKG_CONFIG_LIBRARIES_PRIVATE "${PKG_CONFIG_LIBRARIES} ${LIB_USRSCTP_LIBRARIES}")
set(PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIB_DIRS_PRIVATE} ${PKG_CONFIG_LIBRARIES_PRIVATE}")
# Cflags (includes includes that have no pkg-config files)
set(PKG_CONFIG_CFLAGS "-I\${includedir} -I${LIB_USRSCTP_INCLUDE_DIRS}")
# Add custom target to install the library
add_custom_target(install-${PROJECT_NAME}
$(MAKE) install
COMMENT "Installing ${PROJECT_NAME}")
# Walk through subdirectories
add_subdirectory(src)