Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation - fix CGAL_ITK_support #7858

Merged
merged 8 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
#!/bin/bash

set -ex

sudo apt-get update
sudo apt-get install -y libmpfr-dev \
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh
#update cmake to 3.18.4
sudo apt-get install -y \
libmpfr-dev \
libtbb-dev \
libmetis-dev \
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 libunwind-dev \
libinsighttoolkit5-dev \
libceres-dev \
libglpk-dev \
libopencv-dev \
zsh

#update CMake
sudo apt purge --auto-remove cmake
cd /tmp
wget https://cmake.org/files/v3.18/cmake-3.18.4-Linux-x86_64.sh
sudo sh cmake-3.18.4-Linux-x86_64.sh --skip-license --prefix=/usr/local
rm 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)
wget https://cmake.org/files/LatestRelease/cmake-$CMAKE_VER-linux-x86_64.sh
sudo sh cmake-*.sh --skip-license --prefix=/usr/local
rm cmake-*.sh
7 changes: 0 additions & 7 deletions Installation/cmake/modules/CGAL_ITK_support.cmake

This file was deleted.

12 changes: 8 additions & 4 deletions Mesh_3/examples/Mesh_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,20 @@ if(TARGET CGAL::CGAL_ImageIO)
target_link_libraries(mesh_3D_image_variable_size
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)
include(CGAL_ITK_support)
message(STATUS "ITK found")
include(${ITK_USE_FILE})
set(ITK_LIBS ITKCommon ITKSmoothing ITKImageIntensity)

create_single_source_cgal_program("mesh_3D_weighted_image.cpp")
target_link_libraries(mesh_3D_weighted_image
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
PUBLIC CGAL::Eigen3_support ${ITK_LIBS})

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
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
PUBLIC CGAL::Eigen3_support ${ITK_LIBS})
else(ITK_FOUND)
message(STATUS "NOTICE: The examples that need ITK will not be compiled.")
endif(ITK_FOUND)
Expand Down
14 changes: 11 additions & 3 deletions Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ target_link_libraries(
${OPENGL_gl_LIBRARY})
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)
include(CGAL_ITK_support)
target_link_libraries(mesh_3_plugin PUBLIC CGAL::ITK_support)
include(${ITK_USE_FILE})
set(ITK_LIBS ITKCommon ITKSmoothing ITKImageIntensity)
foreach(lib ${ITK_LIBS})
if(NOT TARGET ${lib})
message(STATUS "ITK library ${lib} not found")
endif()
endforeach()
target_link_libraries(mesh_3_plugin PUBLIC ${ITK_LIBS})
target_compile_definitions(mesh_3_plugin PUBLIC CGAL_USE_ITK)
endif(ITK_FOUND)

find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage vtkIOXML NO_MODULE)
Expand Down