From 56081fe4d671c9d58dea2d594f4aa6b35c9d6f3d Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 7 Jan 2015 23:53:06 +0100 Subject: cmake: Added config.h back to the game --- host/CMakeLists.txt | 6 ++++++ host/cmake/Modules/UHDGlobalDefs.cmake | 30 ++++++++++++++++++++++++++++++ host/include/CMakeLists.txt | 6 +++++- host/include/config.h.in | 24 ++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 host/cmake/Modules/UHDGlobalDefs.cmake create mode 100644 host/include/config.h.in diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 856f1ec70..67a824c8f 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) ######################################################################## @@ -189,6 +190,11 @@ MESSAGE(STATUS "Boost include directories: ${Boost_INCLUDE_DIRS}") MESSAGE(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}") MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}") +######################################################################## +# Additional settings for build environment +######################################################################## +INCLUDE(UHDGlobalDefs) + ######################################################################## # Check Python Modules ######################################################################## 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 . +# + +# 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/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 . # +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 . + */ + +#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@ -- cgit v1.2.3 From 73e324cda00d62dbf52ed5b53ccabdf6feabf819 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 8 Jan 2015 00:10:48 +0100 Subject: cmake: Added a version macro for compile-time version checks --- host/include/uhd/CMakeLists.txt | 7 +++++- host/include/uhd/version.hpp | 42 ----------------------------------- host/include/uhd/version.hpp.in | 49 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 43 deletions(-) delete mode 100644 host/include/uhd/version.hpp create mode 100644 host/include/uhd/version.hpp.in 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 deleted file mode 100644 index 998765899..000000000 --- a/host/include/uhd/version.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// Copyright 2010-2014 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 . -// - -#ifndef INCLUDED_UHD_VERSION_HPP -#define INCLUDED_UHD_VERSION_HPP - -#include -#include - -/*! - * The ABI version string that the client application builds against. - * Call get_abi_string() to check this against the library build. - * The format is oldest API compatible release - ABI compat number. - * The compatibility number allows pre-release ABI to be versioned. - */ -#define UHD_VERSION_ABI_STRING "3.8.0-0" - -namespace uhd{ - - //! Get the version string (dotted version number + build info) - UHD_API std::string get_version_string(void); - - //! Get the ABI compatibility string for this build of the library - UHD_API std::string get_abi_string(void); - -} //namespace uhd - -#endif /* INCLUDED_UHD_VERSION_HPP */ diff --git a/host/include/uhd/version.hpp.in b/host/include/uhd/version.hpp.in new file mode 100644 index 000000000..725a655c4 --- /dev/null +++ b/host/include/uhd/version.hpp.in @@ -0,0 +1,49 @@ +// +// Copyright 2010-2014 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 . +// + +#ifndef INCLUDED_UHD_VERSION_HPP +#define INCLUDED_UHD_VERSION_HPP + +#include +#include + +/*! + * The ABI version string that the client application builds against. + * Call get_abi_string() to check this against the library build. + * The format is oldest API compatible release - ABI compat number. + * The compatibility number allows pre-release ABI to be versioned. + */ +#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) + UHD_API std::string get_version_string(void); + + //! Get the ABI compatibility string for this build of the library + UHD_API std::string get_abi_string(void); + +} //namespace uhd + +#endif /* INCLUDED_UHD_VERSION_HPP */ -- cgit v1.2.3 From 0175da4f86e6ff47ba6960e0d1138a76e5717592 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 13 Jan 2015 13:10:09 +0100 Subject: docs: Specified min compiler versions --- host/docs/build.dox | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- cgit v1.2.3