MantisBT - CMake
View Issue Details
0015602CMakeCMakepublic2015-06-03 12:012016-06-10 14:31
arlbranch 
Kitware Robot 
normalminoralways
closedmoved 
x86_64Linux4.0.4-2-ARCH
CMake 3.2.3 
 
0015602: Multiple configure_file calls with same input file cause Ninja to output spurious warning
Multiple calls to configure_file with the same input file but from different CMakeLists.txt files causes ninja to output the following:
warning: multiple rules generate .... builds involving this target will not be correct; continuing anyway

Complete Example:
=================
[branch@fortuna on /dev/pts/2] 611 ~/tmp/cftest
$ cmake --version
cmake version 3.2.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[branch@fortuna on /dev/pts/2] 612 ~/tmp/cftest
$ ls -R
.:
cftest.json CMakeLists.txt sub/

./sub:
CMakeLists.txt
[branch@fortuna on /dev/pts/2] 613 ~/tmp/cftest
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
project(cftest)

configure_file(cftest.json cftest1.json COPYONLY)
add_subdirectory(sub)

[branch@fortuna on /dev/pts/2] 614 ~/tmp/cftest
$ cat sub/CMakeLists.txt
configure_file(../cftest.json cftest2.json COPYONLY)

[branch@fortuna on /dev/pts/2] 615 ~/tmp/cftest
$ mkdir ../cfbuild && cd ../cfbuild
[branch@fortuna on /dev/pts/2] 616 ~/tmp/cfbuild
$ cmake -G Ninja ../cftest
-- The C compiler identification is GNU 5.1.0
-- The CXX compiler identification is GNU 5.1.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/branch/tmp/cfbuild
[branch@fortuna on /dev/pts/2] 617 ~/tmp/cfbuild
$ ninja
ninja: warning: multiple rules generate /home/branch/tmp/cftest/cftest.json. builds involving this target will not be correct; continuing anyway
ninja: no work to do.
1) Create the project in the Description
2) Configure with the Ninja generator
3) build with ninja
No tags attached.
Issue History
2015-06-03 12:01arlbranchNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042790
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
(0042790)
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.