Build existing C++ solution on linux using Visual Studio 2017

I have have a CMake project, which I sometimes I need to build/debug on Linux. I've tried using "Linux development with C++" to connect to my Virtual Debian machine, but it doesn't work the way I want.

It don't want to create a new project, I only want to generate a makefile using CMake and connect to it.

I've tried to read this, but it doen't tell how to connect to an existing project.






https://www.walgreenslistens.live/
Last edited on
Have you installed cmake on your virtual machine?

Does the virtual machine have a 'shared' view of the files in your visual studio project?

https://cmake.org/
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK.

The sales pitch is you just install cmake on the platform(s) of your choice, point it at your top-level cmake project file and off you go.
Let say that you have all the project files in directory /home/boyce/project
Since it is a CMake project, there is also file CMakeLists.txt

It is recommended to make a separate directory for build, so that built files do not mix with source files.
For example:
mkdir /home/boyce/build
cd /home/boyce/build
cmake /home/boyce/project
make

The cmake will look for /home/boyce/project/CMakeLists.txt and create Makefile in /home/boyce/build

You obviously need both cmake and compiler environment (GCC or Clang, make, etc) installed.
Last edited on
Topic archived. No new replies allowed.