[CMake] Why is cmake deleting my files?

J Decker d3ck0r at gmail.com
Fri Aug 5 15:46:47 EDT 2016


On Fri, Aug 5, 2016 at 11:59 AM, J Decker <d3ck0r at gmail.com> wrote:

> I'm using "MinGW Makefiles" as a generator...
>
>
> 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.
>
> 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.
>
>
> add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>                               DEPENDS ${SOURCE}
>                               COMMAND ${CMAKE_COMMAND} -E
> copy_if_different ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>                               )
>
>
> all outputs get deleted?
>
The file is opened with CreateFile, then

SetDispositionInformationFile
\Device\HarddiskVolume15\mingw64-x86\sack-r\release_solution\core\src\utils\deploy\CMakeFiles\sack_deploy.dir\DependInfo.cmake.tmp
SUCCESS Delete: True

so when the file is closed it's deleted...

Seems to be set from __archive_mktemp(const char *tmpdir)  passing
FILE_FLAG_DELETE_ON_CLOSE; but my files aren't temporary....
that's the only thing that seems to set that flag....

---------
trying to make a simple case; but it's not doing it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160805/b80cb428/attachment.html>


More information about the CMake mailing list