From 64b884e7225b3d5fcb2a386947b128dbef9033b8 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 1 Dec 2009 19:42:39 +0000 Subject: [PATCH] Creating new project ISAM2 --- buildtools/cmake_wrapper.mk | 1 + buildtools/gt.cmake | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/buildtools/cmake_wrapper.mk b/buildtools/cmake_wrapper.mk index 17e00892d..e4ee1fa7d 100644 --- a/buildtools/cmake_wrapper.mk +++ b/buildtools/cmake_wrapper.mk @@ -38,6 +38,7 @@ cmake ccmake cmake_gui: builddir_exists # Re-run CMake if the Makefile is non-existant. The CMake-generated makefile # will run CMake if the Makefile is out-of-date. +.PHONY: ${BUILD}/Makefile ${BUILD}/Makefile: @if [ ! -d ${BUILD} ]; then \ echo "[cmake_wrapper]: mkdir ${BUILD}"; \ diff --git a/buildtools/gt.cmake b/buildtools/gt.cmake index 13146b809..dbdcb0e7f 100644 --- a/buildtools/gt.cmake +++ b/buildtools/gt.cmake @@ -12,14 +12,26 @@ cmake_policy(PUSH) cmake_minimum_required(VERSION 2.6) # Set the default install prefix -set(CMAKE_INSTALL_PREFIX "$ENV{HOME}" CACHE PATH "Installation prefix") -set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type, Debug or Release") +IF(NOT CMAKE_INSTALL_PREFIX OR CMAKE_INSTALL_PREFIX STREQUAL "/usr/local") + SET(CMAKE_INSTALL_PREFIX "$ENV{HOME}" CACHE PATH "Installation prefix" FORCE) +ENDIF() + +# Set the default build type +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +ENDIF() # Add borg libraries and includes include_directories("${CMAKE_INSTALL_PREFIX}/include") link_directories("${CMAKE_INSTALL_PREFIX}/lib") +# Add source directory as an include directory so installed header paths match project +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + # Path to CppUnitLite +set(BORG_SOFTWARE_ROOT "$ENV{HOME}/borg") set(GT_CPPUNITLITE_INCLUDE_DIR "${BORG_SOFTWARE_ROOT}/gtsam") set(GT_CPPUNITLITE_LIB_DIR "${BORG_SOFTWARE_ROOT}/gtsam/CppUnitLite") @@ -34,7 +46,7 @@ file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_FILE}" GT_BUILDTOOLS) string(REPLACE "/" ";" GT_BUILDTOOLS "${GT_BUILDTOOLS}") list(REMOVE_AT GT_BUILDTOOLS -1) string(REPLACE ";" "/" GT_BUILDTOOLS "${GT_BUILDTOOLS}") -message(STATUS "Build tools dir ${GT_BUILDTOOLS}") +message(STATUS "[gt.cmake] Build tools dir ${GT_BUILDTOOLS}") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${GT_BUILDTOOLS}") function(GT_USE_BOOST) if(ARGN)