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)
## @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$
+++ /dev/null
-## =========================================================================
-## @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$
--- /dev/null
+#!/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$