Jérémy Coulon jeremy.coulon at free.fr
Sat May 21 05:01:57 EDT 2011

> First of all, don't use "./lib" and "./share" as destinations in the
> INSTALL() command. In the export files generated by INSTALL(EXPORT),
> CMake computes the targets' IMPORTED_LOCATION property by ascending
> from the export file's location to the CMAKE_INSTALL_PREFIX and sub-
> sequently appending the targets' relative destination directory. The
> ascension is obviously done by counting intermediate directories, i.e.
> from ${CMAKE_INSTALL_PREFIX}/./share to ${CMAKE_INSTALL_PREFIX}/./lib,
> it will be ${CMAKE_INSTALL_PREFIX}/./share/../.././lib which evaluates
> to ${CMAKE_INSTALL_PREFIX}/../lib since "." and ".." don't neutralize.
> Possibly, this is a bug in CMake; circumvent it by specifying "share"
> and "lib" as relative destination directories without a leading dot.
OK, I will try to pay attention to this point.

> To make your project A useful for other projects, you should provide a
> configuration file AConfig.cmake or a-config.cmake that typically does:
> 1. Invoke FIND_PACKAGE(B) which will provide the information about the
> B_STATIC library as an imported target. B's configuration file or find
> module will in turn call FIND_PACKAGE(C), so C_STATIC's information is
> also available in A's configuration file when FIND_PACKAGE(B) returns.
> 2. Include the export file providing the definition of A's own targets.
That's what I thought I should do.
Thanks for your help.


More information about the CMake mailing list