forked from gat3way/gr-ale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
122 lines (100 loc) · 4.08 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright 2011-2020 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ale
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Select the release build type by default to get optimization flags.
# This has to come before project() which otherwise initializes it.
# Build type can still be overridden by setting -DCMAKE_BUILD_TYPE=
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "")
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 3.8)
project(gr-ale CXX C)
enable_testing()
# Install to PyBOMBS target prefix if defined
if(DEFINED ENV{PYBOMBS_PREFIX})
set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX} CACHE PATH "")
message(STATUS "PyBOMBS installed GNU Radio. Defaulting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}")
endif()
# Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake/Modules)
# Find gnuradio to get access to the cmake modules
find_package(Gnuradio "3.10" REQUIRED)
# Set the version information here
# cmake-format: off
set(VERSION_MAJOR 1)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH 0)
# cmake-format: on
cmake_policy(SET CMP0011 NEW)
# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
########################################################################
# Minimum Version Requirements
########################################################################
include(GrMinReq)
########################################################################
# Compiler settings
########################################################################
include(GrCompilerSettings)
########################################################################
# Install directories
########################################################################
include(GrVersion)
include(GrPlatform) #define LIB_SUFFIX
include(ExternalProject)
if(NOT CMAKE_MODULES_DIR)
set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
endif(NOT CMAKE_MODULES_DIR)
set(GR_INCLUDE_DIR include/gnuradio/ale)
set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/gnuradio-ale)
set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME})
# Add xmlrpc-c as an external project
ExternalProject_Add(xmlrpc-c
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/xmlrpc-c
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/xmlrpc-c"
CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/lib/xmlrpc-c/configure"
BUILD_COMMAND make
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
)
# Add a custom target for xmlrpc-c
add_custom_target(
xmlrpc-c-target
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/xmlrpc-c/src/xmlrpc-c-stamp/xmlrpc-c-build
)
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/gnuradio/ale)
add_subdirectory(lib)
add_subdirectory(apps)
add_subdirectory(docs)
# NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python
if(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are enabled")
add_subdirectory(python/ale)
add_subdirectory(grc)
else(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are disabled")
endif(ENABLE_PYTHON)
########################################################################
# Install cmake search helper for this library
########################################################################
install(FILES cmake/Modules/gnuradio-aleConfig.cmake
DESTINATION ${GR_CMAKE_DIR}
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Modules/targetConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/${target}Config.cmake
INSTALL_DESTINATION ${GR_CMAKE_DIR}
)