From d1745250133ea6e14b426f8f0c1659a8a0916797 Mon Sep 17 00:00:00 2001 From: Tom Rondeau <tom@trondeau.com> Date: Fri, 18 Jul 2014 12:24:38 -0400 Subject: build: better support for static libs. Now builds shared libraries with ControlPort (if ControlPort is enableed). Static libs still without ControlPort. Added proper Option and output message in cmake for Static Libs on/off. --- gr-digital/lib/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gr-digital/lib/CMakeLists.txt') diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt index 4ba821a307..7f9448f8e7 100644 --- a/gr-digital/lib/CMakeLists.txt +++ b/gr-digital/lib/CMakeLists.txt @@ -219,6 +219,18 @@ add_dependencies( ) if(ENABLE_STATIC_LIBS) + if(ENABLE_GR_CTRLPORT) + # Remove GR_CTRLPORT set this target's definitions. + # Makes sure we don't try to use ControlPort stuff in source files + # since Ice will not work with static libs. + 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-digital APPEND PROPERTY COMPILE_DEFINITIONS "GR_CTRLPORT") + endif(ENABLE_GR_CTRLPORT) + add_library(gnuradio-digital_static STATIC ${digital_sources}) add_dependencies(gnuradio-digital_static -- cgit v1.2.3