summaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
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 /host/CMakeLists.txt
parent3017907fd83d32e89e91f43a5d2b94d4155beddd (diff)
downloaduhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.tar.gz
uhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.tar.bz2
uhd-8dffb7d5a6f3ff0390ca01dcd15200689b874b30.zip
cmake: moved module files into modules directory, set modules path
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt23
1 files changed, 14 insertions, 9 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}")