aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-01-13 18:40:44 +0100
committerMartin Braun <martin.braun@ettus.com>2015-01-13 18:40:44 +0100
commit8b60d5f0c1f2a477fc0a13f7a5f39ee8c1a40502 (patch)
treefd4e40a6aa3b7fdbb2b4bceef4e472b9c7b87d01 /host/include
parent3f9ef46bc51acc5933721974e191d2a9659f6566 (diff)
parent0175da4f86e6ff47ba6960e0d1138a76e5717592 (diff)
downloaduhd-8b60d5f0c1f2a477fc0a13f7a5f39ee8c1a40502.tar.gz
uhd-8b60d5f0c1f2a477fc0a13f7a5f39ee8c1a40502.tar.bz2
uhd-8b60d5f0c1f2a477fc0a13f7a5f39ee8c1a40502.zip
Merge branch 'maint'
Diffstat (limited to 'host/include')
-rw-r--r--host/include/CMakeLists.txt6
-rw-r--r--host/include/config.h.in24
-rw-r--r--host/include/uhd/CMakeLists.txt7
-rw-r--r--host/include/uhd/version.hpp.in (renamed from host/include/uhd/version.hpp)7
4 files changed, 42 insertions, 2 deletions
diff --git a/host/include/CMakeLists.txt b/host/include/CMakeLists.txt
index 3f7ca2cb7..780213918 100644
--- a/host/include/CMakeLists.txt
+++ b/host/include/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2010 Ettus Research LLC
+# Copyright 2010,2015 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
@@ -15,5 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h
+)
ADD_SUBDIRECTORY(uhd)
diff --git a/host/include/config.h.in b/host/include/config.h.in
new file mode 100644
index 000000000..bd690299e
--- /dev/null
+++ b/host/include/config.h.in
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2015 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/>.
+ */
+
+#cmakedefine HAVE_LOG2
+
+/* Version macros */
+#cmakedefine UHD_VERSION_MAJOR ${TRIMMED_VERSION_MAJOR}
+#cmakedefine UHD_VERSION_MINOR ${TRIMMED_VERSION_MINOR}
+#cmakedefine UHD_VERSION_PATCH ${TRIMMED_VERSION_PATCH}
+#cmakedefine UHD_VERSION @UHD_VERSION_ADDED@
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt
index 318577b7c..f6123aa90 100644
--- a/host/include/uhd/CMakeLists.txt
+++ b/host/include/uhd/CMakeLists.txt
@@ -21,6 +21,11 @@ ADD_SUBDIRECTORY(usrp)
ADD_SUBDIRECTORY(usrp_clock)
ADD_SUBDIRECTORY(utils)
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/version.hpp
+)
+
UHD_INSTALL(FILES
config.hpp
convert.hpp
@@ -31,7 +36,7 @@ UHD_INSTALL(FILES
property_tree.ipp
property_tree.hpp
stream.hpp
- version.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/version.hpp
DESTINATION ${INCLUDE_DIR}/uhd
COMPONENT headers
)
diff --git a/host/include/uhd/version.hpp b/host/include/uhd/version.hpp.in
index 998765899..725a655c4 100644
--- a/host/include/uhd/version.hpp
+++ b/host/include/uhd/version.hpp.in
@@ -29,6 +29,13 @@
*/
#define UHD_VERSION_ABI_STRING "3.8.0-0"
+/*!
+ * A macro to check UHD version at compile-time.
+ * The value of this macro is MAJOR * 10000 + MINOR * 100 + PATCH
+ * (e.g., for UHD 3.8.1 this is 30801).
+ */
+#cmakedefine UHD_VERSION @UHD_VERSION_ADDED@
+
namespace uhd{
//! Get the version string (dotted version number + build info)