<p>Ok, I'll double-check this next monday. That's why I was confused.</p>
<p>On the second thought if you have a list of sources you can add them as dependencies in addition to build rule, then step will be re-run as expected. May be it's my case.</p>
<p>Anyways I need to do some more investigation.<br></p>
<p>Best wishes,<br>
Yuri</p>
<p>On Aug 12, 2011 6:54 PM, "David Cole" <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br type="attribution">> You can re-open the issue if you would like to have more discussion there.<br>
> <br>> The build step does not always re-run. If you have an "update" step<br>> before the build step, then the update step always re-runs, and the<br>> build step after it, but many external projects do not have an update<br>
> step, or anything else that "always" forces a build when there's a<br>> "Build Solution" executed on the containing project. (If it does, then<br>> that's a bug, because it's only supposed to re-execute steps that<br>
> *need* to be re-executed.)<br>> <br>> <br>> Thanks,<br>> David<br>> <br>> <br>> On Fri, Aug 12, 2011 at 10:46 AM, Yuri Timenkov <<a href="mailto:yuri@timenkov.ru">yuri@timenkov.ru</a>> wrote:<br>
>> Hello David,<br>>> It seems that I can't add notes to closed bug, so I ask you directly.<br>>> I don't quite understand what kind of automatic dependencies you're talking<br>>> about.<br>
>> If I change file in this way and do "build solution" cmake will<br>>> automatically launch build for external project. IIRC it always executes<br>>> build when I build solution.<br>>> As I said, for my local purposes I can use modified ExternalProject.cmake<br>
>> file, but I thought such feature might be useful for others.<br>>><br>>> On Fri, Aug 12, 2011 at 5:24 PM, Mantis Bug Tracker<br>>> <<a href="mailto:mantis@public.kitware.com">mantis@public.kitware.com</a>> wrote:<br>
>>><br>>>> A NOTE has been added to this issue.<br>>>> ======================================================================<br>>>> <a href="http://public.kitware.com/Bug/view.php?id=12322">http://public.kitware.com/Bug/view.php?id=12322</a><br>
>>> ======================================================================<br>>>> Reported By: Yuri<br>>>> Assigned To: David Cole<br>>>> ======================================================================<br>
>>> Project: CMake<br>>>> Issue ID: 12322<br>>>> Category: CMake<br>>>> Reproducibility: always<br>>>> Severity: tweak<br>
>>> Priority: normal<br>>>> Status: resolved<br>>>> Resolution: won't fix<br>>>> Fixed in Version: CMake 2.8.6<br>>>> ======================================================================<br>
>>> Date Submitted: 2011-07-08 05:27 EDT<br>>>> Last Modified: 2011-08-12 09:24 EDT<br>>>> ======================================================================<br>>>> Summary: Ability to add source files to target created<br>
>>> with<br>>>> ExternalProject<br>>>> Description:<br>>>> In my scenario I have part of project which should be built with different<br>>>> toolset (Main project is built with VC2010, and some legacy libraries with<br>
>>> VC6<br>>>> and VS2005).<br>>>> Basically nested project contains<br>>>> set(Proj_SRCS src1.cpp src2.cpp...)<br>>>> add_library(Proj MODULE ${Proj_SRCS})<br>>>><br>
>>> So set() command may be moved into separate file which in turn could be<br>>>> included<br>>>> into main project. So I want to see them there to edit in IDE, but not<br>>>> compile.<br>
>>><br>>>> The only possibility to add files to custom target - is specify SOURCES in<br>>>> add_custom_target command (It's impossible to call cmTarget::AddSources<br>>>> from<br>>>> outside). However, ExternalProject_Add macro doesn't add any sources.<br>
>>><br>>>> Moreover, there is a kind of chicken-and-egg problem: all arguments are<br>>>> parsed<br>>>> and set as property on target. But you can't set property while there is<br>>>> no<br>
>>> target.<br>>>><br>>>> So as quick work-around I made private copy of ExternalProject.cmake and<br>>>> pass<br>>>> sources as directory property.<br>>>><br>>>> So I'm asking for ideas how to properly implement this feature: modify<br>
>>> somehow<br>>>> parameters parsing in ExternalProject, or may be introduce command which<br>>>> allows<br>>>> adding new sources to existing targets (I'm not sure if this will work,<br>
>>> but for<br>>>> me it sounds like target_link_libraries command).<br>>>> ======================================================================<br>>>><br>>>> ----------------------------------------------------------------------<br>
>>> (0027196) David Cole (manager) - 2011-08-12 09:23<br>>>> <a href="http://public.kitware.com/Bug/view.php?id=12322#c27196">http://public.kitware.com/Bug/view.php?id=12322#c27196</a><br>>>> ----------------------------------------------------------------------<br>
>>> I don't think we should do this.<br>>>><br>>>> If we allow source files from external projects to be added directly to<br>>>> the IDE<br>>>> representations of the external projects in the containing project, then<br>
>>> people<br>>>> will expect the dependencies to work correctly automatically...<br>>>><br>>>> The dependencies will not work automatically. You will have to forcefully<br>>>> trigger an incremental rebuild of the external project on *any* build of<br>
>>> the<br>>>> containing project, and then hope that its build system appropriately<br>>>> picks up<br>>>> only the incremental build changes necessary.<br>>>><br>>>> I view this as fragile, and would not like to see it go in CMake unless it<br>
>>> can<br>>>> be made robust, and shown to work automatically and as developers would<br>>>> expect<br>>>> in the vast majority of use cases.<br>>>><br>>>> ----------------------------------------------------------------------<br>
>>> (0027197) David Cole (manager) - 2011-08-12 09:24<br>>>> <a href="http://public.kitware.com/Bug/view.php?id=12322#c27197">http://public.kitware.com/Bug/view.php?id=12322#c27197</a><br>>>> ----------------------------------------------------------------------<br>
>>> If you need more help on this issue/topic, please send email to the CMake<br>>>> users<br>>>> list asking for advice there. There's a much wider readership of the<br>>>> mailing<br>
>>> list than there is of the bug database.<br>>>><br>>>> Issue History<br>>>> Date Modified Username Field Change<br>>>> ======================================================================<br>
>>> 2011-07-08 05:27 Yuri New Issue<br>>>> 2011-08-12 09:19 David Cole Assigned To => David Cole<br>>>> 2011-08-12 09:19 David Cole Status new => assigned<br>
>>> 2011-08-12 09:23 David Cole Note Added: 0027196<br>>>> 2011-08-12 09:23 David Cole Status assigned =><br>>>> resolved<br>>>> 2011-08-12 09:23 David Cole Fixed in Version => CMake 2.8.6<br>
>>> 2011-08-12 09:23 David Cole Resolution open => won't fix<br>>>> 2011-08-12 09:24 David Cole Note Added: 0027197<br>>>> ======================================================================<br>
>>><br>>><br>>><br></p>