[CMake] CMAke install files using cmake-generator-expression

Lars laasunde at hotmail.com
Mon Jan 15 05:37:31 EST 2018


Hello,


Using CMake 3.8.1 on Windows 7 SP1.


The following cmake expression will produce an error.

INSTALL(

  FILES

    $<$<CXX_COMPILER_ID:MSVC>${COMP_PATH}/win32/bin/comp.dll>

  DESTINATION "${install_dir}")


"CMake error: Error evaluating generator expression: $<CXX_COMPILER_ID:MSVC>.

$<CXX_COMPILER_ID> may only be used with binary targets. It may not be used with add_custom_command

or add_custom_target."


Tried using "GNU" instead of "MSVC" but did not help.

Tried using "PROGRAMS" instead of "FILES" but did not help.

Replacing $<CXX_COMPILER_ID:MSVC> with $<BOOL:1> works, so it appears cmake-generator-expression work just not using compiler as key.


What does binary target mean in this context?


Why does this fail?


Kind regards,

Lars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180115/6b4b2221/attachment-0001.html>


More information about the CMake mailing list