mirror of https://github.com/CGAL/cgal
Merge pull request #7858 from janetournois/Installation-ITK-jtournois
Installation - fix `CGAL_ITK_support`
This commit is contained in:
commit
2cf5576eb8
|
|
@ -1,12 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libmpfr-dev \
|
sudo apt-get install -y \
|
||||||
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
|
libmpfr-dev \
|
||||||
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh \
|
libtbb-dev \
|
||||||
qt6-base-dev qt6-declarative-dev
|
libmetis-dev \
|
||||||
#update cmake to 3.18.4
|
libssh-dev \
|
||||||
|
libeigen3-dev \
|
||||||
|
qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev libqt5websockets5-dev \
|
||||||
|
libqt5svg5-dev qttools5-dev qttools5-dev-tools \
|
||||||
|
libboost-dev libboost-serialization-dev libboost-iostreams-dev libboost-filesystem-dev libboost-filesystem-dev \
|
||||||
|
libvtk9-dev libgdcm-tools libvtkgdcm-dev libunwind-dev \
|
||||||
|
libinsighttoolkit5-dev \
|
||||||
|
libceres-dev \
|
||||||
|
libglpk-dev \
|
||||||
|
libopencv-dev \
|
||||||
|
zsh \
|
||||||
|
qt6-base-dev qt6-declarative-dev libqt6svg6-dev libqt6websockets6-dev
|
||||||
|
|
||||||
|
#update CMake
|
||||||
sudo apt purge --auto-remove cmake
|
sudo apt purge --auto-remove cmake
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget https://cmake.org/files/v3.18/cmake-3.18.4-Linux-x86_64.sh
|
CMAKE_VER=$(curl --silent https://cmake.org/files/LatestRelease/cmake-latest-files-v1.json | jq -r .version.string)
|
||||||
sudo sh cmake-3.18.4-Linux-x86_64.sh --skip-license --prefix=/usr/local
|
wget https://cmake.org/files/LatestRelease/cmake-$CMAKE_VER-linux-x86_64.sh
|
||||||
rm cmake-3.18.4-Linux-x86_64.sh
|
sudo sh cmake-*.sh --skip-license --prefix=/usr/local
|
||||||
|
rm cmake-*.sh
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
if(ITK_FOUND AND NOT TARGET CGAL::ITK_support)
|
if(ITK_FOUND AND NOT TARGET CGAL::ITK_support)
|
||||||
add_library(CGAL::ITK_support INTERFACE IMPORTED)
|
add_library(CGAL::ITK_support INTERFACE IMPORTED)
|
||||||
set_target_properties(CGAL::ITK_support PROPERTIES
|
foreach(itk_target ITKCommon ITKSmoothing ITKImageIntensity)
|
||||||
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_ITK"
|
if(TARGET ${itk_target})
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${ITK_INCLUDE_DIRS}"
|
target_link_libraries(CGAL::ITK_support INTERFACE ${itk_target})
|
||||||
INTERFACE_LINK_LIBRARIES "${ITK_LIBRARIES}")
|
endif()
|
||||||
|
endforeach()
|
||||||
|
target_compile_definitions(CGAL::ITK_support INTERFACE CGAL_USE_ITK)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -170,9 +170,13 @@ if(TARGET CGAL::CGAL_ImageIO)
|
||||||
target_link_libraries(mesh_3D_image_variable_size
|
target_link_libraries(mesh_3D_image_variable_size
|
||||||
PUBLIC CGAL::Eigen3_support)
|
PUBLIC CGAL::Eigen3_support)
|
||||||
|
|
||||||
find_package(ITK NAMES ITK InsightToolkit QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity)
|
find_package(ITK NAMES ITK InsightToolkit
|
||||||
|
QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity)
|
||||||
if(ITK_FOUND)
|
if(ITK_FOUND)
|
||||||
include(CGAL_ITK_support)
|
include(CGAL_ITK_support)
|
||||||
|
message(STATUS "ITK found")
|
||||||
|
include(${ITK_USE_FILE})
|
||||||
|
|
||||||
create_single_source_cgal_program("mesh_3D_weighted_image.cpp")
|
create_single_source_cgal_program("mesh_3D_weighted_image.cpp")
|
||||||
target_link_libraries(mesh_3D_weighted_image
|
target_link_libraries(mesh_3D_weighted_image
|
||||||
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
||||||
|
|
@ -180,9 +184,9 @@ if(TARGET CGAL::CGAL_ImageIO)
|
||||||
create_single_source_cgal_program("mesh_3D_weighted_image_with_detection_of_features.cpp")
|
create_single_source_cgal_program("mesh_3D_weighted_image_with_detection_of_features.cpp")
|
||||||
target_link_libraries(mesh_3D_weighted_image_with_detection_of_features
|
target_link_libraries(mesh_3D_weighted_image_with_detection_of_features
|
||||||
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
||||||
else(ITK_FOUND)
|
else()
|
||||||
message(STATUS "NOTICE: The examples that need ITK will not be compiled.")
|
message(STATUS "NOTICE: The examples that need ITK will not be compiled.")
|
||||||
endif(ITK_FOUND)
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_weighted_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled.")
|
message(STATUS "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_weighted_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled.")
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,12 @@ target_link_libraries(
|
||||||
${OPENGL_gl_LIBRARY})
|
${OPENGL_gl_LIBRARY})
|
||||||
target_include_directories(mesh_3_plugin PRIVATE include)
|
target_include_directories(mesh_3_plugin PRIVATE include)
|
||||||
|
|
||||||
find_package(ITK NAMES ITK InsightToolkit QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity)
|
find_package(ITK NAMES ITK InsightToolkit
|
||||||
|
QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity)
|
||||||
if(ITK_FOUND)
|
if(ITK_FOUND)
|
||||||
include(CGAL_ITK_support)
|
include(CGAL_ITK_support)
|
||||||
|
message(STATUS "ITK found")
|
||||||
|
include(${ITK_USE_FILE})
|
||||||
target_link_libraries(mesh_3_plugin PUBLIC CGAL::ITK_support)
|
target_link_libraries(mesh_3_plugin PUBLIC CGAL::ITK_support)
|
||||||
endif(ITK_FOUND)
|
endif(ITK_FOUND)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue