Skip to content

ITKInternalEigen3_DIR not found for installed ITK5.3.0 #4840

Description

@gongwaner

Description

I have a project that uses ITK as 3rd-party library. I downloaded the source code for ITK5.3.0, and the build was successful, no errors reported. I then installed the library.
For the project that uses ITK, I have this line

find_package(ITK REQUIRED)

in the CMakeLists.txt.
When I built the project, this line caused build error:

CMake Error at C:/Users/gongwaner/Projects/Library/InsightToolkit-5.3.0_install/lib/cmake/ITK-5.3/Modules/ITKEigen3.cmake:16 (find_package):
  Could not find a package configuration file provided by "ITKInternalEigen3"
  (requested version 3.3) with any of the following names:

    ITKInternalEigen3Config.cmake
    itkinternaleigen3-config.cmake

  Add the installation prefix of "ITKInternalEigen3" to CMAKE_PREFIX_PATH or
  set "ITKInternalEigen3_DIR" to a directory containing one of the above
  files.  If "ITKInternalEigen3" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  C:/Users/gongwaner/Projects/Library/InsightToolkit-5.3.0_install/lib/cmake/ITK-5.3/ITKModuleAPI.cmake:76 (include)
  C:/Users/gongwaner/Projects/Library/InsightToolkit-5.3.0_install/lib/cmake/ITK-5.3/ITKModuleAPI.cmake:31 (itk_module_load)
  C:/Users/gongwaner/Projects/Library/InsightToolkit-5.3.0_install/lib/cmake/ITK-5.3/ITKModuleAPI.cmake:129 (_itk_module_config_recurse)
  C:/Users/gongwaner/Projects/Library/InsightToolkit-5.3.0_install/lib/cmake/ITK-5.3/ITKConfig.cmake:88 (itk_module_config)
  CMakeLists.txt:39 (find_package)

I searched for ITKInternalEigen3Config.cmake and it's not in the installed folder. Rather it's under the build folder: InsightToolkit-5.3.0\build\ITKInternalEigen3-build.
I then searched the github repo to see if similar issues have been reported and found this issue similar to mine. In this comment it mentioned the cmake file is located under {ITK_DIR}/modules, but I did not see ITKInternalEigen3.cmake there.(I'm on WIN10 and the comment is on Linux environment, so maybe that's why it's different?)

If I want to use ITK5.3.0, how can I fix this problem?

Versions

ITK 5.3.0

Environment

Platform: windows10.0.19045-x86_64_v3
Cmake version: 3.30.2
Cmake Generator: Visual Studio 2022 17.11.2

Additional Information

Here's my CMakeCache for cmake build process. Maybe it's something wrong with the build options?
CMakeCache.txt

Metadata

Metadata

Assignees

Labels

type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions