View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008787CMakeCMakepublic2009-03-24 18:402013-10-21 11:21
ReporterDaniel Nelson 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0008787: set_property on sources causing extra files to be rebuilt
DescriptionI am using set_property to add extra compile flags to source files that are
built using a precompiled header, but whenever a source file is added or
removed it causes every file in the executable to be rebuilt. I have come up
with a CMakeList that shows the issue.

#####
cmake_minimum_required(VERSION 2.6)
project(prop_test)
set(sources foo.cpp bar.cpp main.cpp)
add_executable(prop_test ${sources})
set_property(SOURCE foo.cpp main.cpp APPEND PROPERTY COMPILE_FLAGS -Wall)
#####

If you compile the project using a Makefile generator, then remove foo.cpp from
the sources variable and recompile, it will also recompile main.cpp and
bar.cpp even though no compile flags have changed. If you then put foo.cpp
back and build it will again rebuild main.cpp and bar.cpp. It seems that you
will need to rebuild every source file that is used in the executable, even
though nothing has changed.

The problem appears to be that all files depend on flags.make so they will be rebuilt if a flag changes. But since they all share the same flags.make, they will always be rebuilt as a group. Perhaps we could write a separate flags.make file for every object file that has compile/define flags set?
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0008642closedBill Hoffman recompile of all files when adding one 

  Notes
(0015796)
Daniel Nelson (reporter)
2009-03-24 19:08

This is a duplicate of 8642, sorry.

 Issue History
Date Modified Username Field Change
2009-03-24 18:40 Daniel Nelson New Issue
2009-03-24 19:08 Daniel Nelson Note Added: 0015796
2009-03-27 12:25 Bill Hoffman Relationship added duplicate of 0008642
2009-03-27 12:26 Bill Hoffman Status new => closed
2009-03-27 12:26 Bill Hoffman Resolution open => won't fix
2013-10-21 11:21 Brad King Relationship added related to 0014493
2013-10-21 11:22 Brad King Relationship deleted related to 0014493


Copyright © 2000 - 2018 MantisBT Team