diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/CMakeLists.txt | 23 | ||||
-rw-r--r-- | host/Modules/FindUSB1.cmake (renamed from host/lib/transport/FindUSB1.cmake) | 0 | ||||
-rw-r--r-- | host/Modules/UHDComponent.cmake (renamed from host/config/Component.cmake) | 0 | ||||
-rw-r--r-- | host/Modules/UHDPackage.cmake (renamed from host/config/CPack.cmake) | 4 | ||||
-rw-r--r-- | host/Modules/UHDPython.cmake (renamed from host/config/Python.cmake) | 28 | ||||
-rw-r--r-- | host/Modules/UHDVersion.cmake (renamed from host/config/Version.cmake) | 11 | ||||
-rw-r--r-- | host/cmake_uninstall.cmake.in (renamed from host/config/cmake_uninstall.cmake.in) | 0 | ||||
-rw-r--r-- | host/docs/CMakeLists.txt | 14 | ||||
-rw-r--r-- | host/examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/transport/CMakeLists.txt | 3 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/CMakeLists.txt | 6 |
12 files changed, 63 insertions, 30 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index efc439af0..f59cda23f 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -15,21 +15,25 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(UHD CXX) -ENABLE_TESTING() +######################################################################## +#IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) +# MESSAGE(FATAL_ERROR "Prevented in-tree built. This is bad practice.") +#ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) ######################################################################## -# Config Files (include order is important) +# Project setup ######################################################################## -INCLUDE(${CMAKE_SOURCE_DIR}/config/Component.cmake) -INCLUDE(${CMAKE_SOURCE_DIR}/config/Python.cmake) -INCLUDE(${CMAKE_SOURCE_DIR}/config/Version.cmake) -INCLUDE(${CMAKE_SOURCE_DIR}/config/CPack.cmake) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(UHD CXX) +ENABLE_TESTING() +LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Modules) +INCLUDE(UHDComponent) #enable components +INCLUDE(UHDPackage) #setup cpack ######################################################################## # Install Dirs ######################################################################## +SET(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") SET(RUNTIME_DIR bin) SET(LIBRARY_DIR lib${LIB_SUFFIX}) SET(INCLUDE_DIR include) @@ -102,7 +106,7 @@ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) # Create Uninstall Target ######################################################################## CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/config/cmake_uninstall.cmake.in + ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) @@ -168,4 +172,5 @@ ENDIF(ENABLE_UTILS) # Print Summary ######################################################################## UHD_PRINT_COMPONENT_SUMMARY() +MESSAGE(STATUS "Building version: ${CPACK_PACKAGE_VERSION}") MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") diff --git a/host/lib/transport/FindUSB1.cmake b/host/Modules/FindUSB1.cmake index ebcac99eb..ebcac99eb 100644 --- a/host/lib/transport/FindUSB1.cmake +++ b/host/Modules/FindUSB1.cmake diff --git a/host/config/Component.cmake b/host/Modules/UHDComponent.cmake index 0263b071f..0263b071f 100644 --- a/host/config/Component.cmake +++ b/host/Modules/UHDComponent.cmake diff --git a/host/config/CPack.cmake b/host/Modules/UHDPackage.cmake index a86f452f9..2a11d407b 100644 --- a/host/config/CPack.cmake +++ b/host/Modules/UHDPackage.cmake @@ -16,6 +16,9 @@ # ######################################################################## +INCLUDE(UHDVersion) #sets version information + +######################################################################## # Setup CPack ######################################################################## SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ettus Research - Universal Hardware Driver") @@ -39,4 +42,3 @@ STRING(REPLACE "," ", " CPACK_DEBIAN_PACKAGE_DEPENDS SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python, python-tk") SET(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= ${BOOST_MIN_VERSION}") INCLUDE(CPack) #include after setting vars -MESSAGE(STATUS "Version: ${CPACK_PACKAGE_VERSION}") diff --git a/host/config/Python.cmake b/host/Modules/UHDPython.cmake index 847e7bff3..49f74ae88 100644 --- a/host/config/Python.cmake +++ b/host/Modules/UHDPython.cmake @@ -18,13 +18,33 @@ ######################################################################## # Setup Python ######################################################################## -IF(NOT DEFINED PYTHON_EXECUTABLE) - INCLUDE(FindPythonInterp) +#this allows the user to override PYTHON_EXECUTABLE +IF(PYTHON_EXECUTABLE) + SET(PYTHONINTERP_FOUND TRUE) + +#otherwise if not set, try to automatically find it +ELSE(PYTHON_EXECUTABLE) + + #use the built-in find script + FIND_PACKAGE(PythonInterp) + + #and if that fails use the find program routine IF(NOT PYTHONINTERP_FOUND) - MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") + FIND_PROGRAM(PYTHON_EXECUTABLE python) + IF(PYTHON_EXECUTABLE) + SET(PYTHONINTERP_FOUND TRUE) + ENDIF(PYTHON_EXECUTABLE) ENDIF(NOT PYTHONINTERP_FOUND) -ENDIF(NOT DEFINED PYTHON_EXECUTABLE) + +ENDIF(PYTHON_EXECUTABLE) + +#make the path to the executable appear in the cmake gui +SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE PYTHON_EXECUTABLE "python interpreter") + +IF(NOT PYTHONINTERP_FOUND) + MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") +ENDIF(NOT PYTHONINTERP_FOUND) MACRO(PYTHON_CHECK_MODULE desc mod cmd have) MESSAGE(STATUS "") diff --git a/host/config/Version.cmake b/host/Modules/UHDVersion.cmake index 839db7833..fc2e2bbbd 100644 --- a/host/config/Version.cmake +++ b/host/Modules/UHDVersion.cmake @@ -16,6 +16,9 @@ # ######################################################################## +INCLUDE(UHDPython) #requires python for parsing + +######################################################################## # Setup Version Numbers ######################################################################## SET(UHD_VERSION_MAJOR 0001) #API compatibility number @@ -28,9 +31,7 @@ SET(UHD_VERSION_PATCH 0) #Short hash of git commit MESSAGE(STATUS "") MESSAGE(STATUS "Checking for git") FIND_PROGRAM(GIT git) -IF(${GIT} STREQUAL "GIT-NOTFOUND") - MESSAGE(STATUS "Checking for git - not found") -ELSE(${GIT} STREQUAL "GIT-NOTFOUND") +IF(GIT) MESSAGE(STATUS "Checking for git - found") #grab the git log entry for the current head @@ -62,4 +63,6 @@ ELSE(${GIT} STREQUAL "GIT-NOTFOUND") ) SET(UHD_VERSION_PATCH ${_git_rev}) -ENDIF(${GIT} STREQUAL "GIT-NOTFOUND") +ELSE(GIT) + MESSAGE(STATUS "Checking for git - not found") +ENDIF(GIT) diff --git a/host/config/cmake_uninstall.cmake.in b/host/cmake_uninstall.cmake.in index 6031a6ca9..6031a6ca9 100644 --- a/host/config/cmake_uninstall.cmake.in +++ b/host/cmake_uninstall.cmake.in diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt index d6a7801bf..54e0d589c 100644 --- a/host/docs/CMakeLists.txt +++ b/host/docs/CMakeLists.txt @@ -38,17 +38,15 @@ SET(manual_sources MESSAGE(STATUS "") MESSAGE(STATUS "Checking for rst2html (docutils)") FIND_PROGRAM(RST2HTML rst2html) -IF(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") - MESSAGE(STATUS "Checking for rst2html (docutils) - not found") - MESSAGE(STATUS " Disabled generation of HTML manual.") - SET(HAVE_RST2HTML FALSE) -ELSE(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") +IF(RST2HTML) MESSAGE(STATUS "Checking for rst2html (docutils) - found") MESSAGE(STATUS " Enabled generation of HTML manual.") - SET(HAVE_RST2HTML TRUE) -ENDIF(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") +ELSE(RST2HTML) + MESSAGE(STATUS "Checking for rst2html (docutils) - not found") + MESSAGE(STATUS " Disabled generation of HTML manual.") +ENDIF(RST2HTML) -LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "HAVE_RST2HTML" OFF) +LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "RST2HTML" OFF) IF(ENABLE_MANUAL) #setup rst2html options diff --git a/host/examples/CMakeLists.txt b/host/examples/CMakeLists.txt index ce2ca9640..ac131b217 100644 --- a/host/examples/CMakeLists.txt +++ b/host/examples/CMakeLists.txt @@ -40,7 +40,7 @@ ENDFOREACH(example_source) ######################################################################## # ASCII Art DFT - requires curses, so this part is optional ######################################################################## -INCLUDE(FindCurses) +FIND_PACKAGE(Curses) IF(CURSES_FOUND) INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 28e4bcca2..fa5d6b67b 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -18,6 +18,8 @@ ######################################################################## # Check Python Modules ######################################################################## +INCLUDE(UHDPython) + PYTHON_CHECK_MODULE( "Python version 2.6 or greater" "platform" "platform.python_version() >= '2.6'" diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt index de2f1fdd0..5602e47a7 100644 --- a/host/lib/transport/CMakeLists.txt +++ b/host/lib/transport/CMakeLists.txt @@ -22,8 +22,7 @@ ######################################################################## # Setup libusb ######################################################################## -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -FIND_PACKAGE(USB1 REQUIRED) +FIND_PACKAGE(USB1) LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF) diff --git a/host/lib/usrp/usrp_e100/CMakeLists.txt b/host/lib/usrp/usrp_e100/CMakeLists.txt index 5d8a9791d..c32dd87f8 100644 --- a/host/lib/usrp/usrp_e100/CMakeLists.txt +++ b/host/lib/usrp/usrp_e100/CMakeLists.txt @@ -22,7 +22,11 @@ ######################################################################## # Conditionally configure the USRP-E100 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP-E100" ENABLE_USRP_E100 OFF "ENABLE_LIBUHD" ON) +IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + SET(LINUX_TARGET TRUE) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +LIBUHD_REGISTER_COMPONENT("USRP-E100" ENABLE_USRP_E100 OFF "ENABLE_LIBUHD;LINUX_TARGET" OFF) IF(ENABLE_USRP_E100) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) |