[CMake] INSTALL_INTERFACE question

clinton at elemtech.com clinton at elemtech.com
Tue Apr 9 22:37:23 EDT 2013


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.

Why is a relative path disallowed for INSTALL_INTERFACE?  Should that be figured out for me?  Maybe it could put ${_IMPORT_PREFIX} in for me if it was a relative path.

Clint


More information about the CMake mailing list