Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29292

Conan does not use parent project c++ standard version

    XMLWordPrintable

Details

    • Windows
    • 09a0c0ec1 (11.0)

    Description

      The problem triggers on windows because mingw c++ standard is 14 there, but I think the issue is common to other platforms also.

       

      Having qt creator and conan 2.0.6 installed.

      Create a sample console project, create conanfile.txt at project root. Add following content:

      [requires]
      zxing-cpp/1.4.0 

      Experience a failure on qt creator log message: conan uses standard c+14 while ZXing require c+17.

      Check that project CMakeLists.txt uses c++17. (it was already the case for me)

      Be sad

       

      Solution for me was:

      Move set(CMAKE_CXX_STANDARD 17) before project() call.

      Add following lines in build-folder/.qtc/auto-setup.cmake at line 80:

          if (CMAKE_CXX_STANDARD)
            file(APPEND "${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake"
              "set(CMAKE_CXX_STANDARD \"${CMAKE_CXX_STANDARD}\")\n")
          endif() 

       

      Re-run cmake, enjoy conan with c++17 support

      But, solutions feels pretty dirty.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cadam Cristian Adam
            qdel Deldycke Quentin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes