Build a Visual Studio solution on a target macOS machine remotely - c++

We have a large Visual Studio C++ solution that builds on a Windows machine.
We want to build this application on a macOS system and I’ve read that it’s possible by building/deploying remotely to a target macOS machine from a Windows Visual Studio environment.
Can we do that if we have a Visual studio solution with MSBuild projects? Or it is mandatory to have CMake projects to do that? At least for Linux remote building it seems that CMake isn't mandatory.
We also need to build our application in a CI/CD pipeline so we also need to build from a command line, from what I understood I also read that it should be possible but I don't know how maintainable it is.

For anyone interested, it is possible to remote build on Linux/macOS a MSBuild project without converting it to a CMake project.
Follow this topic for more info.

Related

Cross Platform c++ and Visual Studio 2017?

Is it possible to compile c++ project for Windows, Mac, Linux in Visual Studio 2017?
If not please give me a best way to compile for cross platforms.
No. It is not generally possible to do that with Visual Studio.
In my opinion, the best approach is to configure your CI system to spin up virtual machines running those other operating systems and then perform the build natively in the VM using whatever compiler those systems provide (like GCC & Clang). With the help of a build system like SCons or CMake you can abstract away most of the platform specific compiler bits.
A bonus is that building your code (and running your tests) with multiple compilers is a good way to find bugs.
Visual Studio 2017 added support for building and debugging for Linux, either on a remote machine or using some new built in local subsystem.
A fully cross-platform solution for you, porting your existing projects from VS could be as follows:
Start by converting your entire solution tree to a CMake project (VS 2017 fully supports loading such a project instead of the MS project format of the .sln and .vcxproj files). You can try a conversion tool like this one.
Now that you have a CMake project you can use the CMake build system directly from any other platform. For example on a Virtual Machine running your target OS. There, all you need is configuring your CMake project to build with clang/gcc instead of msvc.
If you prefer staying closer to home for now, in terms of editor/IDE that can be configured to build from the GUI -- kind of like the VS you're used to -- look for a cross-platform editor that supports CMake projects like VS Code.

how to compile cmake on linux so that it can generate vsproj files?

I would like to generate visual studio project files on linux using cmake.
Unfortunately, the visual studio project file generator is not enabled by default on linux.
The cmake build instructions don't mention how to enable this feature on linux. It seems like the generators are enabled based on the host platform cmake is being build. Has anybody a patched cmake to enable the Visual Studio Project Generator on linux ?
We have tools that work on linux and windows for analyzing projects by parsing .sln/.vcxproj files. However generating .sln/.vcxproj files on windows is quite inconvenient as our main development is done on linux/osx.
You cannot generate Visual Studio Solutions under Linux. Nowadays you can generate Visual Studio solutions via ssh to a Windows docker container.

Compiling a C++ project in Visual Studio 2015 created in Linux containing make file

I have some C++ projects/programs which are created in Linux and containing make file as well.
I am using window 7 and visual studio 2015. Today I just installed Ubuntu Linux in virtual box BUT do not really know how to start with and run these programs.
What is the easiest way to run theses projects?
I am very new in C++ programming so a detailed answer is needed.
If you want to work in Visual Studio on Windows a good choice would be Visual C++ for Linux Development (VCLinux) : see tutorial here
The tutorial creates a Visual Studio (VS) project that builds with MSBuild (VS's internal build system). However you can also create a makefile project that will build with make. MSBuild is easier to work with if you know VS or have an existing VS project, make is more flexible and might be the best choice given an existing makefile. You should try some simple examples and decide which works for you.

How to build on TFS a c++ native project targeting Win10 platform

A migrated VS2013 c++ native project to vs2015 targeting Windows 10 (instead of Win 8.1) gives me some issues on the TFS Build Server. I use TFS2013 and the Release12 Build Process Template.
The TFS2013 is installed on a Win10 machine with VS2015 installed on it.
When I run the build the build throws an exception in one of the tasks from the target files saying that it can't compare the numeric number 10.0.4 ... something, because that is the Target Platform set in the native project file. Obviously this is not a number with it's two dots in the version number.
Am I doing something wrong? The TF Build uses MS Build v12 by the way and not the MS Build v14 that ships with VS2015. Do I need to change to MSBuild v14 to make this work? If yes, how can I actually change the used MSBuild version?
Can you provide more information about your exception and build file?
I'm not sure is it realed to MSBuild V14.
If You want to amend the build templates to point to MS Build version 14.0. You can folow below steps :
Use the Default Template (TfvcTemplate.12.xaml) in Visual Studio
Open the template and find the Run MSBuild for Project MSBuild activity.
Set ToolVersion to "14.0".
Set ToolPath to target to MSBuild14 (by default: "C:\Program Files (x86)\MSBuild\14.0\Bin").
Check in this build process template and re-queue the build.
If you still have the same problem after you use MSBuild V14.0.
There is a realted version with 10.0.4... in VS2015. MinimumVisualStudioVersion = 10.0.40219.1 .It means the minimum visual studio version supported in VS2015. Maybe you build a file that created by a visual studio which version is earlier than the version10.0.40219.

Simultaneus development in Visual Studio and a Linux IDE

I am trying to get started with an existing open source project (QuantLib) using Linux operating system. However it seems that most developers use Visual Studio (judging from the project files committed with the source).
Which Linux C++ IDE would be most compatible with VS project files? Is there a way to import/export them, so that I don't have to create my own projects from scratch (and update them every time someone adds a new file)?
EDIT: Its all unmanaged code
In my experience, the best method for doing dual-development on Linux & Windows is to throw away the existing Visual Studio project files and, instead, use CMake to generate the platform-specific build environment. It's capable of outputting Nmake makefiles (for command-line Windows builds), Visual Studio projects, and Linux makefiles. The documentation leaves a bit to be desired but once you have it up and running, it's very easy to maintain.
The FAQ provides installation instructions for MinGW. It seems that there is a GNU Makefile included, so you don't need to mess with Visual Studio project files.
Aparantly they they only build on MAC and Windows.
Instructions here: http://quantlib.org/install/macosx.shtml
But since MAC is basically BSD Unix it should be identical (or with little trouble) to get it up and running on Linux.
The following should work (though you may need to look at the configure options)
1) Install Boost.
2) ./configure
3) make
You'll definitely want to check out Mono, it might be just what you're looking for: http://monodevelop.com/