MantisBT - CMake
View Issue Details
0011928CMakeCMakepublic2011-03-04 12:002015-07-08 08:57
Nicolas Despres 
Stephen Kelly 
lowminoralways
closedfixed 
i686Ubuntu10.10
CMake 2.8.4 
CMake 2.8.12 
0011928: Wrong percentage value with Makefile generator.
It seems that the Makefile generator does not count custom commands but only targets. I would have expect that it counts both.
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(cmake_wrong_percentage)

# Generate input files.
foreach(i RANGE 1 10)
  file(WRITE "${PROJECT_SOURCE_DIR}/file${i}" "content ${i}")
endforeach(i)

# Add one custom command for each input file.
set(OUTPUT_FILES "")
foreach(i RANGE 1 10)
  set(input "file${i}")
  set(output "${PROJECT_BINARY_DIR}/${input}.out")
  add_custom_command(
    OUTPUT ${output}
    COMMAND ${CMAKE_COMMAND} -E copy "${input}" "${output}"
    DEPENDS ${input}
    COMMENT "Copying ${output}"
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    VERBATIM
    )
  list(APPEND OUTPUT_FILES "${output}")
endforeach(i)

# Add the target that trigger the custom commands.
add_custom_target(copy
  DEPENDS ${OUTPUT_FILES}
  )
$ mkdir _build
$ cd _build
$ cmake ..

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/despre_n/src/test/cmake-wrong-percentage/_build
$ make copy
Scanning dependencies of target copy
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file1.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file2.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file3.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file4.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file5.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file6.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file7.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file8.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file9.out
[ 0%] Copying /home/despre_n/src/test/cmake-wrong-percentage/_build/file10.out
[100%] Built target copy
No tags attached.
Issue History
2011-03-04 12:00Nicolas DespresNew Issue
2012-08-11 11:09David ColeStatusnew => backlog
2012-08-11 11:09David ColeNote Added: 0030238
2015-02-26 14:00Stephen KellyNote Added: 0038081
2015-02-26 14:00Stephen KellyStatusbacklog => resolved
2015-02-26 14:00Stephen KellyFixed in Version => CMake 2.8.12
2015-02-26 14:00Stephen KellyResolutionopen => fixed
2015-02-26 14:00Stephen KellyAssigned To => Stephen Kelly
2015-07-08 08:57Robert MaynardNote Added: 0039070
2015-07-08 08:57Robert MaynardStatusresolved => closed

Notes
(0030238)
David Cole   
2012-08-11 11:09   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0038081)
Stephen Kelly   
2015-02-26 14:00   
I didn't try with earlier versions, but this has been resolved for a while.
(0039070)
Robert Maynard   
2015-07-08 08:57   
Closing resolved issues that have not been updated in more than 4 months.