<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top: 0px; margin-bottom: 0px;">Hello,</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Using CMake 3.8.1 on Windows 7 SP1.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">The following cmake expression will produce an error.</p>
<p style="margin-top: 0px; margin-bottom: 0px;">INSTALL(</p>
<p style="margin-top: 0px; margin-bottom: 0px;">  FILES</p>
<p style="margin-top: 0px; margin-bottom: 0px;">    $<$<CXX_COMPILER_ID:MSVC>${COMP_PATH}/win32/bin/comp.dll></p>
<p style="margin-top: 0px; margin-bottom: 0px;">  DESTINATION "${install_dir}")</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;">"CMake error: Error evaluating generator expression:
<span>$<CXX_COMPILER_ID:MSVC>.</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span><span>$<CXX_COMPILER_ID></span> may only be used with binary targets. It may not be used with add_custom_command</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span>or add_custom_target."</span></p>
<p><br>
</p>
<p><span><span>Tried using "GNU" instead of "MSVC" but did not help.</span></span></p>
<p>Tried using "PROGRAMS" instead of "FILES" but <span>did not help.</span></p>
<p><span></p>
<div>Replacing <span>$<CXX_COMPILER_ID:MSVC></span> with <span><span>$<BOOL:1> works, so it appears cmake-generator-expression work just not using compiler as key.</span></span></div>
</span>
<p></p>
<p><br>
</p>
<p>What does binary target mean in this context?</p>
<p><br>
</p>
<p>Why does this fail?</p>
<p><br>
</p>
<p>Kind regards,</p>
<p>Lars<br>
</p>
</div>
</body>
</html>