summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-27 14:10:27 -0800
committerJosh Blum <josh@joshknows.com>2010-12-27 14:10:27 -0800
commit8dffb7d5a6f3ff0390ca01dcd15200689b874b30 (patch)
treed01db9ff7c0bc4d87aea4af6d6b424db48a1a212
parent3017907fd83d32e89e91f43a5d2b94d4155beddd (diff)
downloaduhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.tar.gz
uhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.tar.bz2
uhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.zip
cmake: moved module files into modules directory, set modules path
-rw-r--r--host/CMakeLists.txt23
-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)0
-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/lib/CMakeLists.txt2
-rw-r--r--host/lib/transport/CMakeLists.txt3
-rw-r--r--images/CMakeLists.txt11
10 files changed, 32 insertions, 22 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index efc439af0..60c53ba9a 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 49f74ae88..49f74ae88 100644
--- a/host/config/Python.cmake
+++ b/host/Modules/UHDPython.cmake
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/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/images/CMakeLists.txt b/images/CMakeLists.txt
index 75cb4c9d3..ee8146f3a 100644
--- a/images/CMakeLists.txt
+++ b/images/CMakeLists.txt
@@ -15,14 +15,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(UHD-images NONE)
-
########################################################################
-# Config Files (include order is important)
+# Setup Project
########################################################################
-INCLUDE(${CMAKE_SOURCE_DIR}/../host/config/Python.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/../host/config/Version.cmake)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(UHD-images NONE)
+LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../host/Modules)
+INCLUDE(UHDVersion) #sets version variables (used below)
########################################################################
# Setup CPack