CMake: Use generators for other platforms. How? - linux

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).

Related

What's the difference between ./nuget.exe pack ./PartsUnlimited.Shared.csproj vs nuget pack ./PartsUnlimited.Shared.csproj on mac?

I am following a lab designed for visual studio on windows, on visual studio for mac.
The lab instructions are
./nuget.exe pack ./PartsUnlimited.Shared.csproj but it doesn't build anything and just pops open my finder to the folder where .csproj is in.
I had to do nuget pack ./PartsUnlimited.Shared.csproj for it to build successfully.
What is the difference between these 2 commands?
Is it a shell/executable thing, or specific to nuget, or specific to macos?
With the Windows OS, executable programs are expected to have a .exe file extension. With macOS and *nix operating systems, executable program do not have a special file extension.
When the lab instructions for Windows use nuget.exe, change it to nuget for macOS.
To specifically run the version of NuGet that you downloaded, cd to the directory that contains nuget and run the command as ./nuget. (The lab is using the *nix directory separator in the examples.)

How to use the kotlin compiler in command line which comes with Android Studio?

I have Android studio version 3.4.1. I am able to build Android apps with the Kotlin language. I have heard that we can use Kotlin for creating standalone programs other than building android apps.
So, I want to know how to run the Kotlin compiler of Android studio to compile and run Kotlin programs in the command line, without downloading anything else?. I am using Windows 10 Pro.
I'm on Lubuntu 16.04 LTS, not Windows. But maybe this can still help you.
In my Lubuntu, Android Studio put the Kotlin compiler in directory
$HOME/.AndroidStudio3.4/config/plugins/Kotlin/kotlinc/bin .
So on Windows, make your file manager show hidden files and directories - because on Lubuntu, the "." in ".AndroidStudio3.4" means "hidden".
Go to your home or user directory and find a directory named "AndroidStudio3.4" or similar. Then just follow the path given above.
On Lubuntu, kotlinc (the compiler) isn't executable. If it's the same on Windows, give it execution permission.
I can't imagine that giving this permission affects how Kotlin works in Android Studio. But if you want to be on the safe side, install a separate command line compiler or IntelliJ.
By the way, the Kotlin 1.3.40 REPL crashes (s. issue KT-32085). If you need it, use Kotlin 1.3.31 .

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

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.

How to add libraries in Visual Studio in a Linux cross-compilation project?

I'm new to Linux (rpi 3) and trying to create a window application on it from my Windows PC with Visual Studio. Creating a console-application is no problem, since it doesn't require any libraries.
And the way I understood it is that there is no real standard Linux library for GUIs like Win32 on Windows, so you need to add external libraries.
I went for QT and downloaded already compiled files from qtrpi.com for the rpi3.
I added the lib path for the linker and the include path for the compiler on the projects properties page, but all I get is
1>/home/pi/projects/WindowProject/main.cpp:2:27: fatal error: QtGui\qwindow.h: No such file or directory
1>#include <QtGui\qwindow.h>
1> ^
What am I missing? This works without a problem on normal projects, only that it wouldn't run, since it is for Linux.

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.

Categories

Resources