commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/03: build: better support for static lib


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/03: build: better support for static libs.
Date: Fri, 18 Jul 2014 20:10:47 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit d1745250133ea6e14b426f8f0c1659a8a0916797
Author: Tom Rondeau <address@hidden>
Date:   Fri Jul 18 12:24:38 2014 -0400

    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.
---
 CMakeLists.txt                                  |  3 +++
 gnuradio-runtime/CMakeLists.txt                 |  8 -------
 gnuradio-runtime/lib/CMakeLists.txt             | 31 +++++++++++++++++++++----
 gnuradio-runtime/lib/block.cc                   |  1 -
 gnuradio-runtime/lib/controlport/CMakeLists.txt |  2 +-
 gr-analog/lib/CMakeLists.txt                    | 12 ++++++++++
 gr-atsc/lib/CMakeLists.txt                      | 12 ++++++++++
 gr-audio/lib/CMakeLists.txt                     | 12 ++++++++++
 gr-blocks/lib/CMakeLists.txt                    | 23 +++++++++++++++++-
 gr-channels/lib/CMakeLists.txt                  | 12 ++++++++++
 gr-comedi/lib/CMakeLists.txt                    | 12 ++++++++++
 gr-digital/lib/CMakeLists.txt                   | 12 ++++++++++
 gr-fec/lib/CMakeLists.txt                       | 12 ++++++++++
 gr-fft/lib/CMakeLists.txt                       | 12 ++++++++++
 gr-filter/lib/CMakeLists.txt                    | 12 ++++++++++
 gr-noaa/lib/CMakeLists.txt                      | 12 ++++++++++
 gr-pager/lib/CMakeLists.txt                     | 12 ++++++++++
 gr-qtgui/lib/CMakeLists.txt                     | 12 ++++++++++
 gr-trellis/lib/CMakeLists.txt                   | 12 ++++++++++
 gr-video-sdl/lib/CMakeLists.txt                 | 12 ++++++++++
 gr-vocoder/lib/CMakeLists.txt                   | 12 ++++++++++
 gr-wavelet/lib/CMakeLists.txt                   | 12 ++++++++++
 gr-wxgui/lib/CMakeLists.txt                     | 12 ++++++++++
 gr-zeromq/lib/CMakeLists.txt                    | 12 ++++++++++
 24 files changed, 269 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c94116e..145fb9a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,6 +171,9 @@ else(ENABLE_PERFORMANCE_COUNTERS)
   message(STATUS "NO PERF COUNTERS")
 endif(ENABLE_PERFORMANCE_COUNTERS)
 
+OPTION(ENABLE_STATIC_LIBS "Enable building of static libraries" OFF)
+message(STATUS "Building Static Libraries: ${ENABLE_STATIC_LIBS}")
+
 ########################################################################
 # Variables replaced when configuring the package config files
 ########################################################################
diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt
index 75410ab..6451919 100644
--- a/gnuradio-runtime/CMakeLists.txt
+++ b/gnuradio-runtime/CMakeLists.txt
@@ -60,13 +60,6 @@ GR_SET_GLOBAL(GNURADIO_RUNTIME_PYTHONPATH 
${GNURADIO_RUNTIME_PYTHONPATH})
 # Register controlport component
 ########################################################################
 
-if(ENABLE_STATIC_LIBS)
-  set(NOT_STATIC_LIBS False)
-  message(STATUS "ControlPort is incompatible with static library builds. 
Disabling.")
-else(ENABLE_STATIC_LIBS)
-  set(NOT_STATIC_LIBS True)
-endif(ENABLE_STATIC_LIBS)
-
 FIND_PACKAGE(ICE-3.5)  # check for ICE 3.5
 if(NOT ICE_FOUND)
   message(STATUS "ICE 3.5 not found. Looking for 3.4")
@@ -90,7 +83,6 @@ GR_REGISTER_COMPONENT("gr-ctrlport" ENABLE_GR_CTRLPORT
   SWIG_VERSION_CHECK
   ICE_FOUND
   ENABLE_GNURADIO_RUNTIME
-  NOT_STATIC_LIBS
 )
 
 ########################################################################
diff --git a/gnuradio-runtime/lib/CMakeLists.txt 
b/gnuradio-runtime/lib/CMakeLists.txt
index a3f0d4c..85a091d 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -64,6 +64,7 @@ add_subdirectory(pmt)
 GR_INCLUDE_SUBDIRECTORY(messages)
 GR_INCLUDE_SUBDIRECTORY(thread)
 GR_INCLUDE_SUBDIRECTORY(math)
+GR_INCLUDE_SUBDIRECTORY(controlport)
 
 ########################################################################
 # Setup library
@@ -118,6 +119,7 @@ list(APPEND gnuradio_runtime_sources
   vmcircbuf_mmap_tmpfile.cc
   vmcircbuf_prefs.cc
   vmcircbuf_sysv_shm.cc
+  ${gnuradio_ctrlport_sources}
 )
 
 # PowerPC workaround for posix_memalign
@@ -148,8 +150,6 @@ if(LINUX)
     list(APPEND gnuradio_runtime_libs rt)
 endif()
 
-GR_INCLUDE_SUBDIRECTORY(controlport)
-
 ########################################################################
 # Add DLL resource file when using MSVC
 ########################################################################
@@ -190,6 +190,10 @@ if(TRY_SHM_VMCIRCBUF)
     add_definitions( -DTRY_SHM_VMCIRCBUF )
 endif(TRY_SHM_VMCIRCBUF)
 
+
+#######################################################
+# SHARED LIB BUILD
+#######################################################
 add_library(gnuradio-runtime SHARED ${gnuradio_runtime_sources})
 target_link_libraries(gnuradio-runtime ${gnuradio_runtime_libs})
 GR_LIBRARY_FOO(gnuradio-runtime RUNTIME_COMPONENT "runtime_runtime" 
DEVEL_COMPONENT "runtime_devel")
@@ -198,10 +202,29 @@ add_dependencies(gnuradio-runtime
   pmt_generated runtime_generated_includes
 )
 
+
+#######################################################
+# STATIC LIB BUILD
+#######################################################
 if(ENABLE_STATIC_LIBS)
-  add_library(gnuradio-runtime_static STATIC ${gnuradio_runtime_sources})
+  # Remove controlport-specific source files from staticlibs build
+  if(ENABLE_GR_CTRLPORT)
+    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
+    # 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-runtime APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
 
-  add_dependencies(gnuradio-runtime_static gnuradio_runtime)
+  add_library(gnuradio-runtime_static STATIC ${gnuradio_runtime_sources})
 
   if(NOT WIN32)
     set_target_properties(gnuradio-runtime_static
diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc
index b5bfbda..8906d98 100644
--- a/gnuradio-runtime/lib/block.cc
+++ b/gnuradio-runtime/lib/block.cc
@@ -29,7 +29,6 @@
 #include <gnuradio/block_detail.h>
 #include <gnuradio/buffer.h>
 #include <gnuradio/prefs.h>
-#include <gnuradio/config.h>
 #include <stdexcept>
 #include <iostream>
 
diff --git a/gnuradio-runtime/lib/controlport/CMakeLists.txt 
b/gnuradio-runtime/lib/controlport/CMakeLists.txt
index bd46659..e0d319b 100644
--- a/gnuradio-runtime/lib/controlport/CMakeLists.txt
+++ b/gnuradio-runtime/lib/controlport/CMakeLists.txt
@@ -33,7 +33,7 @@ EXECUTE_PROCESS(
        "${CMAKE_CURRENT_SOURCE_DIR}/gnuradio.ice"
    )
 
-list(APPEND gnuradio_runtime_sources
+list(APPEND gnuradio_ctrlport_sources
   ${CMAKE_CURRENT_SOURCE_DIR}/ice_application_base.cc
   ${CMAKE_CURRENT_SOURCE_DIR}/rpcmanager.cc
   ${CMAKE_CURRENT_SOURCE_DIR}/rpcpmtconverters_ice.cc
diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt
index 34a852f..4512331 100644
--- a/gr-analog/lib/CMakeLists.txt
+++ b/gr-analog/lib/CMakeLists.txt
@@ -170,6 +170,18 @@ GR_LIBRARY_FOO(gnuradio-analog RUNTIME_COMPONENT 
"analog_runtime" DEVEL_COMPONEN
 add_dependencies(gnuradio-analog analog_generated_includes 
analog_generated_swigs gnuradio-filter)
 
 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-analog APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-analog_static STATIC ${analog_sources})
 
   add_dependencies(gnuradio-analog_static
diff --git a/gr-atsc/lib/CMakeLists.txt b/gr-atsc/lib/CMakeLists.txt
index 5ac14fa..88bb56d 100644
--- a/gr-atsc/lib/CMakeLists.txt
+++ b/gr-atsc/lib/CMakeLists.txt
@@ -128,6 +128,18 @@ target_link_libraries(gnuradio-atsc ${atsc_libs})
 GR_LIBRARY_FOO(gnuradio-atsc RUNTIME_COMPONENT "atsc_runtime" DEVEL_COMPONENT 
"atsc_devel")
 
 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-atsc APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-atsc_static STATIC ${gr_atsc_sources})
 
   if(NOT WIN32)
diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt
index 2ae7c41..d50e547 100644
--- a/gr-audio/lib/CMakeLists.txt
+++ b/gr-audio/lib/CMakeLists.txt
@@ -187,6 +187,18 @@ GR_LIBRARY_FOO(gnuradio-audio RUNTIME_COMPONENT 
"audio_runtime" DEVEL_COMPONENT
 install(FILES ${gr_audio_confs} DESTINATION ${GR_PREFSDIR} COMPONENT 
"audio_runtime")
 
 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-audio APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-audio_static STATIC ${gr_audio_sources})
 
   if(NOT WIN32)
diff --git a/gr-blocks/lib/CMakeLists.txt b/gr-blocks/lib/CMakeLists.txt
index 7702e4b..1b0227c 100644
--- a/gr-blocks/lib/CMakeLists.txt
+++ b/gr-blocks/lib/CMakeLists.txt
@@ -265,7 +265,7 @@ list(APPEND gr_blocks_sources
 )
 
 if(ENABLE_GR_CTRLPORT)
-list(APPEND gr_blocks_sources
+list(APPEND blocks_ctrlport_sources
   ctrlport_probe_c_impl.cc
   ctrlport_probe2_c_impl.cc
   ctrlport_probe2_f_impl.cc
@@ -273,6 +273,10 @@ list(APPEND gr_blocks_sources
   ctrlport_probe2_i_impl.cc
   ctrlport_probe2_b_impl.cc
 )
+
+list(APPEND gr_blocks_sources
+  ${blocks_ctrlport_sources}
+)
 endif(ENABLE_GR_CTRLPORT)
 
 #Add Windows DLL resource file if using MSVC
@@ -304,6 +308,23 @@ target_link_libraries(gnuradio-blocks ${blocks_libs})
 GR_LIBRARY_FOO(gnuradio-blocks RUNTIME_COMPONENT "blocks_runtime" 
DEVEL_COMPONENT "blocks_devel")
 
 if(ENABLE_STATIC_LIBS)
+  # Remove controlport-specific source files from staticlibs build
+  if(ENABLE_GR_CTRLPORT)
+    list(REMOVE_ITEM gr_blocks_sources
+      ${blocks_ctrlport_sources}
+      )
+
+    # 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-blocks APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-blocks_static STATIC ${gr_blocks_sources})
 
   add_dependencies(gnuradio-blocks_static blocks_generated_includes)
diff --git a/gr-channels/lib/CMakeLists.txt b/gr-channels/lib/CMakeLists.txt
index c74e338..525e41a 100644
--- a/gr-channels/lib/CMakeLists.txt
+++ b/gr-channels/lib/CMakeLists.txt
@@ -83,6 +83,18 @@ add_dependencies(gnuradio-channels
   gnuradio-runtime gnuradio-filter gnuradio-analog gnuradio-blocks)
 
 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-channels APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-channels_static STATIC ${channels_sources})
 
   add_dependencies(gnuradio-channels_static
diff --git a/gr-comedi/lib/CMakeLists.txt b/gr-comedi/lib/CMakeLists.txt
index 206ddb3..c886778 100644
--- a/gr-comedi/lib/CMakeLists.txt
+++ b/gr-comedi/lib/CMakeLists.txt
@@ -58,6 +58,18 @@ target_link_libraries(gnuradio-comedi ${comedi_libs})
 GR_LIBRARY_FOO(gnuradio-comedi RUNTIME_COMPONENT "comedi_runtime" 
DEVEL_COMPONENT "comedi_devel")
 
 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-comedi APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-comedi_static STATIC ${comedi_sources})
 
   if(NOT WIN32)
diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt
index 4ba821a..7f9448f 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
diff --git a/gr-fec/lib/CMakeLists.txt b/gr-fec/lib/CMakeLists.txt
index 8af27db..201505e 100644
--- a/gr-fec/lib/CMakeLists.txt
+++ b/gr-fec/lib/CMakeLists.txt
@@ -102,6 +102,18 @@ target_link_libraries(gnuradio-fec ${gnuradio_fec_libs})
 GR_LIBRARY_FOO(gnuradio-fec RUNTIME_COMPONENT "fec_runtime" DEVEL_COMPONENT 
"fec_devel")
 
 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-fec APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-fec_static STATIC ${gnuradio_fec_sources})
 
   if(NOT WIN32)
diff --git a/gr-fft/lib/CMakeLists.txt b/gr-fft/lib/CMakeLists.txt
index 51fecbe..df74e1c 100644
--- a/gr-fft/lib/CMakeLists.txt
+++ b/gr-fft/lib/CMakeLists.txt
@@ -85,6 +85,18 @@ target_link_libraries(gnuradio-fft ${fft_libs})
 GR_LIBRARY_FOO(gnuradio-fft RUNTIME_COMPONENT "fft_runtime" DEVEL_COMPONENT 
"fft_devel")
 
 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-fft APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-fft_static STATIC ${fft_sources})
 
   if(NOT WIN32)
diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt
index 17867f8..75e4032 100644
--- a/gr-filter/lib/CMakeLists.txt
+++ b/gr-filter/lib/CMakeLists.txt
@@ -186,6 +186,18 @@ add_dependencies(gnuradio-filter
   gnuradio-runtime gnuradio-fft)
 
 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-filter APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-filter_static STATIC ${filter_sources})
 
   add_dependencies(gnuradio-filter_static
diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt
index 49310ec..16c3585 100644
--- a/gr-noaa/lib/CMakeLists.txt
+++ b/gr-noaa/lib/CMakeLists.txt
@@ -69,6 +69,18 @@ target_link_libraries(gnuradio-noaa ${noaa_libs})
 GR_LIBRARY_FOO(gnuradio-noaa RUNTIME_COMPONENT "noaa_runtime" DEVEL_COMPONENT 
"noaa_devel")
 
 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-noaa APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-noaa_static STATIC ${noaa_sources})
 
   if(NOT WIN32)
diff --git a/gr-pager/lib/CMakeLists.txt b/gr-pager/lib/CMakeLists.txt
index 7fae2c9..fd21935 100644
--- a/gr-pager/lib/CMakeLists.txt
+++ b/gr-pager/lib/CMakeLists.txt
@@ -77,6 +77,18 @@ target_link_libraries(gnuradio-pager ${pager_libs})
 GR_LIBRARY_FOO(gnuradio-pager RUNTIME_COMPONENT "pager_runtime" 
DEVEL_COMPONENT "pager_devel")
 
 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-pager APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-pager_static STATIC ${pager_sources})
 
   if(NOT WIN32)
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt
index 2dc73a9..a5f8d6d 100644
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -165,6 +165,18 @@ target_link_libraries(gnuradio-qtgui ${qtgui_libs})
 GR_LIBRARY_FOO(gnuradio-qtgui RUNTIME_COMPONENT "qtgui_runtime" 
DEVEL_COMPONENT "qtgui_devel")
 
 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-qtgui APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-qtgui_static STATIC ${qtgui_sources})
 
   if(NOT WIN32)
diff --git a/gr-trellis/lib/CMakeLists.txt b/gr-trellis/lib/CMakeLists.txt
index 67a339d..0bb400b 100644
--- a/gr-trellis/lib/CMakeLists.txt
+++ b/gr-trellis/lib/CMakeLists.txt
@@ -156,6 +156,18 @@ add_dependencies(gnuradio-trellis
   gnuradio-runtime gnuradio-digital)
 
 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-trellis APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-trellis_static STATIC ${trellis_sources})
 
   add_dependencies(gnuradio-trellis_static
diff --git a/gr-video-sdl/lib/CMakeLists.txt b/gr-video-sdl/lib/CMakeLists.txt
index 8c992f9..e935cfc 100644
--- a/gr-video-sdl/lib/CMakeLists.txt
+++ b/gr-video-sdl/lib/CMakeLists.txt
@@ -70,6 +70,18 @@ GR_LIBRARY_FOO(gnuradio-video-sdl RUNTIME_COMPONENT 
"video_sdl_runtime" DEVEL_CO
 add_dependencies(gnuradio-video-sdl gnuradio-runtime)
 
 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-video-sdl APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-video-sdl_static STATIC ${video_sdl_sources})
 
   add_dependencies(gnuradio-video-sdl_static gnuradio-runtime_static)
diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt
index 61c973b..716e911 100644
--- a/gr-vocoder/lib/CMakeLists.txt
+++ b/gr-vocoder/lib/CMakeLists.txt
@@ -163,6 +163,18 @@ target_link_libraries(gnuradio-vocoder ${vocoder_libs})
 GR_LIBRARY_FOO(gnuradio-vocoder RUNTIME_COMPONENT "vocoder_runtime" 
DEVEL_COMPONENT "vocoder_devel")
 
 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-vocoder APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-vocoder_static STATIC ${gr_vocoder_sources})
 
   if(NOT WIN32)
diff --git a/gr-wavelet/lib/CMakeLists.txt b/gr-wavelet/lib/CMakeLists.txt
index 99c32aa..8d72b85 100644
--- a/gr-wavelet/lib/CMakeLists.txt
+++ b/gr-wavelet/lib/CMakeLists.txt
@@ -93,6 +93,18 @@ add_dependencies(gnuradio-wavelet
   gnuradio-runtime)
 
 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-wavelet APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-wavelet_static STATIC ${gr_wavelet_sources})
 
   add_dependencies(gnuradio-wavelet_static wavelet_generated_includes
diff --git a/gr-wxgui/lib/CMakeLists.txt b/gr-wxgui/lib/CMakeLists.txt
index 02b2e94..f216d7d 100644
--- a/gr-wxgui/lib/CMakeLists.txt
+++ b/gr-wxgui/lib/CMakeLists.txt
@@ -77,6 +77,18 @@ GR_LIBRARY_FOO(gnuradio-wxgui
   DEVEL_COMPONENT "wxgui_devel")
 
 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-wxgui APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-wxgui_static STATIC ${gr_wxgui_sources})
 
   if(NOT WIN32)
diff --git a/gr-zeromq/lib/CMakeLists.txt b/gr-zeromq/lib/CMakeLists.txt
index 07ac36b..549aeab 100644
--- a/gr-zeromq/lib/CMakeLists.txt
+++ b/gr-zeromq/lib/CMakeLists.txt
@@ -71,6 +71,18 @@ target_link_libraries(gnuradio-zeromq ${zeromq_libs})
 GR_LIBRARY_FOO(gnuradio-zeromq RUNTIME_COMPONENT "zeromq_runtime" 
DEVEL_COMPONENT "zeromq_devel")
 
 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-zeromq APPEND PROPERTY COMPILE_DEFINITIONS 
"GR_CTRLPORT")
+  endif(ENABLE_GR_CTRLPORT)
+
   add_library(gnuradio-zeromq_static STATIC ${zeromq_sources})
 
   if(NOT WIN32)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]