diff --git a/CMakeExternals/PatchACVD.cmake b/CMakeExternals/PatchACVD.cmake index 062adbb8d0..4e3f3674d7 100644 --- a/CMakeExternals/PatchACVD.cmake +++ b/CMakeExternals/PatchACVD.cmake @@ -1,63 +1,71 @@ # Create Config.cmake file to make ACVD findable through config mode of find_package() file(WRITE "ACVDConfig.cmake.in" "set(ACVD_INCLUDE_DIRS \"@VTKSURFACE_INCLUDE_DIR@;@VTKDISCRETEREMESHING_INCLUDE_DIR@;@VTKVOLUMEPROCESSING_INCLUDE_DIR@\") set(ACVD_LIBRARY_DIRS \"@PROJECT_BINARY_DIR@/bin\") set(ACVD_LIBRARIES vtkSurface vtkDiscreteRemeshing vtkVolumeProcessing) add_definitions(-DDOmultithread)") file(APPEND "CMakeLists.txt" "CONFIGURE_FILE(ACVDConfig.cmake.in ACVDConfig.cmake @ONLY)") # Add vtkVersionMacros.h header file set(path "Common/vtkCurvatureMeasure.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "w.h\"" "w.h\"\n#include " contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Replace VTK_COMMON_EXPORT by VTK_EXPORT in class declarations set(path "Common/vtkMyMinimalStandardRandomSequence.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "COMMON_" "" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) set(path "DiscreteRemeshing/vtkThreadedClustering.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "COMMON_" "" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Add missing VTK_EXPORT to class declaration set(path "VolumeProcessing/vtkImageDataCleanLabels.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "ss" "ss VTK_EXPORT" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) +# Change required CMake version + +set(path "CMakeLists.txt") +file(STRINGS ${path} contents NEWLINE_CONSUME) +string(REPLACE "2.8.7" "2.8.5" contents ${contents}) +set(CONTENTS ${contents}) +configure_file(${TEMPLATE_FILE} ${path} @ONLY) + # Replace int by vtkIdType, which are types of different size (x64) set(path "DiscreteRemeshing/vtkVerticesProcessing.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "int N" "vtkIdType N" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Replace VTK 5 module names by VTK 6 module names # Link to POSIX thread library set(path "DiscreteRemeshing/CMakeLists.txt") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "vtkCommon" "vtkCommonCore" contents ${contents}) string(REPLACE "vtkFiltering" "vtkFiltersCore" contents ${contents}) string(REPLACE "vtkImaging" "vtkImagingCore" contents ${contents}) string(REPLACE "vtkIO" "vtkIOCore" contents ${contents}) string(REPLACE "vtkRendering" "vtkRenderingCore" contents ${contents}) string(REPLACE "vtkHybrid" "vtkFiltersHybrid vtkImagingHybrid" contents ${contents}) string(REPLACE "vtkGraphics" "" contents ${contents}) string(REPLACE "TARGET_LINK_LIBRARIES(v" "IF(UNIX AND NOT APPLE)\n LIST(APPEND LIB_ADDED pthread)\nENDIF(UNIX AND NOT APPLE)\n\nTARGET_LINK_LIBRARIES(v" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY)