]> Creatis software - FrontAlgorithms.git/commitdiff
Now ported to macosx and easier to configure on win32... hopefully
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 11 Sep 2015 10:01:56 +0000 (12:01 +0200)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 11 Sep 2015 10:01:56 +0000 (12:01 +0200)
CMakeLists.txt
appli/examples/example_Image_Dijkstra_EndPointDetection.cxx
cmake/FrontAlgorithmsConfig.cmake.in
lib/CMakeLists.txt

index 2ada831c810ec82b4d9a722f1a2e2efb8ea8232a..7bb3e2abef638149d8f1a6158155e4f1869578ea 100644 (file)
@@ -1,8 +1,19 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
-IF(POLICY CMP0020)
-  CMAKE_POLICY(SET CMP0020 NEW)
-ENDIF(POLICY CMP0020)
+## ============
+## = Policies =
+## ============
+
+SET(
+  policies
+  CMP0020
+  CMP0042
+  )
+FOREACH(policy ${policies})
+  IF(POLICY ${policy})
+    CMAKE_POLICY(SET ${policy} NEW)
+  ENDIF(POLICY ${policy})
+ENDFOREACH(policy)
 
 ## ================
 ## = Project name =
@@ -31,14 +42,17 @@ ENDIF(BUILD_SHARED_LIBS)
 ## = Packages =
 ## ============
 
+# Prepare header to build shared libs (windows)
 INCLUDE(GenerateExportHeader)
 
+# Find ITK and VTK
 FIND_PACKAGE(ITK REQUIRED)
-INCLUDE(${ITK_USE_FILE})
-
 FIND_PACKAGE(VTK REQUIRED)
+
+INCLUDE(${ITK_USE_FILE})
 INCLUDE(${VTK_USE_FILE})
 
+# Do not use itk-vtk glue --> problems ahead!!!
 IF(ITKVtkGlue_LOADED)
   MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
 ENDIF(ITKVtkGlue_LOADED)
index aea0fe504f203100b5f04ab8123c5af82332133d..8a6dec2e57d04289b393daec50ddfc30cd6c9341 100644 (file)
@@ -72,8 +72,7 @@ int main( int argc, char* argv[] )
     viewer.Start( );
 
   // Compute squared distance map
-  typename
-    itk::SignedMaurerDistanceMapImageFilter< TImage, TScalarImage >::Pointer
+  itk::SignedMaurerDistanceMapImageFilter< TImage, TScalarImage >::Pointer
     dmap =
     itk::SignedMaurerDistanceMapImageFilter< TImage, TScalarImage >::New( );
   dmap->SetInput( input_image );
index da3d3e82c49033a80256660c7222e7cc81ec253b..80869c4623b36193d8cd33a85d6c754665f7ac15 100644 (file)
@@ -1,43 +1,27 @@
-FIND_PATH(
-  FrontAlgorithms_INCLUDE_DIR1
-  fpa/Base/Algorithm.h
-  PATHS
-  /usr/include
-  /usr/local/include
-  @PROJECT_SOURCE_DIR@/lib
-  @PROJECT_BINARY_DIR@/lib
-  @CMAKE_INSTALL_PREFIX@/include
-  )
+# =========================
+# -- Include directories --
+# =========================
 
-FIND_PATH(
-  FrontAlgorithms_INCLUDE_DIR2
-  fpa/FrontAlgorithms_Export.h
-  PATHS
-  /usr/include
-  /usr/local/include
+INCLUDE_DIRECTORIES(
   @PROJECT_SOURCE_DIR@/lib
   @PROJECT_BINARY_DIR@/lib
   @CMAKE_INSTALL_PREFIX@/include
   )
 
-INCLUDE_DIRECTORIES(
-  ${FrontAlgorithms_INCLUDE_DIR1}
-  ${FrontAlgorithms_INCLUDE_DIR2}
-  )
+# =========================
+# -- Library directories --
+# =========================
 
-FIND_LIBRARY(
-  FrontAlgorithms_LIBRARY_NAME
-  FrontAlgorithms
-  PATHS
-  /usr/lib
-  /usr/local/lib
-  @PROJECT_BINARY_DIR@
+LINK_DIRECTORIES(
+  @PROJECT_SOURCE_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib
   @CMAKE_INSTALL_PREFIX@/lib
   )
 
-SET(
-  FrontAlgorithms_LIBRARIES
-  ${FrontAlgorithms_LIBRARY_NAME}
-  )
+# ===================
+# -- Library names --
+# ===================
+
+SET(FrontAlgorithms_LIBRARY FrontAlgorithms)
 
 ## eof - $RCSfile$
index a4e9f9dc7516f44a4d798fb1dd684ab9b7df8be8..8921bc635e2283219acbb9fbc400a32230756260 100644 (file)
@@ -40,11 +40,6 @@ SET(
   ${LIB_NAME}_LINK_LIBRARIES
   ${ITK_LIBRARIES}
   ${VTK_LIBRARIES}
-  #vtkFiltersSources
-  #vtkInteractionWidgets
-  #vtkRenderingVolumeOpenGL
-  #vtkRenderingFreeTypeOpenGL
-  #vtkIOMPIImage
   )
 
 ## =====================
@@ -68,4 +63,42 @@ TARGET_LINK_LIBRARIES(
   ${${LIB_NAME}_LINK_LIBRARIES}
   )
 
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIB_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+SET(
+  local_install_dirs
+  fpa
+  )
+FOREACH(dir ${local_install_dirs})
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+ENDFOREACH(dir)
+
+INSTALL(
+  FILES
+  ${PROJECT_BINARY_DIR}/lib/fpa/${LIB_NAME}_Export.h
+  DESTINATION include/fpa
+  )
+
 ## eof - $RCSfile$