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

UseITK uses include_directories and link_directories #1450

rijobro opened this issue Nov 29, 2019 · 0 comments


Copy link

@rijobro rijobro commented Nov 29, 2019


UseITK.cmake uses include_directories and link_directories.

Steps to Reproduce


Expected behavior

Variables should be returned such that target_include_directories and target_link_libraries can be used.

Actual behavior


Lines 26 to 30 in c95b998

# Add include directories needed to use ITK.
include_directories(BEFORE ${ITK_INCLUDE_DIRS})
# Add link directories needed to use ITK.

include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/ITKFactoryRegistration)

include_directores pollutes the include path. Our code ( builds against both ITK and NiftyReg, both of which have a copy of nifti1.h. For a particular library, we want to be using the NiftyReg files, but because of this issue, ITK includes get prepended. We therefore get into problems with the itk_nifti_mangle.h.

You can see this problem, which is present in one of our Travis builds: There is one matrix in red, due to this problem.




From at least 4.13. Still present in master.


Linux Ubuntu 14.04 (and potentially other distributions).

Additional Information


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.