[CMake] Visual Studio Dependencies broken for custom target sln

Jörg Kreuzberger j.kreuzberger at procitec.de
Thu Feb 19 03:44:38 EST 2015


Hi!

I have a problem with visual studio dependencies that i actually do not understand. Perhaps you can give me an hint.
I have made my libs, apps with cmake successfull and everything is fine with any SINGLE Configuration generator, even
jom nmake makefiles, linux, etc.

For building my apps serveral custom targets and custom commands are defined to build additinal files (e.g. qm files and others) and dependencies added with add_dependencies()

To have shortcuts for the build (that means build and install only a few of all apps) i have also made a custom target (empty) named e.g. "buildNetwork" with dependencies to some other targets (apps) for compilation and install in an extra CMakeLists.txt with seperate project() name

Now the question:

if i use the top-level-solution in ${CMAKE_BINARY_DIR}, the custom target "buildNetwork" builds with all dependencies, that means with all applications and their custom targets( e.g. for qm file creation).

if i use the solution for my "buildNetwork" custom target, the sln includes all applications, custom targets.
But if i build, it only builds the dependent applications, but not their dependent custom targets.
That means e.g. if i use this solution, i do not get any qm files. It tries to build them, but they are excluded in the configuration of the sln (skipped during build)

Workaround seems to be that i must use the ALL keyword in my custom targets, but i thought i do not need this and handle it via the explicit set dependencies, like it worked for the other generators

Cmake Version used is 3.0.0 and Generator is VS 2013 x64



More information about the CMake mailing list