2013-04-02 06:51:00 +08:00
|
|
|
# Copyright 2011,2013 Free Software Foundation, Inc.
|
2011-12-15 02:17:16 +08:00
|
|
|
#
|
|
|
|
# This file is part of GNU Radio
|
|
|
|
#
|
|
|
|
# GNU Radio is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# GNU Radio is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with GNU Radio; see the file COPYING. If not, write to
|
|
|
|
# the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
# Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Project setup
|
|
|
|
########################################################################
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2013-12-25 04:51:45 +08:00
|
|
|
project(gr-gr-air-modes CXX C)
|
2012-09-05 17:43:28 +08:00
|
|
|
set(gr-gr-air-modes_VERSION_MAJOR 0)
|
|
|
|
set(gr-gr-air-modes_VERSION_MINOR 0)
|
2011-12-15 02:17:16 +08:00
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
#select the release build type by default to get optimization flags
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
message(STATUS "Build type not specified: defaulting to release.")
|
|
|
|
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
|
|
|
|
########################################################################
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
#http://gcc.gnu.org/wiki/Visibility
|
|
|
|
add_definitions(-fvisibility=hidden)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Find boost
|
|
|
|
########################################################################
|
2013-05-08 04:05:52 +08:00
|
|
|
include(GrBoost)
|
2011-12-15 02:17:16 +08:00
|
|
|
|
2013-12-25 04:51:45 +08:00
|
|
|
find_package(PythonLibs 2)
|
|
|
|
|
2011-12-15 02:17:16 +08:00
|
|
|
########################################################################
|
|
|
|
# Install directories
|
|
|
|
########################################################################
|
|
|
|
include(GrPlatform) #define LIB_SUFFIX
|
|
|
|
set(GR_RUNTIME_DIR bin)
|
|
|
|
set(GR_LIBRARY_DIR lib${LIB_SUFFIX})
|
|
|
|
set(GR_INCLUDE_DIR include)
|
|
|
|
set(GR_DATA_DIR share)
|
|
|
|
set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
|
|
|
|
set(GR_DOC_DIR ${GR_DATA_DIR}/doc)
|
|
|
|
set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
|
|
|
|
set(GR_CONF_DIR etc)
|
|
|
|
set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
|
|
|
|
set(GR_LIBEXEC_DIR libexec)
|
|
|
|
set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME})
|
|
|
|
set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Find gnuradio build dependencies
|
|
|
|
########################################################################
|
2013-12-25 04:51:45 +08:00
|
|
|
set(GR_REQUIRED_COMPONENTS RUNTIME)
|
|
|
|
find_package(Gnuradio "3.7.2" REQUIRED)
|
2011-12-15 02:17:16 +08:00
|
|
|
|
2013-07-18 09:03:45 +08:00
|
|
|
if(NOT GNURADIO_RUNTIME_FOUND)
|
|
|
|
message(FATAL_ERROR "GnuRadio Runtime required to compile gr-air-modes")
|
2013-05-30 05:57:51 +08:00
|
|
|
endif()
|
|
|
|
|
2013-09-18 23:53:00 +08:00
|
|
|
########################################################################
|
|
|
|
# Find PyZMQ bindings
|
|
|
|
########################################################################
|
|
|
|
include(GrPython)
|
2013-09-18 23:57:44 +08:00
|
|
|
GR_PYTHON_CHECK_MODULE("PyZMQ" "zmq" "int(zmq.__version__.split('.')[0]) >= 13" PYZMQ_FOUND)
|
|
|
|
if(NOT PYZMQ_FOUND)
|
2013-09-18 23:53:00 +08:00
|
|
|
message(FATAL_ERROR "Python ZMQ bindings not found.")
|
|
|
|
endif()
|
|
|
|
|
2011-12-15 02:17:16 +08:00
|
|
|
########################################################################
|
|
|
|
# Setup the include and linker paths
|
|
|
|
########################################################################
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
|
|
|
${Boost_INCLUDE_DIRS}
|
2013-07-18 09:03:45 +08:00
|
|
|
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
2011-12-15 02:17:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
link_directories(
|
|
|
|
${Boost_LIBRARY_DIRS}
|
2013-07-18 09:03:45 +08:00
|
|
|
${GNURADIO_RUNTIME_LIBRARY_DIRS}
|
2011-12-15 02:17:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Set component parameters
|
|
|
|
set(GR_GR-AIR-MODES_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
|
|
|
|
set(GR_GR-AIR-MODES_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE)
|
|
|
|
|
2012-10-16 01:40:21 +08:00
|
|
|
########################################################################
|
|
|
|
# Create uninstall target
|
|
|
|
########################################################################
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
add_custom_target(uninstall
|
|
|
|
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
|
|
|
)
|
|
|
|
|
2011-12-15 02:17:16 +08:00
|
|
|
########################################################################
|
|
|
|
# Add subdirectories
|
|
|
|
########################################################################
|
2013-08-06 07:26:22 +08:00
|
|
|
add_subdirectory(include/gr_air_modes)
|
2011-12-15 02:17:16 +08:00
|
|
|
add_subdirectory(lib)
|
|
|
|
add_subdirectory(swig)
|
|
|
|
add_subdirectory(python)
|
|
|
|
add_subdirectory(grc)
|
|
|
|
add_subdirectory(apps)
|
2012-07-06 02:00:52 +08:00
|
|
|
add_subdirectory(docs)
|
|
|
|
add_subdirectory(res)
|