MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015605 | CMake | Documentation | public | 2015-06-07 15:52 | 2016-01-04 11:51 |
Reporter | Peter Wu | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | text | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | CMake 3.2.3 | ||||
Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||
Summary | 0015605: Mention TARGET_FILE for COMMAND option of add_custom_command | ||||
Description | While trying to set an environment variable in an add_custom_command target, I found http://www.cmake.org/pipermail/cmake/2006-March/008522.html [^] which describes this syntax: add_custom_command(TARGET foo COMMAND ${CMAKE_COMMAND} -E env VAR=VAL somecommand ...) This works when somecommand is a system command, but in my case it was an executable which was previously added by add_executable(somecommand ...). The documentation at http://www.cmake.org/cmake/help/v3.2/command/add_custom_command.html [^] describes how this special behavior works: "If COMMAND specifies an executable target (created by the add_executable() command) it will automatically be replaced by the location of the executable created at build time." While the following paragraph mentions generator expressions (thanks again Nils Gladitz!), it would help if $<TARGET_FILE:somecommand> was mentioned in the same sentence for cases like the above (cmake -E env). | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-06-07 15:52 | Peter Wu | New Issue | |||
2015-06-08 09:08 | Brad King | Note Added: 0038891 | |||
2015-06-08 09:08 | Brad King | Assigned To | => Brad King | ||
2015-06-08 09:08 | Brad King | Status | new => resolved | ||
2015-06-08 09:08 | Brad King | Resolution | open => fixed | ||
2015-06-08 09:08 | Brad King | Fixed in Version | => CMake 3.3 | ||
2015-06-08 09:08 | Brad King | Target Version | => CMake 3.3 | ||
2016-01-04 11:51 | Robert Maynard | Note Added: 0040061 | |||
2016-01-04 11:51 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|