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

Issue with CGAL ITK_Support #7855

Closed
lrineau opened this issue Nov 10, 2023 Discussed in #7854 · 6 comments · Fixed by #7858
Closed

Issue with CGAL ITK_Support #7855

lrineau opened this issue Nov 10, 2023 Discussed in #7854 · 6 comments · Fixed by #7858
Assignees
Milestone

Comments

@lrineau
Copy link
Member

lrineau commented Nov 10, 2023

Discussed in #7854

Originally posted by oarcelus November 10, 2023
I am trying to build a CGAL program that uses ITK.

I downloaded and setup everything with vcpkg for x64. When trying to configure my Cmake folder the following error appears.

CMake Error at C:/dev/vcpkg/installed/x64-windows/share/cgal/CGAL_ITK_support.cmake:4 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  CMakeLists.txt:52 (include)

Does this mean that I need to install ITK in ´debug´ or ´general´ mode?


That is a bug from about file CGAL_ITK_support.cmake. That file should use the imported targets created by ITKConfig.cmake.

@lrineau
Copy link
Member Author

lrineau commented Nov 10, 2023

We should extend our testsuite process. We have lost the testing of all 3rd party libraries on Windows since the switch to christo.

@janetournois
Copy link
Member

ITK is actually tested on Christo, in the example mesh_3D_weighted_image.cpp for example

@janetournois
Copy link
Member

However it has been installed manually, not via vcpkg

@janetournois
Copy link
Member

Hello @oarcelus
thanks for the report.
We have prepared a pull-request that should fix the issue you are facing : #7858
Can you please give it a try and tell us if it fixes the issue with your local configuration?
Thanks!

@oarcelus
Copy link

oarcelus commented Nov 13, 2023

I have changed the CMakeLists.txt file in the same way as in the merge request.

if(TARGET CGAL::CGAL_ImageIO)

  if(CGAL_ImageIO_USE_ZLIB)

    create_single_source_cgal_program("mesh_from_labeled_3d_array.cpp")
    target_link_libraries(mesh_from_labeled_3d_array PUBLIC CGAL::Eigen3_support) 

    create_single_source_cgal_program("mesh_from_labeled_3d_array_with_subdomain.cpp")
    target_link_libraries(mesh_from_labeled_3d_array_with_subdomain PUBLIC CGAL::Eigen3_support) 

    find_package(ITK NAMES ITK InsightToolkit
                     QUIET COMPONENTS ITKCommon ITKThresholding ITKSmoothing ITKImageIntensity)
    if(ITK_FOUND)
      message(STATUS "ITK found")
      include(${ITK_USE_FILE})
      set(ITK_LIBS ITKCommon ITKSmoothing ITKImageIntensity)

      create_single_source_cgal_program("mesh_from_labeled_3d_array_with_weights.cpp")
      target_link_libraries(mesh_from_labeled_3d_array
                            PUBLIC CGAL::Eigen3_support
                            ${ITK_LIBS})
    endif()
  endif()
else()

I still get an error when building the last mesh_from_labeled_3d_array_with_weights.cpp program. The error log is huge, this is a samplee

mesh_from_labeled_3d_array_with_weights.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl itk::OutputWindowDisplayWarningText(char const *)" (_imp?OutputWindowDisplayWarningText@itk@@YAXPEBD@Z) referenced in function "protec
ted: virtual class std::vector<double,class std::allocator > __cdecl itk::GaussianOperator<unsigned char,3,class itk::NeighborhoodAllocator >::GenerateCoefficients(void)" (?GenerateCoefficients@?$GaussianOperator@E$02V?$NeighborhoodAlloc
ator@E@itk@@@itk@@Meaa?AV?$vector@NV?$allocator@N@std@@@std@@xz) [C:\Users\oarcelus\ElectrodeBuilder\meshing_cgal\build\mesh_from_labeled_3d_array_with_weights.vcxproj]

I have built ITK with vcpkg.

@oarcelus
Copy link

Sorry, I tried installing all of the Mesh_3 programs and there were no errors such as the abovementioned ones. The problem must be on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants