[CMake] Searching once

Matthew Woehlke mw_triad at users.sourceforge.net
Tue Jan 14 19:36:49 EST 2014


On 2014-01-14 18:47, Al Niessner wrote:
> [snip]
> Is it possible to have a dependent project use configuration from a
> previously installed project?

- IF the dependent project creates a ProjectConfig.cmake, and
- IF said ProjectConfig.cmake sets the necessary variables referencing 
where its versions of dependencies can be found, and
- IF the dependee project finds the dependent project before any other 
dependencies

...then I think yes. The second is a little unusual though; is the 
dependent project under your control? (You can also have e.g. a 
'USE_DEPENDENCIES_FILE' for the dependent project if you don't want to 
force that projects versions of its own dependencies on downstream 
users. Which probably you shouldn't. Same general idea, though; the 
dependent project has to provide the information and the dependee has to 
use it.)

-- 
Matthew



More information about the CMake mailing list