From: Leonardo Florez-Valencia Date: Fri, 11 Sep 2015 10:01:56 +0000 (+0200) Subject: Now ported to macosx and easier to configure on win32... hopefully X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c3463f912369cb954e29afda1636110db6d3df38;p=FrontAlgorithms.git Now ported to macosx and easier to configure on win32... hopefully --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ada831..7bb3e2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/appli/examples/example_Image_Dijkstra_EndPointDetection.cxx b/appli/examples/example_Image_Dijkstra_EndPointDetection.cxx index aea0fe5..8a6dec2 100644 --- a/appli/examples/example_Image_Dijkstra_EndPointDetection.cxx +++ b/appli/examples/example_Image_Dijkstra_EndPointDetection.cxx @@ -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 ); diff --git a/cmake/FrontAlgorithmsConfig.cmake.in b/cmake/FrontAlgorithmsConfig.cmake.in index da3d3e8..80869c4 100644 --- a/cmake/FrontAlgorithmsConfig.cmake.in +++ b/cmake/FrontAlgorithmsConfig.cmake.in @@ -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$ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index a4e9f9d..8921bc6 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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$