[cmake-developers] [CMake 0013840]: Allow generator expressions anywhere
Mantis Bug Tracker
mantis at public.kitware.com
Tue Jan 8 11:21:10 EST 2013
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
======================================================================
More information about the cmake-developers
mailing list