diff options
author | michael-west <michael.west@ettus.com> | 2019-09-24 17:31:51 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-10-15 15:21:52 -0700 |
commit | 1004eef88e1a695cc0a2f3002bd8aa8b5d22e0e8 (patch) | |
tree | b465531610ef0d8cd99a7b88f9bf375661e562f6 | |
parent | c2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06 (diff) | |
download | uhd-1004eef88e1a695cc0a2f3002bd8aa8b5d22e0e8.tar.gz uhd-1004eef88e1a695cc0a2f3002bd8aa8b5d22e0e8.tar.bz2 uhd-1004eef88e1a695cc0a2f3002bd8aa8b5d22e0e8.zip |
cmake: Add UHD_COMPONENT variable
Added cmake variable to set the component (currently UHD or MPM).
so the banner printed by the log_resource would reference the correct
component. Added accessor function and appropriate calls in log.cpp.
Signed-off-by: michael-west <michael.west@ettus.com>
-rw-r--r-- | host/cmake/Modules/UHDVersion.cmake | 2 | ||||
-rw-r--r-- | host/include/uhd/version.hpp.in | 3 | ||||
-rw-r--r-- | host/lib/utils/log.cpp | 2 | ||||
-rw-r--r-- | host/lib/version.cpp | 4 | ||||
-rw-r--r-- | mpm/cmake/Modules/MPMVersion.cmake | 1 |
5 files changed, 11 insertions, 1 deletions
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake index 205c2e839..99e898649 100644 --- a/host/cmake/Modules/UHDVersion.cmake +++ b/host/cmake/Modules/UHDVersion.cmake @@ -145,3 +145,5 @@ if(DEFINED UHD_ABI_VERSION) else() set(UHD_ABI_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}") endif() + +set(UHD_COMPONENT "UHD") diff --git a/host/include/uhd/version.hpp.in b/host/include/uhd/version.hpp.in index 0179821da..41abe99e9 100644 --- a/host/include/uhd/version.hpp.in +++ b/host/include/uhd/version.hpp.in @@ -35,6 +35,9 @@ namespace uhd{ //! Get the ABI compatibility string for this build of the library UHD_API std::string get_abi_string(void); + //! Get the component string + UHD_API std::string get_component(void); + } //namespace uhd #endif diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp index 8bcf13ebc..c8d5e07cc 100644 --- a/host/lib/utils/log.cpp +++ b/host/lib/utils/log.cpp @@ -205,7 +205,7 @@ public: std::ostringstream sys_info; sys_info << BOOST_PLATFORM << "; " << BOOST_COMPILER << "; " << "Boost_" << BOOST_VERSION << "; " - << "UHD_" << uhd::get_version_string(); + << uhd::get_component() << "_" << uhd::get_version_string(); _publish_log_msg(sys_info.str(), uhd::log::info, "UHD"); } diff --git a/host/lib/version.cpp b/host/lib/version.cpp index f3c268748..016c46a9f 100644 --- a/host/lib/version.cpp +++ b/host/lib/version.cpp @@ -18,3 +18,7 @@ std::string uhd::get_version_string(void){ std::string uhd::get_abi_string(void){ return UHD_VERSION_ABI_STRING; } + +std::string uhd::get_component(void){ + return "@UHD_COMPONENT@"; +}
\ No newline at end of file diff --git a/mpm/cmake/Modules/MPMVersion.cmake b/mpm/cmake/Modules/MPMVersion.cmake index 622892417..d0b744093 100644 --- a/mpm/cmake/Modules/MPMVersion.cmake +++ b/mpm/cmake/Modules/MPMVersion.cmake @@ -29,3 +29,4 @@ else() set(MPM_VERSION "${MPM_VERSION_MAJOR}.${MPM_VERSION_API}.${MPM_VERSION_ABI}.${MPM_VERSION_PATCH}-${MPM_GIT_COUNT}-${MPM_GIT_HASH}") endif() +set(UHD_COMPONENT "MPM")
\ No newline at end of file |