[Qt-creator] {macOS} Where to set CMAKE_MAKE_PROGRAM?
Aleksandr Chupikov
spider.ch at gmail.com
Fri Apr 10 05:52:37 CEST 2020
Hello Andy.
You set CMAKE_MAKE_PROGRAM to /usr/bin/make instead of ninja executable.
Try set it to /usr/local/bin/ninja and it will work fine.
пт, 10 апр. 2020 г. в 04:00, Andy <asmaloney at gmail.com>:
> I want a solution that applies to all cmake projects, so I tried
> suggestion #3 and added:
>
> CMAKE_MAKE_PROGRAM:FILEPATH=<path to brew's>/ninja
>
> to "CMake Configuration" in the kit.
>
> Now I get a blank UI for my build settings with an error at the top
> "Invalid codemodel file generated by CMake" and this error in the console:
>
> ----
>
> Running <brew path>/cmake/3.17.0_1/bin/cmake <project path> -GNinja
> -DCMAKE_BUILD_TYPE:STRING=Debug
> -DCMAKE_CXX_COMPILER:STRING=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> -DCMAKE_C_COMPILER:STRING=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
> -DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
> -DCMAKE_PREFIX_PATH:STRING=/Users/maloney/dev/Trolltech/Qt-5.x
> -DGIT_SUBMODULE_UPDATE:BOOL=ON
> -DQT_QMAKE_EXECUTABLE:STRING=/Users/maloney/dev/Trolltech/Qt-5.x/bin/qmake
> -DUSE_ASAN:BOOL=ON in
> /private/var/folders/xs/ktjsndz94095_l042qqprtb40000gn/T/QtCreator-mxDtQs/qtc-cmake-ZFkreNHc.
>
> -- The CXX compiler identification is AppleClang 11.0.0.11000033
>
> -- Check for working CXX compiler:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
>
> CMake Error:
>
> The detected version of Ninja (GNU Make 3.81
>
>
> Copyright (C) 2006 Free Software Foundation, Inc.
>
>
> This is free software; see the source for copying conditions.
>
>
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>
>
> PARTICULAR PURPOSE.
>
>
> This program built for i386-apple-darwin11.3.0) is less than the version of
>
> Ninja required by CMake (1.3).
>
>
> CMake Error at
> /Users/maloney/dev/Cellar/cmake/3.17.0_1/share/cmake/Modules/CMakeTestCXXCompiler.cmake:37
> (try_compile):
>
> Failed to generate test project build system.
>
> ----
>
>
> So then I fell back to suggestion #2 and added the brew install path to
> the environment setting of my kit. This resulted in the same error.
>
>
>
> $ ninja --version
> 1.10.0
>
>
> This is the most recent ninja release.
>
>
> This seems way harder than it should be. Maybe a way to set the path to
> ninja explicitly in the interface could be added?
>
>
> ---
> Andy Maloney // https://asmaloney.com
> twitter ~ @asmaloney <https://twitter.com/asmaloney>
>
>
>
> On Wed, Apr 8, 2020 at 3:15 AM Eike Ziller <Eike.Ziller at qt.io> wrote:
>
>>
>>
>> > On Apr 7, 2020, at 21:39, Andy <asmaloney at gmail.com> wrote:
>> >
>> > (Using Qt Creator 4.11.2)
>> >
>> > I've recently switched to building with ninja. I have it installed
>> using homebrew and it is in my PATH.
>> >
>> > When I try to set up a cmake-based project with Creator, I get this:
>> >
>> > CMake Error: CMake was unable to find a build program corresponding to
>> "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
>> different build tool.
>> >
>> > I found this bug report, but it is closed and doesn't seem to provide a
>> solution:
>> >
>> > https://bugreports.qt.io/browse/QTCREATORBUG-17566
>> >
>> > I have tried setting CMAKE_MAKE_PROGRAM in my kit's "Environment", but
>> that didn't do anything.
>> >
>> > Where am I supposed to set this so Creator can find ninja?
>>
>> The issue here is that macOS uses different environments for applications
>> started from Finder / Spotlight / Dock, than what you get in Terminal.
>> There are multiple possible solutions to your issue:
>>
>> - Run Qt Creator from the Terminal environment. E.g. open Terminal, run
>> “open ~/path/to/Qt\ Creator.app”.
>> - Set the PATH in your kit. In the environment setting of the Kit, add
>> “PATH=/usr/local/bin:${PATH}”
>> - Set CMAKE_MAKE_PROGRAM in the kit’s cmake configuration. That’s at the
>> bottom of the kit settings, “CMake Configuration”, where also
>> CMAKE_CXX_COMPILER and other things are set.
>>
>> You could also change the PATH or CMAKE_MAKE_PROGRAM in the corresponding
>> settings in your project’s build configuration.
>>
>> Br, Eike
>>
>> --
>> Eike Ziller
>> Principal Software Engineer
>>
>> The Qt Company GmbH
>> Erich-Thilo-Straße 10
>> D-12489 Berlin
>> eike.ziller at qt.io
>> http://qt.io
>> Geschäftsführer: Mika Pälsi,
>> Juha Varelius, Mika Harjuaho
>> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht
>> Charlottenburg, HRB 144331 B
>>
>> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator
>
--
Александр Чупиков.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20200410/75de193a/attachment-0001.html>
More information about the Qt-creator
mailing list