cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

Package use file not re-included after additional components are found #532

Closed schuhschuh closed 8 years ago

schuhschuh commented 8 years ago

When basis_find_package is called twice with a different list of package components, it calls CMake's find_package twice with the different lists of components. Actually, most package configuration or Find module will then override the first <PKG>_LIBRARIES and <PKD>_INCLUDE_DIRS variables with only the libraries for the latter components. The second time, find_package should be called with the union of the components to be looked for. Moreover, the basis_use_package command does not re-include the <PKG>_USE_FILE a second time. Moreover, such use files often have an include guard themselves which prevents the second inclusion.

An example is the VTK 6 library.

ahundt commented 8 years ago

I can confirm I've run into this problem in my own usage

schuhschuh commented 8 years ago

Previous change works well for our MIRTK project and the change has been merged from the CMake BASIS Modules develop branch into the develop branch of this project.