MantisBT - CMake
View Issue Details
0015286CMakeCMakepublic2014-12-05 08:572015-05-04 09:05
Jaak Ristioja 
 
normalmajoralways
closedduplicate 
 
 
0015286: ExternalProject double build with parallel make and multiple targets
Given a project like this:

    cmake_minimum_required(VERSION 2.8.12)
    project(bad NONE)
    include(ExternalProject)
    ExternalProject_Add(a
      DOWNLOAD_COMMAND sleep 1
      CONFIGURE_COMMAND sleep 1
      BUILD_COMMAND sleep 1
      INSTALL_COMMAND date +%N | tee a)
    ExternalProject_Add(b
      DOWNLOAD_COMMAND sleep 1
      CONFIGURE_COMMAND sleep 1
      BUILD_COMMAND sleep 1
      INSTALL_COMMAND touch b
      DEPENDS a)

Running something like "make -j2 a b" causes target "a" to be built twice:

    [ 12%] [ 12%] Creating directories for 'a'
    Creating directories for 'a'
    [ 25%] [ 25%] Performing download step for 'a'
    Performing download step for 'a'
    [ 50%] [ 50%] [ 50%] [ 50%] No patch step for 'a'
    No update step for 'a'
    No update step for 'a'
    No patch step for 'a'
    [ 62%] [ 62%] Performing configure step for 'a'
    Performing configure step for 'a'
    [ 75%] [ 75%] Performing build step for 'a'
    Performing build step for 'a'
    [ 87%] [ 87%] Performing install step for 'a'
    Performing install step for 'a'
    506615761
    506738194
    [100%] [100%] Completed 'a'
    Completed 'a'
    [100%] [100%] Built target a
    Built target a
    Creating directories for 'b'
    Performing download step for 'b'
    No patch step for 'b'
    No update step for 'b'
    Performing configure step for 'b'
    Performing build step for 'b'
    Performing install step for 'b'
    Completed 'b'
    Built target b
Using CMake 2.8.12 and GNU make 4.0. This issue also seems to be have been reported in the mailing list: http://public.kitware.com/pipermail/cmake/2013-July/055214.html [^]
No tags attached.
duplicate of 0014312closed Kitware Robot Parallel builds using make break when two or more targets that share a dependency (or are dependent) are called explicitly 
Issue History
2014-12-05 08:57Jaak RistiojaNew Issue
2014-12-05 09:14Brad KingRelationship addedduplicate of 0014312
2014-12-05 09:15Brad KingNote Added: 0037393
2014-12-05 09:15Brad KingStatusnew => resolved
2014-12-05 09:15Brad KingResolutionopen => duplicate
2015-05-04 09:05Robert MaynardNote Added: 0038691
2015-05-04 09:05Robert MaynardStatusresolved => closed

Notes
(0037393)
Brad King   
2014-12-05 09:15   
Resolving as duplicate of 0014312. For GNU make this was fixed as described in 0014312:0034818 in CMake 3.0.
(0038691)
Robert Maynard   
2015-05-04 09:05   
Closing resolved issues that have not been updated in more than 4 months.