BIC-MNI / libminc

libminc is the core library and API of the MINC toolkit
Other
19 stars 29 forks source link

Doesn't find nifti #102

Open ryandesign opened 5 years ago

ryandesign commented 5 years ago

I am in the process of adding libminc to MacPorts.

I have nifticlib 2.0.0 installed and I would like libminc to use it.

I have used -DLIBMINC_USE_SYSTEM_NIFTI=ON when running cmake, but the system's nifti did not get used. I also did not see any message to that effect; it just proceeded to build using its built-in nifti, which is not what I wanted. If I request system nifti, and system nifti is not found, I expect the configuration to exit with an error message.

Investigating, I found that NIFTI_INCLUDE_DIR and ZNZ_INCLUDE_DIR did not get set. Setting them manually to the location where the headers are installed ($PREFIX/include/nifti) worked and the system's nifti is now used.

libminc's cmake file should be updated to understand that that's where nifti installs its headers by default, and it should print an error message and exit if the headers are not found, rather than ignoring the user's request to use the system nifti.

gdevenyi commented 5 years ago

We probably need a custom FindLibNifti.cmake , some project has probably made that we can steal.