<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 5, 2016 at 12:46 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Aug 5, 2016 at 11:59 AM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm using "MinGW Makefiles" as a generator...</div><div><br></div><div><br></div>When I change a cmakelists.txt file, a bunch of sources I specify to copy from /.../.c to ${CMAKE_BINARY_DIR}/.../.cpp get deleted in binary by cmake.<div><br></div><div>There are no rules in the makefiles for those files to depend on anything other than the original .c file, so I was really confused why they kept getting regenerated... I started to pay attention and found that cmake, during configure, if a cmakeLists.txt changes goes through and deletes all those files.</div><div><br></div><div><br></div><div><div>add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME<wbr>}${FILEEXT}</div><div>                              DEPENDS ${SOURCE}</div><div>                              COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME<wbr>}${FILEEXT} </div><div>                              )</div></div><div><br></div><div><br></div><div>all outputs get deleted?</div></div></blockquote></div></div><div>The file is opened with CreateFile, then </div><div><br></div><div>SetDispositionInformationFile<span style="white-space:pre-wrap">   </span>\Device\HarddiskVolume15\<wbr>mingw64-x86\sack-r\release_<wbr>solution\core\src\utils\<wbr>deploy\CMakeFiles\sack_deploy.<wbr>dir\DependInfo.cmake.tmp<span style="white-space:pre-wrap">  </span>SUCCESS<span style="white-space:pre-wrap"> </span>Delete: True</div><div> </div></div>so when the file is closed it's deleted...<br><br>Seems to be set from __archive_mktemp(const char *tmpdir)  passing FILE_FLAG_DELETE_ON_CLOSE; but my files aren't temporary....</div><div class="gmail_extra">that's the only thing that seems to set that flag....</div><div class="gmail_extra"><br></div><div class="gmail_extra">---------</div><div class="gmail_extra">trying to make a simple case; but it's not doing it.</div></div></blockquote><div><br></div><div>----------</div><div>in the simple case, modifying the COMMANDs in  <span style="color:rgb(80,0,80)">add_custom_command() deletes the output file; I can understand that....</span></div><div><span style="color:rgb(80,0,80)">In the complex case, I'm modifying a CMakeLists.txt which doesn't have any bearing on the commands applied to the sources or the other libraries using those sources; but it's still deleting them.</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">In the root CMakeLists.txt, I setup the list of sources for the main project 'bag' and then for each of those sources copy them to ${CMAKE_BINARY_DIR}/original/path/to/source/file[s/.c/.cpp/] and add another library 'bag++' with those sources.  I then include a bunch of various subdirectories, one of which I'm currently working in, and while that references the original C source names in the original tree, it doesn't reference any of the C++ sources...  or even the built libraries; it's a target that links from all the original sources directly; with a different path than originally specified even  (original paths would be like add_library( bag M:/sack/src/memlib/sharemem.c .... ) where the paths used in thie project would be add_exeutable( something "../../../../../src/memlib/sharemem.c" )  <br><br><br></span></div></div><br></div><div class="gmail_extra">It's also different whether I do 'make' which ends up trigger the cmake generation which doesn't delete the files.   if I just call 'cmake .' the files do get deleted.  no that's not it either... this time after the build finished I re-saved the cmakelists that I've been working on with no changes, and the files all copied again running with just 'make' </div><div class="gmail_extra"><br></div><div class="gmail_extra">I dunno maybe I'm using some common variable like MORE_SOURCES or EXTRA_SOURCES or something that's somehow related inadvertantly</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>