[CMake] configure_file not regenerating target file

Hugh Sorby h.sorby at auckland.ac.nz
Mon Aug 15 16:54:34 EDT 2016


When I am using GenerateExportHeader from a sub-directory the export header file is not re-generated when the file is deleted.  I have discovered that the configure_file command does not regenerate the target file if the target file is deleted and the command is specified from a sub-directory.  Attached are three cases exhibiting what I have found.  In all cases the following commands exhibit the current behaviour.

#unzip the files and from inside the unzipped content
cd build
cmake ..
make
make clean
make

When building test 1 all commands execute successfully, this test does not use configure_file in a sub-directory.  When building tests 2 and 3 the second 'make' command fails due to a missing header file, both of these tests use configure_file in a sub-directory.

I have tested this on GNU/Linux and OS X using CMake version 3.5.X and 3.5.2 respectively.

So my question is: Is this the expected behaviour?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160815/e2ea118d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_test_1.zip
Type: application/zip
Size: 1049 bytes
Desc: cmake_test_1.zip
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160815/e2ea118d/attachment.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_test_2.zip
Type: application/zip
Size: 1478 bytes
Desc: cmake_test_2.zip
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160815/e2ea118d/attachment-0001.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_test_3.zip
Type: application/zip
Size: 1699 bytes
Desc: cmake_test_3.zip
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160815/e2ea118d/attachment-0002.zip>


More information about the CMake mailing list