CMake to create a Visual Studio Code project - linux

Does any know if there are any efforts for cmake to generate a Visual Studio Code project (not to be confused with Visual Studio)? IE
cmake -G "Eclipse CDT4 - Unix Makefiles"
not for eclipse, but for Visual Studio Code? This would be awesome for linux projects.

As already mentioned, VS Code has the vscode-cmake-tools extension to integrate with CMake projects.
See here for documentation on what features it has to offer. You will see that building and debugging within the IDE are supported.
The design of VS Code is very much centered around being simple and extensible, whereas Visual Studio is more of a monolith and includes its own build system for C++. VS Code is not monolithic like that.

Related

Add reference to CMake project in Android Studio

In my particular case, I implemented a cross platform project in C++11 that uses CMake. I initially designed this project to work on PC (Windows, Unix), but now I realized that I can use it on mobile platforms too, without re-implementing the business logic on every platform. The project uses standard libraries: Boost, Poco, OpenSSL, Protobuf.
After a few searches I came to conclusion that this is not even an usual mode to put together native and managed code in Android.
Is it possible to add reference in a Gradle project in Android Studio to a native project that uses CMake?
Can NDK adopt the project in a simple manner if I compile everything in command line (assuming I don't use Android Studio)?
If it is possible, is it recommended at all?
Is it possible to add reference in a Gradle project in Android Studio to a native project that uses CMake?
Since Google announced Android Studio 2.2 that comes with cmake plugin, so it's possible to reference CMake project to android project.
Can NDK adopt the project in a simple manner if I compile everything in command line (assuming I don't use Android Studio)?
In my experience, i compile NDK in separate way and then link the static/shared library (.so file) to be used in android project. I used NDK while developing PDF Reader using mupdf here
Hope this helps.
it would be possible with android studio 2.2, mainly the android plugin for gradle makes it possible. you could look at some examples in:
https://github.com/googlesamples/android-ndk/tree/master-cmake
android studio directly reads-in your cmake scripts -- there is nothing like desktop systems that generate project files for their native IDEs ( Visual Studio or XCode ); so you might have to modify your existing cmake files to eventually make it to work for android studio.
as long as you build to the correct APK, command line or IDE does not matter too much. If you intend to ship source code, having your project ready with an IDE would be attractive.
Please see CMaker_Boost, build the Boost with the CMake at a configure time. Now it is tested on the Linux and Android, gcc and clang. This can be included to the gradle project in the Android Studio. I hope this helps.

Developing code in Visual studio that also runs in Linux

I have developed Visual C++ 2008 code that runs in Windows. I have made it cross platform also so that it runs under Linux.
I am greatly concerned about distributing source code and even just libraries that Linux users can link to.
I have used CMake and Code::Blocks (only in Linux) but it was still developed using Visual Studio 2008 for most development.
The license looked similar for the professional version and the express version. Let me know if binaries can be released to run under Linux and also if it is okay to open source the entire project. I am pretty far into this project. Maybe it should have been done entirely in Linux.
I am also interested to jump to another Windows compiler such as MinGW in addition because of the Visual Studio licensing restrictions. Is this the path that cross platform programs are usually created or can they be created primarily with the professional or express Visual Studio compilers?

how to make visual studio project portable? (where to set includes/libs/preprocessor definitions etc.)

In Visual Studio 2012 I have native C++ project. There are a lot of settings in "Properties" page of this project:
Additional Include Directories
Preprocessor definitions
Additional Library Dependencies
etc.
Later I need to migrate to Linux, and of course I need this settings too. Obviosly Visual Studio project can not be used in Linux
Can you suggest another, platform-independent, mechanism of declaring Additional Include Directories/Preprocessor definitions/Additional Library Dependencies etc. so I can migrate to Linux easier?
cmake might fit your needs: it's a cross platform build system that allows to configure your project in a compiler-independent way. For Windows, it is then able to generate Visual Studio Project files based on that configuration.

beginner: visual basic build cpp

Disclaimer: I am a total beginner to Visual Basic but code a bit in python and Drupal
I need to compile this C++ app (http://sourceforge.net/scm/?type=git&group_id=227253). I succesfully cloned from git, but how do I compile it (get the .exe) in Visual Basic 2008 or 2010 Express?
I have tried this:
1. Open Visual Basic 2008 Express, File, New, Windows Form Application (naive assumption, which should I choose?)
2. Dragged the contents of the git clone into the Solution Explorer Window (which Adds files)
3. Click Build menu
After that I'm lost. Any help is appreciated! This project uses cmake if that helps.
You need Visual C++, not Visual Basic. They are separate languages.
You cannot compile a C++ program in Visual Basic 2008 Express.
You must download Visual C++. Or purchase Visual Studio 2010 Pro (which includes all of VB, C++, C# and the web tools).
If you've got the bandwidth, I'd encourage you to get this .iso:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express-iso
If you're interested in the "bleeding edge", MSVS 2011 beta is available here:
http://www.microsoft.com/visualstudio/11/en-us/downloads
Otherwise, if you just want to compile some C+ code on a Microsoft Visual Studio compiler, get this:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express

Does the WIX heat utility work with Visual C++ projects?

I am just starting to use Wix and would like to use heat to extract the outputs from my Visual C++ projects to source Wix files. This seems to work great for my C# projects, however, whenever I run heat on a C++ project I get an error:
heat project MyProject.vcproj -pog:Binaries -cg MyGroup -nologo -out MySource.wxs
heat.exe : error HEAT5307 : Build failed.
Is this supposed to work or am I doing something wrong? Thanks
Not in Visual Studio 2008 and earlier. C++ projects are not really MSbuild projects (just a shells around vcbuild.exe or something like that) so there is no introspection into those projects. It's quite sad.
Rumor has it that the VC++ team is fixing this in Visual Studio 2010 so hopefully things will start working there.

Resources