]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Thu, 19 Oct 2017 20:36:07 +0000 (15:36 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Thu, 19 Oct 2017 20:36:07 +0000 (15:36 -0500)
CMakeLists.txt
appli/CTArteries/CMakeLists.txt
cmake_uninstall.cmake.in [deleted file]
config/install_FrontAlgorithms.sh [new file with mode: 0755]

index 4f4f23286e744c982dd049ab5f1e531f46067dc7..f0fe19b1a9e849fcdfa333382f65de3c6f954398 100644 (file)
@@ -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)
index f968ebcc4c76e3265dfaeeb86a783afce4a18a6c..0c880a23bb4401429a9eaf89bb1110a39da710b5 100644 (file)
@@ -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 (file)
index 34c9330..0000000
+++ /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 (executable)
index 0000000..9ee9844
--- /dev/null
@@ -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$