MantisBT - CMake
View Issue Details
0015715CMakeCMakepublic2015-08-27 21:262016-06-10 14:31
shuaiw 
Kitware Robot 
highmajoralways
closedmoved 
Intel X86-64Linux 2.6.32CentOS 6.4
CMake 3.3.1 
 
0015715: COMMAND item of "add_custom_command" produce incorrect build.make
add_custom_command(OUTPUT xele_mdapi.signature
        COMMAND echo Xele-MD API Revision:${LASTREV} | tee xele_mdapi.signature
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        VERBATIM
        COMMENT "Produce signature"
)
build in clion 1.1 OR
enter ${CMAKE_HOME_DIRECTORY}/_build
cmake ..
partof generated build.make:
XeleMdAPI64/xele_mdapi.signature:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/shuaiw/sw/trunk/xele_md/modules/xeleAPI-NMR-CMake/_build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Produce signature"
    cd /home/shuaiw/sw/trunk/xele_md/modules/xeleAPI-NMR-CMake/XeleMdAPI64 && echo Xele-MD API Revision:820
 | tee xele_mdapi.signature ## this is newline
No tags attached.
Issue History
2015-08-27 21:26shuaiwNew Issue
2015-08-27 23:05shuaiwNote Added: 0039341
2015-08-28 08:46Brad KingNote Added: 0039343
2016-06-10 14:29Kitware RobotNote Added: 0042829
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0039341)
shuaiw   
2015-08-27 23:05   
also happens in COMMAND ${CMAKE_COMMAND} -P gen.cmake -D${last_rev}
COMMAND ${CMAKE_COMMAND} -P gen2.cmake ${curr_date} targetFile
if do not use variable , build.make is correct
(0039343)
Brad King   
2015-08-28 08:46   
How is the value of LASTREV computed? I suspect it has a newline in it. If it comes from execute_process, consider using OUTPUT_STRIP_TRAILING_WHITESPACE.
(0042829)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.