<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile]]></title><description><![CDATA[<p dir="auto">Qt 6.7, Qt Creator v19, Windows 11.<br />
<a href="http://conanfile.py" target="_blank" rel="noopener noreferrer nofollow ugc">conanfile.py</a> with description of required packages.<br />
I want Qt Creator to use conan profile present in repository folder, not default one.<br />
I added</p>
<pre><code>"CONAN_HOST_PROFILE": "${sourceDir}/.conan/profiles/msvc_2019_release",
"CONAN_BUILD_PROFILE": "${sourceDir}/.conan/profiles/msvc_2019_release",
</code></pre>
<p dir="auto">to cacheVariables in one of configurationPresets. Then - in CMakeLists.txt - printed all variable with CONAN inside - and confirm that they are read correcty.<br />
Yet, Qt Creator repeatedly creates default profile and ignore mine.</p>
<p dir="auto">In <code>&lt;build_dir&gt;\conan-dependencies\CMakeLists.txt</code> I've noticed that ...</p>
<pre><code>          conan_profile_detect_default()
          detect_host_profile("C:/dev/my_app/build_my_app_Qt_6.7_msvc2019_Release/conan-dependencies/conan_host_profile")

          set(build_types ${CMAKE_BUILD_TYPE})
          if (CMAKE_CONFIGURATION_TYPES)
            set(build_types ${CMAKE_CONFIGURATION_TYPES})
          endif()

          foreach(type ${build_types})
            conan_install(
              -pr "C:/dev/my_app/build_my_app_Qt_6.7_msvc2019_Release/conan-dependencies/conan_host_profile"
              --build=missing
              -s build_type=${type}
            )
          endforeach()
</code></pre>
<p dir="auto">In other words - it ignores CONAN_HOST/BUILD_PROFILE variables.<br />
I tried to copy <code>conan-dependencies/CMakeLists.txt</code> into my repo as <code>.conan/conan_provider.cmake</code>, substitute -pr with explicit path and add <code>"QT_CONAN_DEPENDENCIES_FILE": "${sourceDir}/.conan/conan_provider.cmake"</code> to configurationPreset.<br />
Still, Qt Creator used the one generated by itself.</p>
<p dir="auto">How to tell Qt Creator to use my conan profiles?</p>
]]></description><link>https://forum.qt.io/topic/164586/qt-creator-cmakepresets-and-conan-can-t-use-own-conan-profile</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 19:41:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164586.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Apr 2026 08:39:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile on Sat, 25 Apr 2026 08:59:59 GMT]]></title><description><![CDATA[<p dir="auto">Update Qt Creator conan mechanism</p>
<p dir="auto">In file c:\Qt\Tools\QtCreator_v20\share\qtcreator\cmake-helper\package-manager.cmake<br />
in line 115 (<code>file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/CMakeLists.txt" "</code>) generates CMakeLists.txt with hardcoded default profile</p>
<p dir="auto">A little bit higher</p>
<pre><code>      set(PROFILE_FILE "")
      if (CONAN_HOST_PROFILE OR CONAN_BUILD_PROFILE)
        if (CONAN_HOST_PROFILE)
          set(PROFILE_FILE "${PROFILE_FILE} -pr:h \"${CONAN_HOST_PROFILE}\"")
        endif()
        if (CONAN_BUILD_PROFILE)
          set(PROFILE_FILE "${PROFILE_FILE} -pr:b \"${CONAN_BUILD_PROFILE}\"")
        endif()
      else()
        set(PROFILE_FILE "-pr:a \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\"")
      endif()
</code></pre>
<p dir="auto">and substitute in line 134 (before adding above lines)<br />
<code>from -pr \\"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\\"</code> to <code>"${PROFILE_FILE}"</code>.</p>
]]></description><link>https://forum.qt.io/post/837958</link><guid isPermaLink="true">https://forum.qt.io/post/837958</guid><dc:creator><![CDATA[SebastianM]]></dc:creator><pubDate>Sat, 25 Apr 2026 08:59:59 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile on Sat, 25 Apr 2026 08:47:43 GMT]]></title><description><![CDATA[<p dir="auto">One of solutions.</p>
<ul>
<li>Copy <code>c:\Qt\Tools\QtCreator\share\qtcreator\cmake-helper\conan_provider.cmake</code> to eg. <code>&lt;build_dir&gt;/conan/conan_provider.cmake</code>.</li>
<li>Edit <code>&lt;build_dir&gt;/conan/conan_provider.cmake</code>
<ul>
<li>Remove lines 616 and 645 (there're comments <code>not needed by Qt Creator, and if not commented it would break the auto-setup feature</code>)</li>
</ul>
</li>
<li>CMakePresets.json should contain
<ul>
<li>disable Package Manager Auto Setup</li>
</ul>
</li>
</ul>
<pre><code class="language-&quot;vendor&quot;">      "qt.io/QtCreator/1.0": {
        "PackageManagerAutoSetup": false,
      }
  },
</code></pre>
<ul>
<li>load modified <strong>conan_provider</strong> - add base <strong>configurationPreset</strong></li>
</ul>
<pre><code>    {
        "name": "conan-provider",
        "hidden": true,
        "cacheVariables": {   
            "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/.conan/conan_provider.cmake"
        }
    },
</code></pre>
<ul>
<li>set <code>CONAN_HOST_PROFILE</code> and <code>CONAN_BUILD_PROFILE</code> in selected <strong>configurationPreset</strong></li>
</ul>
<pre><code>      "cacheVariables": {
        "CONAN_HOST_PROFILE": "${sourceDir}/.conan/profiles/msvc_2019_release",
        "CONAN_BUILD_PROFILE": "${sourceDir}/.conan/profiles/msvc_2019_release",
</code></pre>
]]></description><link>https://forum.qt.io/post/837956</link><guid isPermaLink="true">https://forum.qt.io/post/837956</guid><dc:creator><![CDATA[SebastianM]]></dc:creator><pubDate>Sat, 25 Apr 2026 08:47:43 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile on Tue, 21 Apr 2026 19:18:35 GMT]]></title><description><![CDATA[<p dir="auto">For reference: That's <a href="https://qt-project.atlassian.net/browse/QTCREATORBUG-34388" target="_blank" rel="noopener noreferrer nofollow ugc">QTCREATORBUG-34388</a> now.</p>
]]></description><link>https://forum.qt.io/post/837917</link><guid isPermaLink="true">https://forum.qt.io/post/837917</guid><dc:creator><![CDATA[aha_1980]]></dc:creator><pubDate>Tue, 21 Apr 2026 19:18:35 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile on Tue, 21 Apr 2026 19:11:16 GMT]]></title><description><![CDATA[<p dir="auto">I'll do so.</p>
<p dir="auto">Bug reported.</p>
]]></description><link>https://forum.qt.io/post/837914</link><guid isPermaLink="true">https://forum.qt.io/post/837914</guid><dc:creator><![CDATA[SebastianM]]></dc:creator><pubDate>Tue, 21 Apr 2026 19:11:16 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, CMakePresets and conan - can&#x27;t use own conan profile on Tue, 21 Apr 2026 10:47:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sebastianm">@<bdi>SebastianM</bdi></a> The code of <code>qtc_auto_setup_conan</code> is located at <a href="https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/share/3rdparty/cmake-helper/package-manager.cmake?h=19.0#n35" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">You can create a <code>QtCreatorPackageManager.cmake</code> file in your top source directory where you can:</p>
<pre><code class="language-cmake">
macro(myqtc_auto_setup_conan)
# ...
endmacro()
myqtc_auto_setup_conan()

set(QT_CREATOR_SKIP_CONAN_SETUP ON)
</code></pre>
<p dir="auto">But this copying the whole code.  The better version would be to fix this case.</p>
<p dir="auto">Do create a <a href="https://qt-project.atlassian.net/secure/CreateIssue.jspa?pid=10234" target="_blank" rel="noopener noreferrer nofollow ugc">Qt Creator bug</a> with the details presented here.</p>
]]></description><link>https://forum.qt.io/post/837910</link><guid isPermaLink="true">https://forum.qt.io/post/837910</guid><dc:creator><![CDATA[cristian-adam]]></dc:creator><pubDate>Tue, 21 Apr 2026 10:47:10 GMT</pubDate></item></channel></rss>