Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Help needed using conan package manager inside QtCreator15.0.0
Forum Updated to NodeBB v4.3 + New Features

Help needed using conan package manager inside QtCreator15.0.0

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
conanqtcreator15cmake
17 Posts 3 Posters 2.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • cristian-adamC Offline
    cristian-adamC Offline
    cristian-adam
    wrote on last edited by
    #8

    Screenshot 2025-05-15 at 08.21.23.png

    As you can see in the picture... it just works 😅

    S 1 Reply Last reply
    1
    • cristian-adamC cristian-adam

      Screenshot 2025-05-15 at 08.21.23.png

      As you can see in the picture... it just works 😅

      S Offline
      S Offline
      StudentScripter
      wrote on last edited by
      #9

      @cristian-adam Hm strange i bet im doing something wrong. Would it be possible to provide your project via github or something with step by step instructions on what commands you use?

      Would really appreciate that, cause having to do this all over and over again manually really sucks. :D

      cristian-adamC 1 Reply Last reply
      0
      • S StudentScripter

        @cristian-adam Hm strange i bet im doing something wrong. Would it be possible to provide your project via github or something with step by step instructions on what commands you use?

        Would really appreciate that, cause having to do this all over and over again manually really sucks. :D

        cristian-adamC Offline
        cristian-adamC Offline
        cristian-adam
        wrote on last edited by
        #10

        @StudentScripter https://github.com/qt-creator/qt-creator/tree/master/tests/manual/cmakeprojectmanager/conan

        I just changed the content of the conanfile.txt as you can see above in the picture.

        S 1 Reply Last reply
        0
        • cristian-adamC cristian-adam

          @StudentScripter https://github.com/qt-creator/qt-creator/tree/master/tests/manual/cmakeprojectmanager/conan

          I just changed the content of the conanfile.txt as you can see above in the picture.

          S Offline
          S Offline
          StudentScripter
          wrote on last edited by
          #11

          @cristian-adam Well i've exactly copied all your files:
          image.png

          But still i get these errors:

          Cannot update Qt version information from C:\Qt\6.8.0\mingw_64\bin\qmake.exe: qmake "C:\Qt\6.8.0\mingw_64\bin\qmake.exe" is not an executable..
          Cannot update Qt version information from C:\Users\Musik\Documents\Qt\6.8.0\msvc2022_arm64\bin\qmake.exe: Timeout running "C:\Users\Musik\Documents\Qt\6.8.0\msvc2022_arm64\bin\qmake.exe"..
          [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Users/Musik/Desktop/conan -B C:/Users/Musik/Desktop/conan/build/Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug "-DQT_QML_GENERATE_QMLLS_INI:BOOL=ON" "-DCMAKE_PREFIX_PATH:PATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64/bin/qmake.exe" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" in C:\Users\Musik\Desktop\conan\build\Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug.
          [cmake] -- The C compiler identification is Clang 17.0.6
          [cmake] -- The CXX compiler identification is Clang 17.0.6
          [cmake] -- Detecting C compiler ABI info
          [cmake] -- Detecting C compiler ABI info - done
          [cmake] -- Check for working C compiler: C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe - skipped
          [cmake] -- Detecting C compile features
          [cmake] -- Detecting C compile features - done
          [cmake] -- Detecting CXX compiler ABI info
          [cmake] -- Detecting CXX compiler ABI info - done
          [cmake] -- Check for working CXX compiler: C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe - skipped
          [cmake] -- Detecting CXX compile features
          [cmake] -- Detecting CXX compile features - done
          [cmake] CMake Error at CMakeLists.txt:6 (find_package):
          [cmake]   By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
          [cmake]   asked CMake to find a package configuration file provided by "fmt", but
          [cmake]   CMake did not find one.
          [cmake] 
          [cmake]   Could not find a package configuration file provided by "fmt" with any of
          [cmake]   the following names:
          [cmake] 
          [cmake]     fmtConfig.cmake
          [cmake]     fmt-config.cmake
          [cmake] 
          [cmake]   Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
          [cmake]   to a directory containing one of the above files.  If "fmt" provides a
          [cmake]   separate development package or SDK, be sure it has been installed.
          [cmake] 
          [cmake] 
          [cmake] -- Configuring incomplete, errors occurred!
          [cmake] 
          [cmake] The command "C:\Program Files\CMake\bin\cmake.exe -S C:/Users/Musik/Desktop/conan -B C:/Users/Musik/Desktop/conan/build/Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug "-DQT_QML_GENERATE_QMLLS_INI:BOOL=ON" "-DCMAKE_PREFIX_PATH:PATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64/bin/qmake.exe" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG"" terminated with exit code 1.
          [cmake] 
          [cmake] Elapsed time: 00:02.
          
          cristian-adamC 1 Reply Last reply
          0
          • S StudentScripter

            @cristian-adam Well i've exactly copied all your files:
            image.png

            But still i get these errors:

            Cannot update Qt version information from C:\Qt\6.8.0\mingw_64\bin\qmake.exe: qmake "C:\Qt\6.8.0\mingw_64\bin\qmake.exe" is not an executable..
            Cannot update Qt version information from C:\Users\Musik\Documents\Qt\6.8.0\msvc2022_arm64\bin\qmake.exe: Timeout running "C:\Users\Musik\Documents\Qt\6.8.0\msvc2022_arm64\bin\qmake.exe"..
            [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Users/Musik/Desktop/conan -B C:/Users/Musik/Desktop/conan/build/Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug "-DQT_QML_GENERATE_QMLLS_INI:BOOL=ON" "-DCMAKE_PREFIX_PATH:PATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64/bin/qmake.exe" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" in C:\Users\Musik\Desktop\conan\build\Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug.
            [cmake] -- The C compiler identification is Clang 17.0.6
            [cmake] -- The CXX compiler identification is Clang 17.0.6
            [cmake] -- Detecting C compiler ABI info
            [cmake] -- Detecting C compiler ABI info - done
            [cmake] -- Check for working C compiler: C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe - skipped
            [cmake] -- Detecting C compile features
            [cmake] -- Detecting C compile features - done
            [cmake] -- Detecting CXX compiler ABI info
            [cmake] -- Detecting CXX compiler ABI info - done
            [cmake] -- Check for working CXX compiler: C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe - skipped
            [cmake] -- Detecting CXX compile features
            [cmake] -- Detecting CXX compile features - done
            [cmake] CMake Error at CMakeLists.txt:6 (find_package):
            [cmake]   By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
            [cmake]   asked CMake to find a package configuration file provided by "fmt", but
            [cmake]   CMake did not find one.
            [cmake] 
            [cmake]   Could not find a package configuration file provided by "fmt" with any of
            [cmake]   the following names:
            [cmake] 
            [cmake]     fmtConfig.cmake
            [cmake]     fmt-config.cmake
            [cmake] 
            [cmake]   Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
            [cmake]   to a directory containing one of the above files.  If "fmt" provides a
            [cmake]   separate development package or SDK, be sure it has been installed.
            [cmake] 
            [cmake] 
            [cmake] -- Configuring incomplete, errors occurred!
            [cmake] 
            [cmake] The command "C:\Program Files\CMake\bin\cmake.exe -S C:/Users/Musik/Desktop/conan -B C:/Users/Musik/Desktop/conan/build/Desktop_Qt_6_9_0_llvm_mingw_64_bit-Debug "-DQT_QML_GENERATE_QMLLS_INI:BOOL=ON" "-DCMAKE_PREFIX_PATH:PATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Users/Musik/Documents/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Users/Musik/Documents/Qt/6.9.0/llvm-mingw_64/bin/qmake.exe" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG"" terminated with exit code 1.
            [cmake] 
            [cmake] Elapsed time: 00:02.
            
            cristian-adamC Offline
            cristian-adamC Offline
            cristian-adam
            wrote on last edited by
            #12

            @StudentScripter It looks like you don't have auto-setup configured. There is no "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=... parameter to the CMake call.

            Thats the part where Qt Creator injects a piece of CMake code to the project, which does the part with conan install and setting up the paths for find_package to find libfmt.

            S 1 Reply Last reply
            0
            • cristian-adamC cristian-adam

              @StudentScripter It looks like you don't have auto-setup configured. There is no "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=... parameter to the CMake call.

              Thats the part where Qt Creator injects a piece of CMake code to the project, which does the part with conan install and setting up the paths for find_package to find libfmt.

              S Offline
              S Offline
              StudentScripter
              wrote on last edited by StudentScripter
              #13

              @cristian-adam How to set that correcly and to what value should i probably set it?

              ALSO big thanks for you affords so far!<3

              cristian-adamC 1 Reply Last reply
              0
              • S StudentScripter

                @cristian-adam How to set that correcly and to what value should i probably set it?

                ALSO big thanks for you affords so far!<3

                cristian-adamC Offline
                cristian-adamC Offline
                cristian-adam
                wrote on last edited by
                #14

                @StudentScripter You don't need to set it manually.

                The absence of it means that the Auto-Setup is disabled.

                I've made a screencast for you below:
                alt text

                (Note that I have configured the project before, that's why spdlog was quickly found. But I've deleted the build and CMakeLists.txt.user file)

                S 2 Replies Last reply
                1
                • cristian-adamC cristian-adam

                  @StudentScripter You don't need to set it manually.

                  The absence of it means that the Auto-Setup is disabled.

                  I've made a screencast for you below:
                  alt text

                  (Note that I have configured the project before, that's why spdlog was quickly found. But I've deleted the build and CMakeLists.txt.user file)

                  S Offline
                  S Offline
                  StudentScripter
                  wrote on last edited by
                  #15

                  @cristian-adam Thanks no everything is working. <3 Really appreciate that you took the time. I'll mark this post as solved for others who may come across this post. So my learnings are:

                  Solution/Learnings

                  -Conan 2.0 + Qt Creator

                  .

                  1. You don't need the conan plugin for Qt Creator --> as for now March 2025; QT Version 6.9, Creator Version 16.0.0 conanfile 2.0 support for .txt and .py is build in

                  2. Enable packagemanager auto setup in the cmake settings of your qt creator project

                  3. If everything works fine you don't have to enter any conan command manual

                  For anyone to copy and paste here the small demofiles for spdlog:

                  conanfile.py:

                  from conan import ConanFile
                  from conan.tools.cmake import cmake_layout
                  
                  
                  class ExampleRecipe(ConanFile):
                      settings = "os", "compiler", "build_type", "arch"
                      generators = "CMakeDeps", "CMakeToolchain"
                  
                      def requirements(self):
                          self.requires("spdlog/1.15.1")
                  
                      def layout(self):
                          cmake_layout(self)
                  
                  

                  main.cpp:

                  
                  #include <iostream>
                  #include <spdlog/spdlog.h>
                  #include <spdlog/sinks/basic_file_sink.h>
                  #include <spdlog/sinks/rotating_file_sink.h>
                  #include <memory>
                  
                  int main() {
                      try {
                          // Einfacher Konsolen-Logger
                          spdlog::info("Welcome to spdlog!");
                          spdlog::warn("This is a warning!");
                          spdlog::error("This is an error message!");
                          spdlog::debug("This debug message won't show unless you change the log level.");
                  
                          // Log-Level auf debug setzen
                          spdlog::set_level(spdlog::level::debug);
                          spdlog::debug("Now debug messages are visible!");
                  
                          // Logger, der in eine Datei schreibt
                          auto file_logger = spdlog::basic_logger_mt("file_logger", "logs/basic_log.txt");
                          file_logger->info("Logging to basic file.");
                          file_logger->warn("Some warning in file log.");
                  
                          // Rotating file logger (max 5 MB pro Datei, max 3 Dateien)
                          auto rotating_logger = spdlog::rotating_logger_mt("rot_logger", "logs/rotating_log.txt", 1048576 * 5, 3);
                          rotating_logger->info("This is a rotating logger.");
                          rotating_logger->error("Something went wrong in rotating logger.");
                  
                          // Log-Pattern ändern
                          spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] %v [%l]");
                          spdlog::info("Using custom log pattern now.");
                  
                          // Flushing
                          spdlog::flush_on(spdlog::level::info);
                      } catch (const spdlog::spdlog_ex& ex) {
                          std::cerr << "Log initialization failed: " << ex.what() << std::endl;
                          return 1;
                      }
                  }
                  
                  

                  CMakeLists.cpp:

                  cmake_minimum_required(VERSION 3.24)
                  
                  set(CMAKE_CXX_STANDARD 20)
                  project(spdlogexample)
                  
                  find_package(spdlog REQUIRED)
                  
                  add_executable(spdlogexample main.cpp)
                  target_link_libraries(spdlogexample PRIVATE spdlog::spdlog)
                  
                  
                  install(TARGETS spdlogexample)
                  
                  
                  1 Reply Last reply
                  2
                  • S StudentScripter has marked this topic as solved on
                  • S StudentScripter has marked this topic as solved on
                  • cristian-adamC cristian-adam

                    @StudentScripter You don't need to set it manually.

                    The absence of it means that the Auto-Setup is disabled.

                    I've made a screencast for you below:
                    alt text

                    (Note that I have configured the project before, that's why spdlog was quickly found. But I've deleted the build and CMakeLists.txt.user file)

                    S Offline
                    S Offline
                    StudentScripter
                    wrote on last edited by
                    #16
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      Vladislav Navrocky
                      wrote last edited by Vladislav Navrocky
                      #17

                      The error occurs because the auto-setup script created by QtCreator (build/.qtc/package-manager/conan_provider.cmake) cannot determine the current C++ standard. Take a look at the function function(detect_host_profile output_file).

                      The error is fixed by moving the C++ standard setting to the very beginning of your CMakeLists.txt script, before the project keyword.

                      For example, the correct CMakeLists.txt:

                      cmake_minimum_required(VERSION 3.16)
                      
                      # it is important that the standard be defined before the project keyword
                      set(CMAKE_CXX_STANDARD 20)
                      set(CMAKE_CXX_STANDARD_REQUIRED ON)
                      
                      project(i18n_strict LANGUAGES CXX)
                      
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved