On 06/04/2011 04:28 PM, Alexander Neundorf wrote:
> I'd like to do from my FooConfig.cmake file something like:
>
> include(${CMAKE_CURRENT_LIST_DIR}/FooExports.cmake)
> set(FOO_INCLUDE_DIR ${FooExports_IMPORT_PREFIX}/include )
IIRC there is a case when the prefix is not computed, perhaps if the
install(EXPORT) command is given an absolute DESTINATION. In cases
when it is computed this information is certainly useful though. I
have several times essentially duplicated that logic by hand in a
FooConfig.cmake file (similar to Michael's response).
> Related to this, why is this location computed in the configuration-specific
> file, and not once in the "parent" exports-file, which includes all the
> export-files for the different configurations ?
It's just an implementation detail that happens to work that way and may
have been easier when first developed.
> If so, would it be ok if I move the code for calculating the IMPORT_PREFIX
> into the "parent" exports file ?
Yes. It can be computed up front before loading the per-config files.
-Brad
_______________________________________________
cmake-developers mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers