Qt VSTools versus CMake build
-
Depending which tool I use for the build/deploy I get a different directory structure
VS/MSBuild/Qt VSTools:
CMake:
Now it's an age since I did the VSTools setup for this so it might be a configuration setting in VSTools causing that, but I'd like to understand why it's different, and whether I can tweak VSTools to create a directory structure the same as CMake.
Thanks
David -
P Perdrix has marked this topic as solved
-
P Perdrix has marked this topic as unsolved
-
Hmmm I set that option to plugins in all the projects of my "solution":
that get "deployed", but still end up with:I then changed that option to:
@(_-->'%(OutDir)')/plugins
in every project (even those that were set to not deploy).That got me:
Confused.
-
Making vstools behave like CMake is a bit of shoehorning.
Why not use CMake in the first place?
This part of the documentation shows how to configure vstools. However, there is no checkbox to say "make it look like CMake". You basically have to set custom output directories. If using QML, you have to redirect QML output and define post-build steps to copy all the QML files, qmldir, plugins and what not. The only good news is that you can place all of that into a property sheet that you can re-use for other projects.
Or even share it here - I guess others will be thankful. -
I was simply hoping that I could get the result of my builds the same regardless of how I got there.
As things are, I am going to use CMake for builds that will be released into the big wide world and VS for day to day development builds as that very convenient.
-
In theory, in VS you can "Open folder" with a CMake based project. I never had good luck with this approach. Instead, I'm usually using cmake-gui to configure the CMake project and it'll generate a VS project. (Certainly, you should be able to do this from the command line as well.)
-
@SimonSchroeder Is the cmake-gui any good? Just like git, I always found the command line easier to use....
-
@SimonSchroeder Is the cmake-gui any good? Just like git, I always found the command line easier to use....
@Axel-Spoerl said in Qt VSTools versus CMake build:
Is the cmake-gui any good? Just like git, I always found the command line easier to use....
So far, I have never really learned CMake in depth. I have run into problems with CMake on the command line when reconfiguring with different options (because you forgot one). The cmake-gui (and also ccmake on the command line) seem to do the correct thing in the background. Especially on Windows, the default of the cmake-gui is to generate a VS project (there is even a button to directly open the project from the cmake-gui). For someone without any knowledge of CMake this is a much better starting point (especially for 3rd-party libraries) than using the command line.
One advantage of cmake-gui and ccmake is that you see all the different options that you can change. By default you only see the options of the project's CMakeList.txt, but you can toggle the advanced mode to see all CMake options as well.