[CMake] INSTALL_INTERFACE question
Stephen Kelly
steveire at gmail.com
Wed Apr 10 03:07:28 EDT 2013
clinton at elemtech.com wrote:
>
> I'm playing with some of the new cmake 2.8.11 features and an example I
> saw had this:
>
> set_property(TARGET foo PROPERTY
> INTERFACE_INCLUDE_DIRECTORIES
> "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};
${CMAKE_CURRENT_SOURCE_DIR}>"
> "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>"
> )
>
> I can see it put the expanded version of "${CMAKE_INSTALL_PREFIX}/include"
> in my export file, but I want it to be relocatable. For example, if I use
> the CPack ZIP generator, the files can be unzipped anywhere. If I replace
> it with "$<INSTALL_INTERFACE:include>" , it complains about it being a
> relative path.
Indeed. The $<INSTALL_PREFIX> generator expression was created to address
this issue. It expands to the ${_IMPORT_PREFIX}. Where did you see the
example above? In an old commit message? It doesn't seem to be in the code:
$ git grep "INSTALL_PREFIX./include"
Tests/ExportImport/Export/CMakeLists.txt: "$<INSTALL_INTERFACE:
$<INSTALL_PREFIX>/include/${_libName}>"
Tests/ExportImport/Export/CMakeLists.txt: INTERFACE_INCLUDE_DIRECTORIES
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibRequired>"
Tests/ExportImport/Export/CMakeLists.txt: INTERFACE_INCLUDE_DIRECTORIES
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibDepends>"
Tests/RunCMake/GeneratorExpression/BadInstallPrefix.cmake:
$<INSTALL_PREFIX>/include
Thanks,
Steve.
More information about the CMake
mailing list