The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12877 
====================================================================== 
Reported By:                Petr Kmoch
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12877
Category:                   CMake
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-16 09:49 CET
Last Modified:              2012-01-16 09:49 CET
====================================================================== 
Summary:                    Support generator expressions in OUTPUT
Description: 
While $<...> generator expressions in the COMMAND portion of
add_custom_command() are useful, I find their use is limited by the fact they
cannot be used in other parts of add_custom_command(), such as OUTPUT. For
example, in my project, I need a custom command to copy some files to the
directory where a target's executable resides. In other words, I need the
following:

add_custom_command(
 OUTPUT "$<TARGET_FILE_DIR:MyTarget>/TheExtraFile"
 COMMAND "${CMAKE_EXECUTABLE}" -E copy Path_To/TheExtraFile
"$<TARGET_FILE_DIR:MyTarget>/TheExtraFile"
 VERBATIM
)

While in the COMMAND part, the generator expression is interpreted correctly, in
OUTPUT it's not, and CMake produces an error: "add_custom_command called with
OUTPUT containing a "<".  This character is not allowed."

I saw http://public.kitware.com/Bug/view.php?id=9974 which would offer a
superset od the above functionality, but the above would offer simpler syntax
for this more specific class of uses.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-16 09:49 Petr Kmoch     New Issue                                    
======================================================================

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to