aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/CMakeLists.txt6
-rw-r--r--host/cmake/Modules/UHDGlobalDefs.cmake30
-rw-r--r--host/docs/build.dox10
-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
7 files changed, 84 insertions, 6 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 6d87bf95d..2245cd755 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -62,6 +62,7 @@ SET(PKG_MAN_DIR share/man/man1)
########################################################################
# Local Include Dir
########################################################################
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
########################################################################
@@ -206,6 +207,11 @@ MESSAGE(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}")
MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}")
########################################################################
+# Additional settings for build environment
+########################################################################
+INCLUDE(UHDGlobalDefs)
+
+########################################################################
# Check Python Modules
########################################################################
INCLUDE(UHDPython)
diff --git a/host/cmake/Modules/UHDGlobalDefs.cmake b/host/cmake/Modules/UHDGlobalDefs.cmake
new file mode 100644
index 000000000..b4c0173ea
--- /dev/null
+++ b/host/cmake/Modules/UHDGlobalDefs.cmake
@@ -0,0 +1,30 @@
+#
+# 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/>.
+#
+
+# This file sets up all the stuff for the config.h file
+
+INCLUDE(CheckCXXSymbolExists)
+
+## Check for std::log2
+CHECK_CXX_SYMBOL_EXISTS("log2" "cmath" HAVE_LOG2)
+
+## Macros for the version number
+MATH(EXPR UHD_VERSION_ADDED "10000 * ${TRIMMED_VERSION_MAJOR} + 100 * ${TRIMMED_VERSION_MINOR} + ${TRIMMED_VERSION_PATCH}")
+ADD_DEFINITIONS(-DUHD_VERSION=${UHD_VERSION_ADDED})
+
+## make sure the code knows about config.h
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
diff --git a/host/docs/build.dox b/host/docs/build.dox
index 0ca9933bb..1e73bbfb3 100644
--- a/host/docs/build.dox
+++ b/host/docs/build.dox
@@ -32,11 +32,13 @@ or install msysGit from http://code.google.com/p/msysgit/downloads/list.
\section cpp_compiler C++ Compiler
-The following compilers are known to work:
+The following compilers are known to work and officially supported:
-- GCC
-- Clang
-- MSVC
+- GCC >= 4.4
+- Clang >= 3.1
+- MSVC >= 2010
+
+Other compilers (or lower versions) may work, but are unsupported.
### CMake
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)