The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13840 
====================================================================== 
Reported By:                raspy
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13840
Category:                   CMake
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-01-08 11:21 EST
Last Modified:              2013-01-08 11:21 EST
====================================================================== 
Summary:                    Allow generator expressions anywhere
Description: 
add_custom_command allows to use generator expressions, but only in COMMAND
sections. They cannot be used in OUTPUT or DEPENDS sections. It would be useful
to support them anywhere in the CMakeLists.txt, so I could use them in variables
as well. Currently if I need to create a file in the same directory as output, I
would go with:

GET_TARGET_PROPERTY(OUTFILE_LOCATION file.out LOCATION)
GET_FILENAME_COMPONENT(OUTFILE_LOCATION_DIR ${OUTFILE_LOCATION} PATH)
SET(ANOTHER_FILE_NAME ${OUTFILE_LOCATION_DIR}/another.file)

It would be much more useful to just write:

SET(ANOTHER_FILE_NAME $<TARGET_FILE_DIR:file.out>/another.file)

(btw. tried this in hope of delayed expansion but it failed as well on the
OUTPUT line of add_custom_command)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-01-08 11:21 raspy          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