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 =
## = 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)
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 );
-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$
${LIB_NAME}_LINK_LIBRARIES
${ITK_LIBRARIES}
${VTK_LIBRARIES}
- #vtkFiltersSources
- #vtkInteractionWidgets
- #vtkRenderingVolumeOpenGL
- #vtkRenderingFreeTypeOpenGL
- #vtkIOMPIImage
)
## =====================
${${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$