Qt World Summit: Submit your Presentation

QtCreator and call conan inside the ide - cmake: command not found

  • I'am trying to use conan package manager with QtCreator and cmake with https://github.com/conan-io/cmake-conan wrapper, so I have installed cmake 3.17.3 and conan using brew

    After that conan downloaded all dependencies of sdl2_image but it was not able to find cmake for build the library with errors:

    sdl2_image/2.0.5@bincrafters/stable: Calling build()
    /bin/sh: cmake: command not found

    cmake command from QtCreator

    Running /usr/local/Cellar/cmake/3.17.3/bin/cmake /Users/kirillprohorenkov/Documents/Projects/cpp_starter_project '-GCodeBlocks - Unix Makefiles' -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -DCMAKE_C_COMPILER:STRING=/usr/bin/clang -DCMAKE_PREFIX_PATH:STRING= -DCPP_STARTER_USE_SDL:BOOL=ON -DENABLE_TESTING:BOOL=OFF -DWARNINGS_AS_ERRORS:BOOL=OFF in /Users/kirillprohorenkov/Documents/Projects/cpp_starter_project/build

    So, I've tried to perform these command by hand:

    cd build && cmake /Users/kirillprohorenkov/Documents/Projects/cpp_starter_project '-GCodeBlocks - Unix Makefiles' -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ -DCMAKE_C_COMPILER:STRING=/usr/bin/clang -DCMAKE_PREFIX_PATH:STRING= -DCPP_STARTER_USE_SDL:BOOL=ON -DENABLE_TESTING:BOOL=OFF  ../

    and library has built successfully.

    Used version of software:

    • Operating System Mac os x 10.14.6
    • Compiler+version: Apple LLVM version 10.0.1 (clang-1001.0.46.4)
    • Conan version: 1.25.2
    • Qtcreator 4.11.0

    Does QtCreator remove cmake from PATH when calling from inside the IDE?
    Any workaround and etc?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    One thing you can try is to nuke the build folder, the .pro.user file in your project directory and re-open the project in Qt Creator.

    IIRC, you can also set the cmake version used in your Kit. You should check what you have there.

  • @SGaist clear the build folder, reopen IDE are the first things I have done.
    I also tried to call cmake version inside of QtCreator(in CmakeLists.txt) like this:

    execute_process(COMMAND cmake --version)

    but the version string was empty. My suggest is problem with conan in it

  • Lifetime Qt Champion

    Did you check whether the cmake path was set in your kit ?

  • @SGaist yes, cmake path in kit is /usr/local/bin/cmake
    Cmake was detected by QtCreator

  • Lifetime Qt Champion

    Can you provide a minimal project that shows that behavior ?

Log in to reply