MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015116 | CMake | CMake | public | 2014-08-29 13:11 | 2015-11-02 09:13 |
Reporter | Vijay Pradeep | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 12.04 |
Product Version | CMake 2.8.12.2 | ||||
Target Version | CMake 3.2.1 | Fixed in Version | CMake 3.2.1 | ||
Summary | 0015116: cmake add_custom_command issue with multiple output files | ||||
Description | I'm noticing some potential incorrect behavior in cmake when working with add_custom_command and multiple output files. I've been able to isolate the problem to a minimal example (see below). It seems that when I have two output files specified in my add_custom_command, the second output file's upstream dependencies are not being tracked correctly in some cases. The cmake documentation clearly mentions that multiple output files are allowed. What's interesting here is that swapping the order of the output files causes different behavior, suggesting that the first OUTPUT file is being treated differently. (Crossposted here: http://stackoverflow.com/questions/24416133/cmake-add-custom-command-issue-with-multiple-output-files [^]) | ||||
Steps To Reproduce | Example CMakeLists.txt: cmake_minimum_required(VERSION 2.8) add_library(mybaz baz.cpp) add_custom_command( OUTPUT baz2.cpp COMMAND cp baz.cpp baz2.cpp DEPENDS baz.cpp COMMENT "Copying baz.cpp to baz2.cpp") add_custom_target(mytarget DEPENDS baz2.cpp COMMENT "Running mytarget") add_dependencies(mybaz mytarget) add_custom_command( OUTPUT bar.cpp baz.cpp COMMAND cat a.txt > bar.cpp COMMAND cat a.txt > baz.cpp DEPENDS a.txt COMMENT "Generating bar.cpp and baz.cpp") ====================================================== Below are the commands that I run: > touch a.txt > cmake . ...snip... (configuration runs fine) > make Scanning dependencies of target mytarget [ 20%] Generating bar.cpp and baz.cpp [ 40%] Copying baz.cpp to baz2.cpp [ 60%] Running mytarget [ 60%] Built target mytarget Scanning dependencies of target mybaz [ 80%] Building CXX object CMakeFiles/mybaz.dir/baz.cpp.o Linking CXX static library libmybaz.a [100%] Built target mybaz (everything looks good) > touch a.txt > make [ 20%] Generating bar.cpp and baz.cpp [ 40%] Running mytarget [ 60%] Built target mytarget Scanning dependencies of target mybaz [ 80%] Building CXX object CMakeFiles/mybaz.dir/baz.cpp.o Linking CXX static library libmybaz.a [100%] Built target mybaz (I seem to be missing the 'Copying baz.cpp to baz2.cpp' line) > make [ 20%] Copying baz.cpp to baz2.cpp [ 40%] Running mytarget [ 60%] Built target mytarget [100%] Built target mybaz ( The 'Copying baz.cpp to baz2.cpp' executes this time ) | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | console_output_ubuntu_14_04_cmake_2_8_12_2.txt (2,558) 2014-12-04 11:41 https://public.kitware.com/Bug/file/5310/console_output_ubuntu_14_04_cmake_2_8_12_2.txt | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2014-08-29 13:11 | Vijay Pradeep | New Issue | |||
2014-09-18 12:36 | Shootfast | Note Added: 0036825 | |||
2014-11-28 23:17 | Rongcui Dong | Note Added: 0037312 | |||
2014-12-04 11:41 | Vijay Pradeep | File Added: console_output_ubuntu_14_04_cmake_2_8_12_2.txt | |||
2014-12-04 11:48 | Vijay Pradeep | Note Added: 0037382 | |||
2014-12-04 15:06 | Rongcui Dong | Note Added: 0037388 | |||
2014-12-04 15:13 | Brad King | Note Added: 0037389 | |||
2014-12-04 15:13 | Brad King | Assigned To | => Brad King | ||
2014-12-04 15:13 | Brad King | Status | new => assigned | ||
2014-12-04 15:13 | Brad King | Target Version | => CMake 3.2 | ||
2014-12-08 09:02 | Brad King | Note Added: 0037404 | |||
2014-12-12 11:22 | Brad King | Status | assigned => resolved | ||
2014-12-12 11:22 | Brad King | Resolution | open => fixed | ||
2014-12-12 11:22 | Brad King | Fixed in Version | => CMake 3.2 | ||
2014-12-12 12:12 | Vijay Pradeep | Note Added: 0037447 | |||
2015-03-06 15:35 | Brad King | Note Added: 0038168 | |||
2015-03-06 15:35 | Brad King | Status | resolved => assigned | ||
2015-03-06 15:35 | Brad King | Resolution | fixed => open | ||
2015-03-06 15:35 | Brad King | Fixed in Version | CMake 3.2 => | ||
2015-03-06 15:39 | Brad King | Note Added: 0038169 | |||
2015-03-06 15:42 | Brad King | Note Added: 0038170 | |||
2015-03-06 18:14 | Brad King | Note Edited: 0038170 | bug_revision_view_page.php?bugnote_id=38170#r1722 | ||
2015-03-06 20:00 | Brad King | Note Edited: 0038170 | bug_revision_view_page.php?bugnote_id=38170#r1723 | ||
2015-03-09 09:43 | Brad King | Status | assigned => resolved | ||
2015-03-09 09:43 | Brad King | Resolution | open => fixed | ||
2015-03-09 09:43 | Brad King | Fixed in Version | => CMake 3.2 | ||
2015-03-09 09:44 | Brad King | Fixed in Version | CMake 3.2 => CMake 3.2.1 | ||
2015-03-09 09:44 | Brad King | Target Version | CMake 3.2 => CMake 3.2.1 | ||
2015-11-02 09:13 | Robert Maynard | Note Added: 0039723 | |||
2015-11-02 09:13 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|