[cmake-developers] [CMake 0011985]: CMake scanner does extract dependencies of C and C++ files correctly

Mantis Bug Tracker mantis at public.kitware.com
Fri Mar 18 10:13:20 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=11985 
====================================================================== 
Reported By:                Mathias Gaunard
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11985
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-03-18 10:13 EDT
Last Modified:              2011-03-18 10:13 EDT
====================================================================== 
Summary:                    CMake scanner does extract dependencies of C and C++
files correctly
Description: 
Due to using a simplified scanner that doesn't do full preprocessing, include
directives that depend on C/C++ preprocessor usage are not dealt with correctly.

This has been discussed on the mailing list here:
http://www.cmake.org/pipermail/cmake/2010-July/038465.html

CMake should detect when files contain non-trivial include directives and invoke
a full C preprocessor in that case.

Alternatively CMake could provide a way to override the tool used to detect
those dependencies.
Indeed, in the current situation, there seems to be no workaround possible.
Explicitly adding OBJECT_DEPENDS properties doesn't seem to work either.

Steps to Reproduce: 
Download attached testcase.
Run cmake with the Makefile or NMakefile generator.
Make the 'test' target.
Touch test2.hpp to make it more recent
Make the 'test' target again, and notice nothing gets recompiled

Additional Information: 
Having correct dependencies of C/C++ files is extremely important, especially
for continuous integration solutions.

Such includes exist in various libraries. The Boost C++ libraries contain such
includes to generate its meta-programming code, while several other libraries
use such includes to conditionally include code for one architecture or another.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-18 10:13 Mathias GaunardNew Issue                                    
2011-03-18 10:13 Mathias GaunardFile Added: test_cmake.tar.bz2                  
 
======================================================================




More information about the cmake-developers mailing list