[CMake] add_custom_command and CONFIG-dependent output

David Cole dlrdave at aol.com
Fri Aug 22 16:58:10 EDT 2014


Use "${CMAKE_CFG_INTDIR}" in the context of add_custom_command OUTPUT,
not $<CONFIG>.

You may also use that in the COMMAND arguments.

See documentation here:
http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_CFG_INTDIR.html

The $<> generator expressions are relatively new, and do not work in
all contexts that you might expect yet. CMAKE_CFG_INTDIR has been
around for quite some time, though, and works very well with custom
commands.


HTH,
David C.





More information about the CMake mailing list