Changed behaviour of get_property( ... SOURCE ...) in CMake 3.10 breaks my code.
Hi,
I have a custom target that copies .dll files of depended on shared library targets to my executable in the build-tree when using Visual Studio, so I can run the executables with F5. The custom target has the .dll file as OUTPUT
.
In the case that multiple executables share the same build-tree directory, I can only create one copy-target. Otherwise I will get the cmake error that there already is a rule for the copied dll-file. In order to not add another copy-target for the second executable, I used to call get_property( isGenerated SOURCE ${copied_dll_file} PROPERTY GENERATED)
to see if another target is already deploying that required dll-file.
After the update to CMake 3.10 this call of get_property()
yields the error
CMake Error in libStlUtilities/CMakeLists.txt:
Cannot find source file:
C:/CppLibraries/BuildCppCodeBaseAssistant/Generated/VS2015/BuildStage/Debug/libStlUtilities/libStlUtilities-debug.dll
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
So am I missusing get_property(SOURCE)
or should it be considered a bad CMake behavior?
If the problem is on my side, how can I check if there is already a rule for generating a certain file?
Cheers Knitschi