Can I use qt5 in visual studio without the add-in? - visual-studio

I understand I can use Qt5 in Visual Studio by using the Visual Studio Add-in for Qt as mentioned in Building Qt5 with Visual Studio 2012 / Visual Studio 2013, and integrating with the IDE.
Is it possible to use Qt5 in Visual Studio without using the Add-in?
Also, I would like to use CMake to generate the Visual Studio Project.

Yup.
I have it working for a pretty complex subdirs template.
Qmake can generate the visual studio solution file and vcxproj, look here:
http://doc.qt.io/qt-5/qmake-platform-notes.html#creating-visual-studio-project-files
What I do is use the Qmake project as the master project, and generate the VS stuff out of folder as temporaries. This prevents Visual studio from tangling up in your source files as well as in the qmake stuff. And you can also port it to other OSs without any hassle. Using this approach, if you want to add files to your project, don't do it through VS, but add it to the .PRO file and re-run qmake.
The only thing (that I've found) is if you change anything that needs to be MOC'd, then re-run qmake.
If you want CMake exclusively then this is a nice guide
http://www.kdab.com/using-cmake-with-qt-5/.
The qmake way is a little cleaner as you don't get all the extra noise of finding Qt libraries as you need in CMake.

Related

How to add an existing cmake project to the Visual Studio Solution

I am using Visual Studio 2017 and I have a solution consisting of several projects mainly in C++. Now I want to add an existing C++ project which using CMake for building to my solution in visual studio and build it along with other projects in solution. Is it possible to do that? FYI, I can build the cmake project separately in Visual Studio.

Visual Studio 2015: How to automate cmake operations?

I'm using Visual Studio 2015 Enterprise Edition. I followed this tutorial
https://www.youtube.com/watch?v=IgvbhyDh8r0
Like Visual Studio creates a .sln file when any new project is saved and then on building it executes it to build the project, in the case of this VTK tutorial, it uses CMake to create the build file .sln for Visual studio to execute. Is there any way I can automate/replace the process of CMake using Visual Studio only?
PS- Just ignore if I have any misunderstanding of the concepts as I'm totally new to this and was not able to find proper documentation on it.
After you've generated a .sln file once, you don't need to run CMake manually again. It hooks itself into ZERO_CHECK project, so it would regenerate the solution every time you change CMakeLists.txt.
But you can't do with VS only, as you have to generate .sln for the first time.

CMake and editing code

I have seen many open-source projects use CMake as their build system. I'd like to use it too, but so far all of my development has been on Visual Studio (2015). This makes me wonder how I'm supposed to edit code when using CMake as a build system? Should I use editors like Vim or emacs, or can I still use Visual Studio (with IntelliSense, if possible)?
You can use CMake to generate Visual Studio solution for you:
https://cognitivewaves.wordpress.com/cmake-and-visual-studio/
But unfortunately the opposite is not possible(or harder than expected), for every new file or include folder generation you will have to update your CMakeLists.txt file respectively(edits do not require updating CMake), looking at the Visual Studio flags while compiling could help this, but the process is still manual:
Using CMake to generate Visual Studio C++ project files
cmake creating visual studio solution on the command line
There are also 3rd Party tools which could facilitate the production cycle for you, including the visual studio to CMake generation, but they are not officially supported

Building a vs2008 solution under vs2010

I'm working on a solution that was developed under vs2008 but was opened and converted to vs2010. I was only given the vs2010 solution so I have to work under vs2010.
Is their a way to build this solution under vs2010 without using any of the vs2010 libs (Microsoft Visual Studio 10.0\VC\libs) and use only those used by vs2008
In Linker > General> Additionnal Library Directories, I've already added a link to the vs2008 libs folder.
You can change the "General > Platform Toolset" property in the Visual Studio 2010 project properties to specify which version MSBuild should use to build your project. The default value is v100, but setting it to v90 would use Visual Studio 2008. This modifies your PATH, BIN, and LIB directories before compiling/linking, so you don't have to change any directory settings manually.
I think, by default only v100, v90, and Windows7.1SDK are supported, but there are tools available to target older Visual Studio versions as well.
See e.g. http://blog.iangoodsell.com/2010/04/visual-studio-2010-and-platform-toolset.html.

Xcode project to Visual Studio

I do most of my home development in Xcode, however my classes require me to use Visual Studio 2010. I am curious if there is some tool that can convert my Xcode project to Visual Studio projects and back and structure the files the way the ides want them to be?
The programs I am writing are OS independent.
You might want to consider using a meta-make such as CMake that can generate both Visual Studio and Xcode project files.
It's probably not as ideal for you since you'll need to write the CMake file and then fix up both the Xcode and Visual Studio projects to your liking (though I believe CMake has some support for project organisation in Visual Studio—not sure about Xcode) rather than doing a straight conversion, but it would allow you to work in Xcode and submit as a Visual Studio project.

Resources