Different include file paths between build-from-source and installed


I’m working on upgrading our projects references to itk5.4. When I changed itk reference from a build-from-source directory to an installed directory, some of the #include no longer work. Here are two examples:

// works for build-from-source but not installed
#import <vnl_vector_ref.hxx>

// works for installed but not build-from-source
#import <nifti1_io.h>

In the CMAKE configuration, when referencing installed I use (installed)/lib/CMAKE/itk-5.4
and for build-from-source I directly use the build directory path.

Is there any way I can make the include behavior consistence no matter which way I reference the library? Or should I always use the same way (either installed or build-from-source) when building my projects?


Those two headers belong to third-party libraries. I am not sure whether you should be able to include them.

If you need direct access to VNL, you might provide your own build of it, turn on ITK_USE_SYSTEM_VXL, and also have find(VXL) in your project’s CMake code.

I doesn’t look like there is an equivalent ITK_USE_SYSTEM_NIFTI option. If you need it, you might consider adding it. ITK is now a community developed library, and contributions are welcome.

1 Like