From 8dffb7d5a6f3ff0390ca01dcd15200689b874b30 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 27 Dec 2010 14:10:27 -0800 Subject: cmake: moved module files into modules directory, set modules path --- host/CMakeLists.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'host/CMakeLists.txt') 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 . # -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}") -- cgit v1.2.3 From 7d3842dbd01175dc04cbd77e852b30af3ab5ac35 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 27 Dec 2010 14:32:07 -0800 Subject: cmake: disable the in-tree build prevention --- host/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/CMakeLists.txt') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 60c53ba9a..f59cda23f 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -16,9 +16,9 @@ # ######################################################################## -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}) +#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}) ######################################################################## # Project setup -- cgit v1.2.3