Autorcc (autogen) project for Qt5/Visual Studio 2015 target always built
Hi,
When using CMake 3.9.1 with Qt 5.9.1 (64-bit, MSVC 2015), the autogen project for automoc always gets built. I think it also happened with CMake 3.8.2.
I have attached an example project which demonstrates this:
How to Duplicate:
- Unzip the attached file to its own directory, and go into CMakeQt
- From an environment that has
QTDIR
set to a valid Qt install, andcmake
in its path, runmake-shadow.bat
- Go into the newly created Shadow directory
- Open the solution
CMakeQtExample.sln
with Visual Studio - Run "Rebuild All" multiple times
- You'll notice that ExampleOutput_autogen is always out of date and rebuilt, even though no source files have changed
Expected Behaviour:
- If the files referenced in the qrc have not changed since the last time ExampleOutput_autogen has been run, then the ExampleOutput_autogen project should be considered up to date, and not be built.
- If one or more files referenced in the qrc have changed, or ExampleOutput_autogen itself has not been run, then ExampleOutput_autogen is considered out of date and should be rebuilt.
Aside: I note that if I modify the qrc, ZERO_CHECK reruns and it ends up regenerating the dependencies in the vcxproj, which is fine.
Notes:
Looking in ExampleOutput_autogen.vcxproj, we see that the project's build output is:
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Projects\CMakeQt\Shadow\CMakeFiles\ExampleOutput_autogen</Outputs>
However, nothing in the vcxproj actually generates ${output_shadow_dir}\CMakeFiles\ExampleOutput_autogen
, and so Visual Studio always assumes that the autogen target needs to be rerun.
Side note (maybe related, may not be?): After a build, the directories ${output_shadow_dir}\ExampleOutput_autogen
and ${output_shadow_dir}\CMakeFiles\ExampleOutput_autogen.dir
are created, but not ${output_shadow_dir}\CMakeFiles\ExampleOutput_autogen
.