summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2019-03-02 19:59:00 +0100
committerMarcus Müller <marcus.mueller@ettus.com>2019-03-04 22:30:37 +0100
commitab2fb35677e38a384df3f9503d1f45f64bbc0374 (patch)
treec59965a71d4951e9bcae9efcf9a6005df2f340a1 /gnuradio-runtime/lib
parent4e777f1c0ee28011255e3b6b703463cef0f207e0 (diff)
cmake: Update to modern CMake usage
This includes using target based setting of includes and link libraries. This will transitively add the includes and linking flags to dependent targets. This is still a work in progress since only the dynamic libraries have been touched and not all of include_directories directives are gone yet. cmake: remove GR_INCLUDE_SUBDIRECTORY macro Previously this macro was used to inject subdirectories in the current CMake namespace. This is generally undesired and pollutes the current context. previously GNU Radio CMake had a non-default option ENABLE_STATIC_LIBS to build both, shared libraries and static libraries. This seems to be a construction taken over from autotools and serves no purpuose in CMake and complicates the library building. cmake: remove GR_LIBTOOL and la generation support This looks like it was primarily used to support projects using autotools, but comments state that the generated .la files aren't compatible with autotools anyway. cmake: Bump required CMake version to 3.8 UseSWIG cmake uses syntax which requires at least CMake 3.8 and is non-trivial to change
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt263
-rw-r--r--gnuradio-runtime/lib/controlport/CMakeLists.txt104
-rw-r--r--gnuradio-runtime/lib/math/CMakeLists.txt29
-rw-r--r--gnuradio-runtime/lib/messages/CMakeLists.txt29
-rw-r--r--gnuradio-runtime/lib/pmt/CMakeLists.txt49
-rw-r--r--gnuradio-runtime/lib/thread/CMakeLists.txt28
6 files changed, 182 insertions, 320 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index d585f22d6c..3435f6aef7 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -18,7 +18,7 @@
# Boston, MA 02110-1301, USA.
include(GrMiscUtils)
-GR_CHECK_HDR_N_DEF(sys/resource.h HAVE_SYS_RESOURCE_H)
+gr_check_hdr_n_def(sys/resource.h HAVE_SYS_RESOURCE_H)
########################################################################
# Handle the generated constants
@@ -35,43 +35,23 @@ string(REPLACE "\\" "\\\\" prefix "${prefix}")
string(REPLACE "\\" "\\\\" SYSCONFDIR "${SYSCONFDIR}")
string(REPLACE "\\" "\\\\" GR_PREFSDIR "${GR_PREFSDIR}")
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in
- ${CMAKE_CURRENT_BINARY_DIR}/constants.cc
- ESCAPE_QUOTES
-@ONLY)
-
-list(APPEND gnuradio_runtime_sources ${CMAKE_CURRENT_BINARY_DIR}/constants.cc)
-
-########################################################################
-# Setup the include and linker paths
-########################################################################
-include_directories(${GNURADIO_RUNTIME_INCLUDE_DIRS}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${VOLK_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS}
- ${MPLIB_INCLUDE_DIRS}
-)
-if(ENABLE_CTRLPORT_THRIFT)
- list(APPEND include_directories
- ${THRIFT_INCLUDE_DIRS}
- )
-endif(ENABLE_CTRLPORT_THRIFT)
-
-########################################################################
+#########################################################################
# Include subdirs rather to populate to the sources lists.
########################################################################
add_subdirectory(pmt)
-GR_INCLUDE_SUBDIRECTORY(messages)
-GR_INCLUDE_SUBDIRECTORY(thread)
-GR_INCLUDE_SUBDIRECTORY(math)
-GR_INCLUDE_SUBDIRECTORY(controlport)
########################################################################
# Setup library
########################################################################
-list(APPEND gnuradio_runtime_sources
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/constants.cc
+ ESCAPE_QUOTES
+ @ONLY)
+
+add_library(gnuradio-runtime
+ ${CMAKE_CURRENT_BINARY_DIR}/constants.cc
basic_block.cc
block.cc
block_detail.cc
@@ -117,28 +97,145 @@ list(APPEND gnuradio_runtime_sources
vmcircbuf_mmap_tmpfile.cc
vmcircbuf_prefs.cc
vmcircbuf_sysv_shm.cc
- ${gnuradio_ctrlport_sources}
+ )
+
+# Messages
+target_sources(gnuradio-runtime PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/messages/msg_accepter.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/messages/msg_accepter_msgq.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/messages/msg_producer.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/messages/msg_queue.cc
+ )
+
+# Thread
+target_sources(gnuradio-runtime PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/thread/thread.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/thread/thread_body_wrapper.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/thread/thread_group.cc
+ )
+
+# Math
+target_sources(gnuradio-runtime PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/math/fast_atan2f.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/math/fxpt.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/math/random.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/math/sincos.cc
+ )
+
+# Controlport
+if(ENABLE_GR_CTRLPORT)
+
+# Keep track of the number of backends ControlPort supports
+SET(CTRLPORT_BACKENDS 0)
+
+target_sources(gnuradio-runtime PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/rpcmanager.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/rpcserver_aggregator.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/rpcserver_booter_aggregator.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/rpcserver_selector.cc
)
-list(APPEND gnuradio_runtime_libs
- gnuradio-pmt
- ${VOLK_LIBRARIES}
- ${Boost_LIBRARIES}
- ${LOG4CPP_LIBRARIES}
- ${MPLIB_LIBRARIES}
+OPTION(ENABLE_CTRLPORT_THRIFT "Enable ControlPort Thrift support" ON)
+
+if(ENABLE_CTRLPORT_THRIFT)
+# Look if Thrift is installed and use it as a ControlPort backend.
+FIND_PACKAGE(THRIFT)
+
+if(THRIFT_FOUND)
+MATH(EXPR CTRLPORT_BACKENDS "${CTRLPORT_BACKENDS} + 1")
+
+# Indicate thrift as an installed backend in the cmake summary.
+message(STATUS "Found and enabling Thrift backend to ControlPort")
+GR_APPEND_SUBCOMPONENT("thrift")
+
+# Run Thrift To compile C++ and Python files
+message(STATUS "Running thrift to build C++ bindings")
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/controlport/thrift/)
+
+list(APPEND gnuradio_thrift_generated_sources
+ ${CMAKE_CURRENT_BINARY_DIR}/controlport/thrift/gnuradio_types.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/controlport/thrift/gnuradio_constants.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/controlport/thrift/ControlPort.cpp
+ )
+add_custom_command(
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/gnuradio.thrift
+ OUTPUT ${gnuradio_thrift_generated_sources}
+ COMMAND ${THRIFT_BIN} --gen cpp -out ${CMAKE_CURRENT_BINARY_DIR}/controlport/thrift/ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/gnuradio.thrift
+ )
+
+target_include_directories(gnuradio-runtime PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/controlport>)
+
+target_sources(gnuradio-runtime PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/rpcserver_thrift.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/rpcpmtconverters_thrift.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/rpcserver_booter_thrift.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/controlport/thrift/thrift_application_base.cc
+ # add files built by compiling gnuradio.thrift
+ ${gnuradio_thrift_generated_sources}
+ )
+target_link_libraries(gnuradio-runtime PUBLIC
+ Thrift::thrift
+ )
+
+# Add install rule to move example Thrift configuration file into
+# $prefix/etc/gnuradio
+install(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/thrift/thrift.conf.example
+ DESTINATION ${SYSCONFDIR}/${CMAKE_PROJECT_NAME}
+)
+
+endif(THRIFT_FOUND)
+endif(ENABLE_CTRLPORT_THRIFT)
+
+########################################################################
+# Add controlport stuff to gnuradio-runtime
+########################################################################
+
+# Save the number of backends for testing against later
+set(
+ CTRLPORT_BACKENDS ${CTRLPORT_BACKENDS}
+ CACHE INTERNAL "Number of ControlPort backends available"
)
+endif(ENABLE_GR_CTRLPORT)
+
+target_link_libraries(gnuradio-runtime PUBLIC
+ gnuradio-pmt
+ ${GR_VOLK_LIB}
+ Boost::program_options
+ Boost::filesystem
+ Boost::system
+ Boost::regex
+ Boost::thread
+ Log4Cpp::log4cpp
+ MPLib::mplib
+ )
+
+target_include_directories(gnuradio-runtime
+ PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ if(ENABLE_GR_CTRLPORT)
+ target_compile_definitions(gnuradio-runtime PUBLIC GR_CTRLPORT)
+ endif()
+
+
#Add libraries for winsock2.h on Windows
-CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H)
-IF(HAVE_WINDOWS_H)
- ADD_DEFINITIONS(-DHAVE_WINDOWS_H -DUSING_WINSOCK -DWIN32_LEAN_AND_MEAN)
- MESSAGE(STATUS "Adding windows libs to gnuradio runtime libs...")
- LIST(APPEND gnuradio_runtime_libs ws2_32 wsock32)
-ENDIF(HAVE_WINDOWS_H)
+check_include_file_cxx(windows.h HAVE_WINDOWS_H)
+if(HAVE_WINDOWS_H)
+ target_compile_definitions(gnuradio-runtime PUBLIC -DHAVE_WINDOWS_H -DUSING_WINSOCK -DWIN32_LEAN_AND_MEAN)
+ message(STATUS "Adding windows libs to gnuradio runtime libs...")
+ target_link_libraries(gnuradio-runtime PUBLIC ws2_32 wsock32)
+endif(HAVE_WINDOWS_H)
#need to link with librt on ubuntu 11.10 for shm_*
if((LINUX) OR (CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD"))
- list(APPEND gnuradio_runtime_libs rt)
+ target_link_libraries(gnuradio-runtime PUBLIC rt)
endif()
########################################################################
@@ -153,7 +250,7 @@ if(MSVC)
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-runtime.rc
@ONLY)
- list(APPEND gnuradio_runtime_sources
+ target_sources(gnuradio-runtime PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-runtime.rc
)
endif(MSVC)
@@ -170,59 +267,25 @@ endif(MSVC)
########################################################################
if(WIN32)
- OPTION(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" OFF)
+ option(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" OFF)
else(WIN32)
- OPTION(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" ON)
+ option(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" ON)
endif(WIN32)
message(STATUS "TRY_SHM_VMCIRCBUF set to ${TRY_SHM_VMCIRCBUF}.")
if(TRY_SHM_VMCIRCBUF)
- add_definitions( -DTRY_SHM_VMCIRCBUF )
+ target_compile_definitions(gnuradio-runtime PRIVATE -DTRY_SHM_VMCIRCBUF )
endif(TRY_SHM_VMCIRCBUF)
+set(EXTRA_DEPS "")
+if(ENABLE_CTRLPORT_THRIFT)
+ if(THRIFT_FOUND)
+ list(APPEND EXTRA_DEPS THRIFT)
+ endif()
+endif()
+gr_library_foo(gnuradio-runtime ${EXTRA_DEPS})
-#######################################################
-# SHARED LIB BUILD
-#######################################################
-add_library(gnuradio-runtime SHARED ${gnuradio_runtime_sources})
-target_link_libraries(gnuradio-runtime ${gnuradio_runtime_libs})
-GR_LIBRARY_FOO(gnuradio-runtime)
-
-#######################################################
-# STATIC LIB BUILD
-#######################################################
-if(ENABLE_STATIC_LIBS)
- # Remove controlport-specific source files from staticlibs build if
- # ICE is the backend since it does not build statically.
- if(ENABLE_GR_CTRLPORT)
- if(ICE_FOUND)
- list(REMOVE_ITEM gnuradio_runtime_sources
- ${gnuradio_ctrlport_sources}
- )
-
- # Remove GR_CTRLPORT set this target's definitions.
- # Makes sure we don't try to use ControlPort stuff in source files
- GET_DIRECTORY_PROPERTY(STATIC_DEFS COMPILE_DEFINITIONS)
- list(REMOVE_ITEM STATIC_DEFS "GR_CTRLPORT")
- SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS "${STATIC_DEFS}")
-
- # readd it to the target since we removed it from the directory-wide list.
- SET_PROPERTY(TARGET gnuradio-runtime APPEND PROPERTY COMPILE_DEFINITIONS "GR_CTRLPORT")
- endif(ICE_FOUND)
- endif(ENABLE_GR_CTRLPORT)
-
- add_library(gnuradio-runtime_static STATIC ${gnuradio_runtime_sources})
-
- if(NOT WIN32)
- set_target_properties(gnuradio-runtime_static
- PROPERTIES OUTPUT_NAME gnuradio-runtime)
- endif(NOT WIN32)
-
- install(TARGETS gnuradio-runtime_static
- ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
- )
-endif(ENABLE_STATIC_LIBS)
########################################################################
# Setup tests
@@ -241,13 +304,13 @@ if(ENABLE_TESTING)
list(APPEND GR_TEST_TARGET_DEPS gnuradio-runtime gnuradio-pmt)
foreach(qa_file ${test_gnuradio_runtime_sources})
- GR_ADD_CPP_TEST("runtime_${qa_file}"
+ gr_add_cpp_test("runtime_${qa_file}"
${CMAKE_CURRENT_SOURCE_DIR}/${qa_file}
- )
+ )
+
endforeach(qa_file)
# Math tests:
- include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/math)
list(APPEND test_gnuradio_math_sources
qa_fxpt.cc
qa_fxpt_nco.cc
@@ -258,14 +321,18 @@ if(ENABLE_TESTING)
)
foreach(qa_file ${test_gnuradio_math_sources})
- GR_ADD_CPP_TEST("math_${qa_file}"
+ gr_add_cpp_test("math_${qa_file}"
${CMAKE_CURRENT_SOURCE_DIR}/math/${qa_file}
- )
+ )
+ target_include_directories("math_${qa_file}"
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/math
+ )
endforeach(qa_file)
# PMT tests:
- include_directories(${CMAKE_CURRENT_BINARY_DIR}/pmt)
- GR_ADD_CPP_TEST("pmt_prims" ${CMAKE_CURRENT_SOURCE_DIR}/pmt/qa_pmt_prims.cc)
- GR_ADD_CPP_TEST("pmt_unv" ${CMAKE_CURRENT_SOURCE_DIR}/pmt/qa_pmt_unv.cc)
+ gr_add_cpp_test("pmt_prims" ${CMAKE_CURRENT_SOURCE_DIR}/pmt/qa_pmt_prims.cc)
+ gr_add_cpp_test("pmt_unv" ${CMAKE_CURRENT_SOURCE_DIR}/pmt/qa_pmt_unv.cc)
+ target_include_directories("pmt_prims" PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/pmt)
+ target_include_directories("pmt_unv" PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/pmt)
endif(ENABLE_TESTING)
diff --git a/gnuradio-runtime/lib/controlport/CMakeLists.txt b/gnuradio-runtime/lib/controlport/CMakeLists.txt
deleted file mode 100644
index 0aa8539742..0000000000
--- a/gnuradio-runtime/lib/controlport/CMakeLists.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 2013 Free Software Foundation, Inc.
-#
-# 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.
-
-if(ENABLE_GR_CTRLPORT)
-
-# Keep track of the number of backends ControlPort supports
-SET(CTRLPORT_BACKENDS 0)
-
-# Add definition so we can compile in ControlPort to the blocks.
-add_definitions(-DGR_CTRLPORT)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
-list(APPEND gnuradio_ctrlport_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/rpcmanager.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/rpcserver_aggregator.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/rpcserver_booter_aggregator.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/rpcserver_selector.cc
-)
-
-
-OPTION(ENABLE_CTRLPORT_THRIFT "Enable ControlPort Thrift support" ON)
-
-if(ENABLE_CTRLPORT_THRIFT)
-
-# Look if Thrift is installed and use it as a ControlPort backend.
-FIND_PACKAGE(Thrift)
-
-if(THRIFT_FOUND)
-
-include_directories(${THRIFT_INCLUDE_DIRS})
-MATH(EXPR CTRLPORT_BACKENDS "${CTRLPORT_BACKENDS} + 1")
-
-# Indicate thrift as an installed backend in the cmake summary.
-message(STATUS "Found and enabling Thrift backend to ControlPort")
-GR_APPEND_SUBCOMPONENT("thrift")
-
-# Run Thrift To compile C++ and Python files
-message(STATUS "Running thrift to build C++ bindings")
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
-
-list(APPEND gnuradio_thrift_generated_sources
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_types.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/gnuradio_constants.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/thrift/ControlPort.cpp
- )
-add_custom_command(
- DEPENDS ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
- OUTPUT ${gnuradio_thrift_generated_sources}
- COMMAND ${THRIFT_BIN} --gen cpp -out ${CMAKE_CURRENT_BINARY_DIR}/thrift/ ${CMAKE_CURRENT_SOURCE_DIR}/thrift/gnuradio.thrift
- )
-list(APPEND gnuradio_ctrlport_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcserver_thrift.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcpmtconverters_thrift.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/rpcserver_booter_thrift.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/thrift/thrift_application_base.cc
- # add files built by compiling gnuradio.thrift
- ${gnuradio_thrift_generated_sources}
- )
-
-# Add required libraries here
-list(APPEND gnuradio_runtime_libs
- ${THRIFT_LIBRARIES}
-)
-
-# Add install rule to move example Thrift configuration file into
-# $prefix/etc/gnuradio
-install(
- FILES ${CMAKE_CURRENT_SOURCE_DIR}/thrift/thrift.conf.example
- DESTINATION ${SYSCONFDIR}/${CMAKE_PROJECT_NAME}
-)
-
-endif(THRIFT_FOUND)
-endif(ENABLE_CTRLPORT_THRIFT)
-
-########################################################################
-# Add controlport stuff to gnuradio-runtime
-########################################################################
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-# Save the number of backends for testing against later
-set(
- CTRLPORT_BACKENDS ${CTRLPORT_BACKENDS}
- CACHE INTERNAL "Number of ControlPort backends available"
-)
-
-endif(ENABLE_GR_CTRLPORT)
diff --git a/gnuradio-runtime/lib/math/CMakeLists.txt b/gnuradio-runtime/lib/math/CMakeLists.txt
deleted file mode 100644
index c95c84cecb..0000000000
--- a/gnuradio-runtime/lib/math/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2010,2013 Free Software Foundation, Inc.
-#
-# 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.
-
-########################################################################
-# This file included, use CMake directory variables
-########################################################################
-
-list(APPEND gnuradio_runtime_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/fast_atan2f.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/fxpt.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/random.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/sincos.cc
-)
diff --git a/gnuradio-runtime/lib/messages/CMakeLists.txt b/gnuradio-runtime/lib/messages/CMakeLists.txt
deleted file mode 100644
index 20d4f30b06..0000000000
--- a/gnuradio-runtime/lib/messages/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2010,2013 Free Software Foundation, Inc.
-#
-# 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.
-
-########################################################################
-# This file included, use CMake directory variables
-########################################################################
-
-list(APPEND gnuradio_runtime_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/msg_accepter.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/msg_accepter_msgq.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/msg_producer.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/msg_queue.cc
-)
diff --git a/gnuradio-runtime/lib/pmt/CMakeLists.txt b/gnuradio-runtime/lib/pmt/CMakeLists.txt
index 132060166d..c46227e765 100644
--- a/gnuradio-runtime/lib/pmt/CMakeLists.txt
+++ b/gnuradio-runtime/lib/pmt/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Free Software Foundation, Inc.
+# Copyright 2010-2013,2018-2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -17,13 +17,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-########################################################################
-# This file included, use CMake directory variables
-########################################################################
-include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-
-set(pmt_sources
+add_library(gnuradio-pmt
${CMAKE_CURRENT_SOURCE_DIR}/pmt_unv.cc
${CMAKE_CURRENT_SOURCE_DIR}/pmt.cc
${CMAKE_CURRENT_SOURCE_DIR}/pmt_io.cc
@@ -31,11 +25,19 @@ set(pmt_sources
${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc
)
-list(APPEND gnuradio_pmt_libs
- ${Boost_LIBRARIES}
- ${LOG4CPP_LIBRARIES}
+target_link_libraries(gnuradio-pmt
+ Boost::boost
+ Log4Cpp::log4cpp
)
+target_include_directories(gnuradio-pmt
+ PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/
+ )
+
+
#Add Windows DLL resource file if using MSVC
if(MSVC)
include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake)
@@ -45,28 +47,11 @@ if(MSVC)
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pmt.rc
@ONLY)
- list(APPEND gr_pmt_sources
+ target_sources(gnuradio-pmt PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-pmt.rc
)
endif(MSVC)
-
-add_library(gnuradio-pmt SHARED ${pmt_sources})
-target_link_libraries(gnuradio-pmt ${gnuradio_pmt_libs})
-
-GR_LIBRARY_FOO(gnuradio-pmt)
-
-if(ENABLE_STATIC_LIBS)
- add_library(gnuradio-pmt_static STATIC ${pmt_sources})
-
- add_dependencies(gnuradio-pmt_static)
-
- if(NOT WIN32)
- set_target_properties(gnuradio-pmt_static
- PROPERTIES OUTPUT_NAME gnuradio-pmt)
- endif(NOT WIN32)
-
- install(TARGETS gnuradio-pmt_static
- ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
- )
-endif(ENABLE_STATIC_LIBS)
+if(BUILD_SHARED_LIBS)
+ GR_LIBRARY_FOO(gnuradio-pmt)
+endif()
diff --git a/gnuradio-runtime/lib/thread/CMakeLists.txt b/gnuradio-runtime/lib/thread/CMakeLists.txt
deleted file mode 100644
index de46dd8932..0000000000
--- a/gnuradio-runtime/lib/thread/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2010,2013 Free Software Foundation, Inc.
-#
-# 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.
-
-########################################################################
-# This file included, use CMake directory variables
-########################################################################
-
-list(APPEND gnuradio_runtime_sources
- ${CMAKE_CURRENT_SOURCE_DIR}/thread.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/thread_body_wrapper.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/thread_group.cc
-)