[CMake] How to generate for Ninja + MSVC?

CHEVRIER, Marc marc.chevrier at sap.com
Thu Dec 3 02:53:39 EST 2015


Alternate solution is to define following environment variables:
* CC=cl.exe
* CXX=cl.exe

In this case, CMake will search these compilers rather than the standard choices (starting with c++ and g++ for C++ language).

And you don’t have any longer constraints about your environment.
 
Marc




On 02/12/15 20:39, "CMake on behalf of Robert Dailey" <cmake-bounces at cmake.org on behalf of rcdailey.lists at gmail.com> wrote:

>On Wed, Dec 2, 2015 at 1:37 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
>> On Wed, Dec 2, 2015 at 1:29 PM, Nils Gladitz <nilsgladitz at gmail.com> wrote:
>>> On 02.12.2015 20:18, Robert Dailey wrote:
>>>>
>>>> Is there a way to generate for Ninja using MSVC toolchain? If so, how
>>>> do I do that? Do I need a toolchain file?
>>>
>>>
>>> You can select the Ninja generator (e.g. cmake -G Ninja) while running cmake
>>> from the desired Visual Studio command line environment.
>>
>> This doesn't work unfortunately; it still finds GNU 4.8.3 compiler somehow.
>
>For some reason Strawberry Perl installed gcc/g++ to my PATH. I
>removed this and it's finding MSVC 19 now. Thanks.
>-- 
>
>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