[CMake] Visual Studio + Ninja?

Robert Dailey rcdailey.lists at gmail.com
Fri Mar 25 10:42:23 EDT 2016


Thanks for the feedback. I know for sure that you can create
"Makefile" projects in Visual Studio, that do nothing but run
commands. You can even still have files in the project itself, to
allow you to edit those files (even though they won't actually build).

I think CMake can use this functionality already, it just isn't setup
to treat Visual Studio as an extra generator like most other IDEs.

On Mon, Mar 7, 2016 at 3:18 AM, Nagy-Egri Máté Ferenc
<csiga.biga at aol.com> wrote:
> Short version: no.
>
>
>
> Long version: Visual Studio is heavily built around MSBuild as the back-end
> of execution of various tasks. While theoretically it could be done that
> MSBuild only acts as a relay and calls into Ninja scripts, you would lose
> the entire feature set of Solution Explorer, which is quite a large portion
> of the IDE. (Using CMake does preclude using most of it though.) MS is
> looking into deeper CMake integration into their IDE, but the exec back-end
> will most likely be MSBuild.
>
>
>
> Should you really want to achieve this, you would need support from both
> CMake side and VS side. You would need to develop an Add-In with a custom
> project type (CMake+Ninja) and hook up most Solution Explorer entries to
> generate not MSBuild but Ninja script portions. And from CMake you would
> need a generator for this mixed generator type. It could be done, but it’s a
> lot of effort. Given the performance of MSBuild (which is not that bad
> compared to Ninja), the benefits would only be substantial in enourmous
> projects. MS generally looks into increasing build throughput by integrating
> IncrediBuild into their IDE.
>
>
>
>
>
>
>
> Feladó: Robert Dailey
> Elküldve: 2016. március 2., szerda 21:45
> Címzett: CMake
> Tárgy: [CMake] Visual Studio + Ninja?
>
>
>
> Right now I am using a toolchain file to setup cmake to build my C++
>
> code against Android NDK. I also have several custom targets for
>
> running 'ant' commands for the java portions.
>
>
>
> I can use the Ninja generator to generate the build scripts to make my
>
> builds work fine. However, I'd love to be able to use Visual Studio on
>
> Windows as my IDE. However, there is no "Visual Studio - Ninja"
>
> generator that I can see. Is there a way to make Visual Studio wrap
>
> the Ninja scripts and simply execute them? that way I can use it to
>
> edit code and invoke builds.
>
>
>
> Thanks in advance.
>
> --
>
>
>
> Powered by www.kitware.com
>
>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
>
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
>
>
> CMake Support: http://cmake.org/cmake/help/support.html
>
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
>
>
> Follow this link to subscribe/unsubscribe:
>
> http://public.kitware.com/mailman/listinfo/cmake
>
>


More information about the CMake mailing list