From 14a76a3b6b58a9bc16f2c2ca5571cce3437f5075 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Thu, 19 Oct 2017 15:36:07 -0500 Subject: [PATCH] ... --- CMakeLists.txt | 10 ++++- appli/CTArteries/CMakeLists.txt | 23 ++++++----- cmake_uninstall.cmake.in | 27 ------------ config/install_FrontAlgorithms.sh | 69 +++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 39 deletions(-) delete mode 100644 cmake_uninstall.cmake.in create mode 100755 config/install_FrontAlgorithms.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f4f232..f0fe19b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,12 +14,18 @@ set(prj_REL 0) project(${prj_NAME} VERSION "${prj_MAJ}.${prj_MIN}.${prj_REL}") ## == Project policies -set(_policies CMP0015 CMP0020 CMP0042 CMP0053) -foreach(_p ${_policies}) +set(_new_policies CMP0015 CMP0020 CMP0042 CMP0053) +set(_old_policies CMP0006) +foreach(_p ${_new_policies}) if(POLICY ${_p}) cmake_policy(SET ${_p} NEW) endif(POLICY ${_p}) endforeach(_p) +foreach(_p ${_old_policies}) + if(POLICY ${_p}) + cmake_policy(SET ${_p} OLD) + endif(POLICY ${_p}) +endforeach(_p) ## == Find cpPlugins find_package(cpPlugins CONFIG REQUIRED) diff --git a/appli/CTArteries/CMakeLists.txt b/appli/CTArteries/CMakeLists.txt index f968ebc..0c880a2 100644 --- a/appli/CTArteries/CMakeLists.txt +++ b/appli/CTArteries/CMakeLists.txt @@ -2,15 +2,18 @@ ## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) ## ========================================================================= -if(cpPlugins_USE_VTK AND cpPlugins_USE_Qt5) - find_package(Qt5 CONFIG REQUIRED COMPONENTS PrintSupport) - BuildApplication( - CTArteries - SOURCE . - INSTALL - RECURRENT - LINKS fpa Qt5::PrintSupport - ) -endif(cpPlugins_USE_VTK AND cpPlugins_USE_Qt5) +option(fpa_BUILD_CTArteries "Build arteries analysis from CT images applications?" OFF) +if(fpa_BUILD_CTArteries) + if(cpPlugins_USE_VTK AND cpPlugins_USE_Qt5) + find_package(Qt5 CONFIG REQUIRED COMPONENTS PrintSupport) + BuildApplication( + CTArteries + SOURCE . + INSTALL + RECURRENT + LINKS fpa Qt5::PrintSupport + ) + endif(cpPlugins_USE_VTK AND cpPlugins_USE_Qt5) +endif(fpa_BUILD_CTArteries) ## eof - $RCSfile$ diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in deleted file mode 100644 index 34c9330..0000000 --- a/cmake_uninstall.cmake.in +++ /dev/null @@ -1,27 +0,0 @@ -## ========================================================================= -## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -## ========================================================================= - -if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) - -## eof - $RCSfile$ diff --git a/config/install_FrontAlgorithms.sh b/config/install_FrontAlgorithms.sh new file mode 100755 index 0000000..9ee9844 --- /dev/null +++ b/config/install_FrontAlgorithms.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +## -- Command line options +while [[ "$#" -gt 1 ]]; do + key="$1" + case $key in + -cpPluginsConfig) + cpPluginsConfig="$2" + shift + ;; + -cmake) + cmake="$2" + shift + ;; + -prefix) + prefix="$2" + shift + ;; + -build_dir) + build_dir="$2" + shift + ;; + -cores) + cores="$2" + shift + ;; + -build_type) + build_type="$2" + shift + ;; + *) + # Do nothing + ;; + esac + shift +done + +## -- Check command line options +if \ + [ -z "$cpPluginsConfig" ] || \ + [ -z "$cmake" ] || \ + [ -z "$prefix" ] || \ + [ -z "$cores" ] || \ + [ -z "$build_type" ] || \ + [ -z "$build_dir" ] ; then + (>&2 echo "Usage: $0 -cpPluginsConfig [file] -cmake [file] -prefix [dir] -build_dir [dir] -build_type [Release/Debug] -cores [n]") + exit 1 +fi + +## -- Current dir +curr_dir=`pwd` + +## -- Configure, build and install Qt5 +mkdir -p $build_dir/FrontAlgorithms +cd $build_dir/FrontAlgorithms +$cmake \ + -DCMAKE_BUILD_TYPE:STRING=$build_type \ + -DCMAKE_INSTALL_PREFIX:PATH=$prefix \ + -Dfpa_BUILD_CTArteries:BOOL=ON \ + -Dfpa_BUILD_CTBronchi:BOOL=ON \ + -DcpPlugins_DIR:PATH=`dirname $cpPluginsConfig` \ + $curr_dir/.. +make -s -j$cores -k +make -s -j -k install + +## -- End +cd $curr_dir + +## eof - $RCSfile$ -- 2.47.1