[CMake] set_property imported_location_release

Lars laasunde at hotmail.com
Fri Dec 21 07:07:09 EST 2018


Hello,

Trying to import an external library but having some issue with setting imported_location_release property.

Basically I have config file which does this;
add_library(foo STATIC IMPORTED)
set_property(target foo APPEND PROPERTY
   interface_include_directories
    "$<BUILD_INTERFACE:${foot_root}/path>"
    "$<INSTALL_INTERFACE:${foo_root}/foo>")

set_property(TARGET foo APPEND PROPERTY
  IMPORTED_LOCATION_RELEASE
    $<$<CXX_COMPILER_ID:GNU>:${foo_root}/lib/release/foo.a>)

The imported target is used in a target_link_libraries method;
target_link_libraries(an_application foo)

Running CMake 3.6.1 does not produce any warnings. Running make I get a "target pattern contains no '%'" error message with a reference to a Build.make file.

The Build.make contains the string " $<$<CXX_COMPILER_ID:GNU>:/tmp/prototype/foo/lib/release/foo.a".  We did not expect to see the generator expression in the Build.make file.

Does set_property support generator expression in this context? What are we doing wrong?

Appreciate any help :-)

king regards, Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181221/c84ec159/attachment-0001.html>


More information about the CMake mailing list