How to add a CMAKE generator to the Linux version of CMAKE? - linux

I am on a Windows machine running the Windows Subsystem for Linux. When I installed the CLI version of CMAKE on the WSL it did not come with any generators for visual studio (i.e. Visual Studio 15 2017 Win64).
How do I add these to the Linux version of CMAKE?

No can do. As per CMake's documentation:
CMake Generators are platform-specific so each may be available only on certain platforms. The cmake(1) command-line tool --help output lists available generators on the current platform.
Even if you built CMake yourself, you wouldn't be able to compile the Visual Studio generators because they rely on the Windows API.

Related

Build Linux-Compatible Executable Using a Visual Studio '19 C++ Project

My understanding is Microsoft added the ability to have the output of a VS project build be a Linux-compatible executable (assuming the code is truly C++) . I added the Linux workload pack to VS19, and changed the Configuration Platform to ARM (is that correct? My only other options are Win32 and x64) . I was then expecting to see an option under Project>Properties>Platform Toolset for "GCC for Windows Subsystem for Linux", but I don't. All I see are two Visual Studio options. Can someone walk me through what other settings I need to change to build this successfully? I'm targeting Ubuntu LTS, if that matters. I'm very new to Linux so if I'm missing something I'd appreciate a heads up.

MSBuild using the wrong cl.exe when building with the 2015 C++ v140 Platform Toolkit

We're currently making a build environment for some of our projects.
In particular we're using VC++ 6.0 and VS2019 to build some of these projects.
When building our C++ project in VS2019 with the Platform Toolkit set to C++ 2015 v140, MSBuild attempts to use the VC++ 6.0 compiler to build the project. If I switch the Toolkit to any other version it builds with the correct cl.exe.
If I remove the VC98 folder that contains cl.exe from the path environment variable I get a cl.exe can't be found error in VS2019.
So I think there's something hardcoding the 2015 toolkit against the VC6.0 cl.exe.
I've tried installing and reinstalling the additional components in the VS Installer but no luck.
Repair of VS2019 didn't fix it either.
I've tried all versions of Visual Studio back to 2013 same issue.
This looks like an MSBuild issue, it's in the wrong location.
Is there any place where I can view the mapping for the toolkits in MSBuild? I couldn't see much in the registry.
The output when I build shows the following, the version is clearly a very old compiler (the VC6.0 one):
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86

Unable to install the VS2015 x64 Native Tools Command Prompt

I have installed the vc14 build tools but I could only get these tools: ARM cross tools, x86 native tools, x86 x64 cross tools. I've been told to install the Visual Studio community edition but nothing changed, I still only get those tools.
When I call vcvarsall.bat amd64 I'm getting the error: The specified configuration type is missing. The tools for the configuration might not be installed.
I am using Windows 7 Ultimate (64bit) and I should be able to compile x64 natively. Perhaps I need a newer OS? Or I need a paid Visual Studio version?

Generate CUDA program dlls under Linux

I know that mingw creates a dll file under windows which can be used to create an exe file. We can execute this exe file in windows. I am working on a cuda project under Linux, but have to deliver the product for Windows as well. Is it possible to generate a dll file using some sort of method under windows?
On windows, MinGW is not supported for CUDA development. The only compiler which is officially supported by CUDA is cl.exe which ships with Microsoft Visual Studio.
More details can be found in System Requirements section of CUDA Getting Started Guide.
Here is an MSDN tutorial which describes how to create a C++ DLL using Visual Studio.
For compiling CUDA kernels, you would have to add CUDA Build Rules in the Build Customizations section of the Visual Studio DLL project.

CMake: Use generators for other platforms. How?

Using CMake, how can one generate Visual Studio project files on Linux?
You can't. You have to run CMake on Windows to generate for Visual Studio.
Usually you would use the Windows GUI program and select what to generate for. But if you do want to generate them on Linux perhaps you could use wine/crossover to run the Windows generator program.
If you want to have the Visual Studio project files then you will need a Windows machine to compile them in any case. Why not just generate them there as well?
I'm running CMake 2.8.6 and these are the generators I have available:
Unix Makefiles = Generates standard UNIX makefiles.
Xcode = Generate Xcode project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
Eclipse CDT4 - Unix Makefiles
= Generates Eclipse CDT 4.0 project files.
KDevelop3 = Generates KDevelop 3 project files.
KDevelop3 - Unix Makefiles = Generates KDevelop 3 project files.
Therefore, no generator for Visual Studio.
From the top of my head, this is not supported by CMake (current version 2.8.6).

Resources