Building Qt5 projects via VS2012 Visual C++ project
-
wrote on 5 Mar 2014, 18:57 last edited by
First of all, is it even possible? It seems like with VS-add-ins and what not, Qt wants to have its fingers throughout the build process.
If I just wanted to identify Qt (i.e. includes, libs, etc) as part of a Visual C++ project, is that all we need to do: i.e. identify those directories and such?
If we need to use the add-in, or even work through QtCreator, we will, but I'd like to run through Visual Studio since that is our preferred IDE.
Thanks in advance...
-
wrote on 5 Mar 2014, 19:48 last edited by
Well for starters, you need a way to launch the "moc compiler":http://qt-project.org/doc/qt-5/moc.html from a VS2012 project.
-
wrote on 5 Mar 2014, 20:11 last edited by
There is that. Which is all orchestrated via the Qt5 add-in?
-
wrote on 5 Mar 2014, 20:16 last edited by
Haven't tried the Qt5 add-in myself (after 20+ years with Visual Studio, for me it feels refreshing using QtCreator :-), but If it succeeds in building a Qt app then it has to run the moc at some point...
-
wrote on 5 Mar 2014, 20:41 last edited by
Okay, well I don't disagree. If there's an intermediate code-generation step, no problem. It seems that there's got to be a way to either: 1) run a pre-build step, or 2) that the Qt5 add-in allows working with QtCreator "PRO" and "PRI" files. Which I see it does; not having done this through Visual Studio before, is it that the add-in wants to work exclusively with PRO and/or PRI files as opposed to native VS2012 project files? It might make sense considering there is potential for generated files. Mainly I just want to know what I'm working with is all... Thank ye...
-
wrote on 5 Mar 2014, 20:44 last edited by
Or perhaps I am not seeing this correctly. It seems the add-in wants already-existing PRO files to work with. Which means that QtCreator is necessarily inescapable. Ugh. That's important to keep in mind as well for our Continuous Integration steps.
-
wrote on 5 Mar 2014, 21:18 last edited by
It's not that bad :-) Qt I think does a good job of trying to integrate with tools like Visual Studio. For example, once you have successfully built your app inside QtCreator, you can continue edit it with Visual Studio (or Notepad..) then to enter another build cycle:
- Start a Developer Command Prompt for VS2012
- CD to the build directory of your app (where there's a makefile)
- Type nmake
and you should have a new .exe.
EDIT: BTW, if you want to test/run the new .exe. you can invoke the qtenv2.bat (found in Qt's installation dir), to establish a path to Qt's DLLs in your Developer Command Prompt.
-
wrote on 6 Mar 2014, 21:30 last edited by
I'm sure it's not. The actual process does not intimidate me. Nor does the fact that Qt involves its own dialect of C++; so suddenly we're locked into the Qt motif, when maybe all we're interested in is basically fancier language standards.
2/8