c++visual-studiocmakeconvertersvcxproj

Convert CMake.txt to .vcxproj file C++ Visual Studio project


It is any tool or possibility to convert a C++ CMake project into a C++ Visual Studio project with a .vcxproj file?

I need this because we want to offer CMake support at the project I'm working for, but we need to make this conversion first. I searched a lot and didn't find anything about this conversion, at least not yet.

Any opinion or suggestion is highly appreciated. Thank you!


Solution

  • This is what cmake does, generates projects for almost any IDE or build manager.

    So for VS 2017 it can be used like this:

    cd "<path where CMakeLists.txt is located>"
    mkdir build
    cd build
    cmake -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_GENERATOR_PLATFORM=x64 -G "Visual Studio 15 2017" ..
    cmake --open .