[CMake] Issue with qt5_add_resources with unit tests

Scott Bloom scott at towel42.com
Fri Jan 18 19:09:02 EST 2019


I use qt + google test to run tests in my build environment.

The problem I have, is in some (most) of my unit test directories, there will be multiple test executables created, all dependent on the same output file from the add_resources step.

Typically its something like

qt_add_resource( resourceVar resource.qrc )

add_executable( test1 test1main.cpp ${resourceVar} )
add_executable( test2 test2main.cpp ${resourceVar} )

On windows (running the build from cmake through visual studio with parallel building turned on) this sometimes (1 out of 20 or 30 builds or so) causes a race condition, where the dependency on the qrc_resource.cpp is attempted to be generated by both executable dependencies at once.

Not sure what is going on, but wondering if there was any advice out there for this problem

Scott



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190119/a6901e32/attachment.html>


More information about the CMake mailing list