commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 01/02: gnuradio-config-info: Added --enable


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/02: gnuradio-config-info: Added --enabled-components
Date: Wed, 21 Jan 2015 18:26:47 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit ae7fe683f042c5c3b519238a15b44ea3104727f5
Author: Marcus Müller <address@hidden>
Date:   Sat Jan 17 13:29:44 2015 +0100

    gnuradio-config-info: Added --enabled-components
    
    Since this should reflect the CMake enabled components,
    this entailed generating constants.cc after CMake has been run.
    Since the autonomity of the gnuradio-runtime/CMakeLists.txt shouldn't
    be reduced, this is done twice; the build-time overhead is minimal.
---
 CMakeLists.txt                                |  7 +++++++
 gnuradio-runtime/apps/gnuradio-config-info.cc | 24 +++++++++++++++---------
 gnuradio-runtime/include/gnuradio/constants.h |  5 +++++
 gnuradio-runtime/lib/CMakeLists.txt           |  1 +
 gnuradio-runtime/lib/constants.cc.in          |  5 +++++
 5 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 235596b..d84fa04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -416,6 +416,13 @@ CONFIGURE_FILE(
   ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-runtime/include/gnuradio/config.h
 )
 
+#Re-generate the constants file, now that we actually know which components 
will be enabled.
+configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-runtime/lib/constants.cc.in
+    ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-runtime/lib/constants.cc
+    ESCAPE_QUOTES
address@hidden)
+
 # Install config.h in include/gnuradio
 install(
     FILES
diff --git a/gnuradio-runtime/apps/gnuradio-config-info.cc 
b/gnuradio-runtime/apps/gnuradio-config-info.cc
index bccf99f..c91b080 100644
--- a/gnuradio-runtime/apps/gnuradio-config-info.cc
+++ b/gnuradio-runtime/apps/gnuradio-config-info.cc
@@ -26,26 +26,29 @@
 
 #include <gnuradio/constants.h>
 #include <boost/program_options.hpp>
+#include <boost/format.hpp>
 #include <iostream>
 
 namespace po = boost::program_options;
+using boost::format;
 
 int
 main(int argc, char **argv)
 {
-  po::options_description desc("Program options: gnuradio [options]");
+  po::options_description desc((format("Program options: %1% [options]") % 
argv[0]).str());
   po::variables_map vm;
 
   desc.add_options()
     ("help,h", "print help message")
-    ("prefix", "print gnuradio installation prefix")
-    ("sysconfdir", "print gnuradio system configuration directory")
-    ("prefsdir", "print gnuradio preferences directory")
-    ("builddate", "print gnuradio build date (RFC2822 format)")
-    ("cc", "print gnuradio C compiler version")
-    ("cxx", "print gnuradio C++ compiler version")
-    ("cflags", "print gnuradio CFLAGS")
-    ("version,v", "print gnuradio version")
+    ("prefix", "print GNU Radio installation prefix")
+    ("sysconfdir", "print GNU Radio system configuration directory")
+    ("prefsdir", "print GNU Radio preferences directory")
+    ("builddate", "print GNU Radio build date (RFC2822 format)")
+    ("enabled-components", "print GNU Radio build time enabled components")
+    ("cc", "print GNU Radio C compiler version")
+    ("cxx", "print GNU Radio C++ compiler version")
+    ("cflags", "print GNU Radio CFLAGS")
+    ("version,v", "print GNU Radio version")
     ;
 
   try {
@@ -75,6 +78,9 @@ main(int argc, char **argv)
   if(vm.count("builddate"))
     std::cout << gr::build_date() << std::endl;
 
+  if(vm.count("enabled-components"))
+    std::cout << gr::build_time_enabled_components() << std::endl;
+
   if(vm.count("version"))
     std::cout << gr::version() << std::endl;
 
diff --git a/gnuradio-runtime/include/gnuradio/constants.h 
b/gnuradio-runtime/include/gnuradio/constants.h
index 416f039..95aa80b 100644
--- a/gnuradio-runtime/include/gnuradio/constants.h
+++ b/gnuradio-runtime/include/gnuradio/constants.h
@@ -83,6 +83,11 @@ namespace gr {
    */
   GR_RUNTIME_API const std::string  compiler_flags();
 
+  /*!
+   * \brief return build-time enabled components
+   */
+  GR_RUNTIME_API const std::string  build_time_enabled_components();
+
 } /* namespace gr */
 
 #endif /* INCLUDED_GR_CONSTANTS_H */
diff --git a/gnuradio-runtime/lib/CMakeLists.txt 
b/gnuradio-runtime/lib/CMakeLists.txt
index 891f6d3..cdbb2b7 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -38,6 +38,7 @@ 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)
diff --git a/gnuradio-runtime/lib/constants.cc.in 
b/gnuradio-runtime/lib/constants.cc.in
index 9ba34e3..516e2f8 100644
--- a/gnuradio-runtime/lib/constants.cc.in
+++ b/gnuradio-runtime/lib/constants.cc.in
@@ -95,4 +95,9 @@ namespace gr {
     return "@COMPILER_INFO@";
   }
 
+  const std::string
+  build_time_enabled_components()
+  {
+    return "@_gr_enabled_components@";
+  }
 } /* namespace gr */



reply via email to

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