InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
Cannot configure a project against ITK with ITK_USE_GPU
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
When ITK is built with `ITK_USE_GPU`, configuring a project against it fails.
### Description
### Steps to Reproduce
A simple project defined by:
```cmake
project(tester CXX)
find_package(ITK REQUIRED)
itk_generate_factory_registration()
add_executable(tester tester.cpp)
target_link_libraries(tester ${ITK_INTERFACE_LIBRARIES} ITK::ITKImageIO)
```
fails to configure.
### Expected behavior
No errors.
### Actual behavior
```none
Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26200.
Configuring done (0.1s)
CMake Error at C:/Misc/ITK-patches-dev-26/ITKTargets.cmake:1411 (set_target_properties):
The link interface of target "ITK::ITKGPUCommon" contains:
OpenCL::OpenCL
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
C:/Misc/ITK-patches-dev-26/ITKConfig.cmake:77 (include)
CMakeLists.txt:15 (find_package)
CMake Error at C:/Misc/ITK-patches-dev-26/ITKTargets.cmake:1421 (set_target_properties):
The link interface of target "ITK::ITKGPUCommonModule" contains:
OpenCL::OpenCL
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
C:/Misc/ITK-patches-dev-26/ITKConfig.cmake:77 (include)
CMakeLists.txt:15 (find_package)
Generating done (0.2s)
```
### Versions
`main` branch.
### Environment
CMake 4.4.0, Windows, latest Visual Studio 2026.
### Additional Information
OpenCL libraries are normally found:
Contributor guide
Research direction
Reproduce the failure with the provided CMakeLists.txt while ITK_USE_GPU is enabled. Inspect ITKConfig.cmake and the generated ITKTargets.cmake entries for ITK::ITKGPUCommon and ITK::ITKGPUCommonModule, focusing on their OpenCL::OpenCL link dependency. Done means the sample project configures without missing-target errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100