CMAke install files using cmake-generator-expression

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CMAke install files using cmake-generator-expression

Lars Lars

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


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake