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

Open
rijobro opened this issue Nov 29, 2019 · 0 comments

Comments

@rijobro
Copy link

@rijobro rijobro commented Nov 29, 2019

Description

UseITK.cmake uses include_directories and link_directories.

Steps to Reproduce

N/A

Expected behavior

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

Actual behavior

ITK/CMake/UseITK.cmake

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.
link_directories(${ITK_LIBRARY_DIRS})

include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/ITKFactoryRegistration)

include_directores pollutes the include path. Our code (https://github.com/CCPPETMR/SIRF) 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: https://travis-ci.org/CCPPETMR/SIRF/builds/618272131?utm_source=github_status&utm_medium=notification. There is one matrix in red, due to this problem.

Reproducibility

N/A

Versions

From at least 4.13. Still present in master.

Environment

Linux Ubuntu 14.04 (and potentially other distributions).

Additional Information

N/A

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