kopia lustrzana https://github.com/proto17/dji_droneid
113 wiersze
4.1 KiB
CMake
113 wiersze
4.1 KiB
CMake
# Copyright 2011,2012,2016,2018,2019 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-dji_droneid
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
#
|
|
|
|
########################################################################
|
|
# Setup library
|
|
########################################################################
|
|
include(GrPlatform) #define LIB_SUFFIX
|
|
|
|
list(APPEND dji_droneid_sources
|
|
utils.cc
|
|
burst_extractor_impl.cc
|
|
detector_impl.cc
|
|
)
|
|
|
|
set(dji_droneid_sources "${dji_droneid_sources}" PARENT_SCOPE)
|
|
if(NOT dji_droneid_sources)
|
|
MESSAGE(STATUS "No C++ sources... skipping lib/")
|
|
return()
|
|
endif(NOT dji_droneid_sources)
|
|
|
|
add_library(gnuradio-dji_droneid SHARED ${dji_droneid_sources})
|
|
target_link_libraries(gnuradio-dji_droneid gnuradio::gnuradio-runtime gnuradio-fft
|
|
fftw3 gnuradio-blocks gnuradio-filter gnuradio-analog)
|
|
target_include_directories(gnuradio-dji_droneid
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
PUBLIC $<INSTALL_INTERFACE:include>
|
|
)
|
|
set_target_properties(gnuradio-dji_droneid PROPERTIES DEFINE_SYMBOL "gnuradio_dji_droneid_EXPORTS")
|
|
|
|
if (NOT MATLAB_PATH STREQUAL "")
|
|
message(STATUS "MATLAB_PATH set to '${MATLAB_PATH}")
|
|
|
|
if (NOT IS_DIRECTORY "${MATLAB_PATH}")
|
|
message(FATAL_ERROR "MATLAB_PATH '${MATLAB_PATH}' does not exist or is not a directory")
|
|
endif()
|
|
|
|
set(MATLAB_INCLUDE_PATH "${MATLAB_PATH}/extern/include")
|
|
if (NOT IS_DIRECTORY "${MATLAB_INCLUDE_PATH}")
|
|
message(FATAL_ERROR "Could not find MATLAB include directory '${MATLAB_INCLUDE_PATH}")
|
|
endif()
|
|
|
|
set(MATLAB_LIB_PATH "${MATLAB_PATH}/extern/bin/glnxa64")
|
|
if (NOT IS_DIRECTORY "${MATLAB_LIB_PATH}")
|
|
message(FATAL_ERROR "Could not find MATLAB lib directory '${MATLAB_LIB_PATH}'")
|
|
endif()
|
|
|
|
if (NOT IS_DIRECTORY "${MATLAB_SOURCE_PATH}")
|
|
message(FATAL_ERROR "MATLAB source path '${MATLAB_SOURCE_PATH}' does not exist or is not a directory")
|
|
endif()
|
|
|
|
get_filename_component(MATLAB_SOURCE_PATH "${MATLAB_SOURCE_PATH}" REALPATH)
|
|
message(STATUS "Using MATLAB source path '${MATLAB_SOURCE_PATH}'")
|
|
|
|
target_link_directories(gnuradio-dji_droneid PUBLIC "${MATLAB_LIB_PATH}")
|
|
target_include_directories(gnuradio-dji_droneid PUBLIC "${MATLAB_INCLUDE_PATH}")
|
|
target_link_libraries(gnuradio-dji_droneid MatlabEngine MatlabDataArray)
|
|
target_compile_definitions(gnuradio-dji_droneid PUBLIC -DMATLAB_SOURCE_PATH="${MATLAB_SOURCE_PATH}")
|
|
|
|
list(APPEND test_dji_droneid_sources
|
|
qa_utils.cc
|
|
)
|
|
else()
|
|
message(WARNING "Disabling MATLAB based unit tests since MATLAB_PATH was not defined")
|
|
endif()
|
|
|
|
if(APPLE)
|
|
set_target_properties(gnuradio-dji_droneid PROPERTIES
|
|
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
|
)
|
|
endif(APPLE)
|
|
|
|
########################################################################
|
|
# Install built library files
|
|
########################################################################
|
|
include(GrMiscUtils)
|
|
GR_LIBRARY_FOO(gnuradio-dji_droneid)
|
|
|
|
########################################################################
|
|
# Print summary
|
|
########################################################################
|
|
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
|
|
message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
|
|
|
|
########################################################################
|
|
# Build and register unit test
|
|
########################################################################
|
|
include(GrTest)
|
|
|
|
# If your unit tests require special include paths, add them here
|
|
#include_directories()
|
|
# List all files that contain Boost.UTF unit tests here
|
|
list(APPEND test_dji_droneid_sources
|
|
# Only tests that do not require MATLAB will live here
|
|
)
|
|
# Anything we need to link to for the unit tests go here
|
|
list(APPEND GR_TEST_TARGET_DEPS gnuradio-dji_droneid)
|
|
|
|
if(NOT test_dji_droneid_sources)
|
|
MESSAGE(STATUS "No C++ unit tests... skipping")
|
|
return()
|
|
endif(NOT test_dji_droneid_sources)
|
|
|
|
foreach(qa_file ${test_dji_droneid_sources})
|
|
GR_ADD_CPP_TEST("dji_droneid_${qa_file}"
|
|
${CMAKE_CURRENT_SOURCE_DIR}/${qa_file}
|
|
)
|
|
endforeach(qa_file)
|