[cmake-developers] [CMake 0015256]: Ninja handling of CMake depends and output files is not correct

Mantis Bug Tracker mantis at public.kitware.com
Tue Nov 18 18:14:43 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15256 
====================================================================== 
Reported By:                Stephen Kelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15256
Category:                   CMake
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-11-19 00:14 CET
Last Modified:              2014-11-19 00:14 CET
====================================================================== 
Summary:                    Ninja handling of CMake depends and output files is
not correct
Description: 

Given this test code:

 cmake_minimum_required(VERSION 2.8)
 project(cmaketest)

 configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/input_file.txt"
   "${CMAKE_CURRENT_BINARY_DIR}/confi_file.txt"
 )

If cmake is run, then input_file.txt is touched, then ninja is run, then ninja
correctly re-runs cmake, but also reports that no work need be done:

 $ ninja 
 [1/1] Re-running CMake...
 -- Configuring done
 -- Generating done
 -- Build files have been written to:
/home/stephen/dev/src/playground/cmake/build
 ninja: no work to do.

If confi_file.txt is then deleted, and ninja is run, ninja does not re-run cmake
to re-create the output file.

The same 'no work to do' message can be seen by creating a try_compile:

 try_compile(RES
   "${CMAKE_CURRENT_BINARY_DIR}/testbin"
   "${CMAKE_CURRENT_SOURCE_DIR}/tc_input.cpp"
 )
 message("RES: ${RES}")

Run cmake, and change the tc_input.cpp.

 this->Makefile->AddCMakeDependFile(this->Input.c_str());

and 

 this->Makefile->AddCMakeOutputFile(outputFileName.c_str());

are called at the appropriate places, but the appropriate Ninja content is
apparently not created.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-11-19 00:14 Stephen Kelly  New Issue                                    
======================================================================



More information about the cmake-developers mailing list