summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-04-19 16:58:12 -0700
committerJosh Blum <josh@joshknows.com>2011-04-19 16:58:12 -0700
commit00bc8d50d5a2528704441ef5532fea13106a8d30 (patch)
tree0803774f3d0d73ab1be97aecb39f2e3996fe5e19
parent06e10b5f469b8b06af33a8a95a6302a1e365b396 (diff)
downloaduhd-00bc8d50d5a2528704441ef5532fea13106a8d30.tar.gz
uhd-00bc8d50d5a2528704441ef5532fea13106a8d30.tar.bz2
uhd-00bc8d50d5a2528704441ef5532fea13106a8d30.zip
uhd: removed constants.hpp.in, replaced w/ per source compile defines
-rw-r--r--host/lib/CMakeLists.txt17
-rw-r--r--host/lib/constants.hpp.in25
-rw-r--r--host/lib/utils/CMakeLists.txt13
-rw-r--r--host/lib/utils/paths.cpp1
-rw-r--r--host/lib/version.cpp8
5 files changed, 20 insertions, 44 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index 618e33608..fca4730d8 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -79,23 +79,18 @@ INCLUDE_SUBDIRECTORY(usrp)
INCLUDE_SUBDIRECTORY(utils)
########################################################################
-# Setup compiled-in constants for data directories
+# Setup UHD_VERSION_STRING for version.cpp
########################################################################
-FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR} UHD_PKG_DATA_PATH)
-STRING(REPLACE "\\" "\\\\" UHD_PKG_DATA_PATH ${UHD_PKG_DATA_PATH})
-MESSAGE(STATUS "Full package data directory: ${UHD_PKG_DATA_PATH}")
-
-CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/constants.hpp.in
- ${CMAKE_CURRENT_BINARY_DIR}/constants.hpp
-@ONLY)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp
+ PROPERTIES COMPILE_DEFINITIONS
+ "UHD_VERSION_STRING=\"${UHD_VERSION}-${UHD_BUILD_INFO}\""
+)
########################################################################
# Append to the list of sources for lib uhd
########################################################################
LIBUHD_APPEND_SOURCES(
- ${CMAKE_CURRENT_BINARY_DIR}/constants.hpp
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
${CMAKE_CURRENT_SOURCE_DIR}/exception.cpp
${CMAKE_CURRENT_SOURCE_DIR}/version.cpp
diff --git a/host/lib/constants.hpp.in b/host/lib/constants.hpp.in
deleted file mode 100644
index 2e0495b12..000000000
--- a/host/lib/constants.hpp.in
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// Copyright 2010-2011 Ettus Research LLC
-//
-// This program 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 of the License, or
-// (at your option) any later version.
-//
-// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#ifndef INCLUDED_LIBUHD_CONSTANTS_HPP
-#define INCLUDED_LIBUHD_CONSTANTS_HPP
-
-//these should be pre-processor macros to avoid static initialization issues
-#define UHD_VERSION_STRING "@UHD_VERSION@-@UHD_BUILD_INFO@"
-#define UHD_PKG_DATA_PATH "@UHD_PKG_DATA_PATH@"
-
-#endif /* INCLUDED_LIBUHD_CONSTANTS_HPP */
diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt
index 26c02b5b4..1314f7475 100644
--- a/host/lib/utils/CMakeLists.txt
+++ b/host/lib/utils/CMakeLists.txt
@@ -112,6 +112,19 @@ SET_SOURCE_FILES_PROPERTIES(
)
########################################################################
+# Define UHD_PKG_DATA_PATH for paths.cpp
+########################################################################
+FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${PKG_DATA_DIR} UHD_PKG_DATA_PATH)
+STRING(REPLACE "\\" "\\\\" UHD_PKG_DATA_PATH ${UHD_PKG_DATA_PATH})
+MESSAGE(STATUS "Full package data directory: ${UHD_PKG_DATA_PATH}")
+
+SET_SOURCE_FILES_PROPERTIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp
+ PROPERTIES COMPILE_DEFINITIONS
+ "UHD_PKG_DATA_PATH=\"${UHD_PKG_DATA_PATH}\""
+)
+
+########################################################################
# Append sources
########################################################################
LIBUHD_APPEND_SOURCES(
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index a0e4da547..a3dd377e5 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -15,7 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#include "constants.hpp"
#include <uhd/config.hpp>
#include <boost/tokenizer.hpp>
#include <boost/filesystem.hpp>
diff --git a/host/lib/version.cpp b/host/lib/version.cpp
index 93fdecb1a..d75cc8fda 100644
--- a/host/lib/version.cpp
+++ b/host/lib/version.cpp
@@ -15,13 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#include "constants.hpp"
#include <uhd/version.hpp>
-
-std::string uhd::get_version_string(void){
- return UHD_VERSION_STRING;
-}
-
#include <uhd/utils/static.hpp>
#include <boost/version.hpp>
#include <iostream>
@@ -31,7 +25,7 @@ UHD_STATIC_BLOCK(print_system_info){
<< BOOST_PLATFORM << "; "
<< BOOST_COMPILER << "; "
<< "Boost_" << BOOST_VERSION << "; "
- << "UHD_" << uhd::get_version_string()
+ << "UHD_" << UHD_VERSION_STRING
<< std::endl << std::endl
;
}