Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTCreator builds in temp folder when running CMake
Forum Updated to NodeBB v4.3 + New Features

QTCreator builds in temp folder when running CMake

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 806 Views
  • 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.
  • A Offline
    A Offline
    Amazonasmann
    wrote on last edited by
    #1

    I have a small CMake project which downloads another library, builds and links it to my C++ program(in this case just a main.cpp which tests if the library was built and linked).
    My workflow is as follows: Open QTCreator -> Drag&Drop / opening a CMakeLists.txt -> Select build directories.
    After that, CMake should automically download, build and link a thirdparty library which I need...I store the "install step" of this thirdparty lib in the build directory.
    However, the QtCreator seems to ignore my chosen build directories and builds it in "C:/Users/UserAppData/Local/Temp/QtCreator-npjYSY/qtc-cmake-utoKdxQf" as an example. How can I change this? Is this an error on my side?

    I found this thread, which is very similar to my problem, where in the end the solution is to put in WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} before an execute_process command but in my case I dont use it to call my main CMakeLists.txt.

    Re: QtCreator runs CMake from /tmp directory

    It seems like only after pressing the build button that my chosen build directory is being filled.
    Normally that might not be an issue, but in my case the building of a thirdparty library can fail because the temp folder path name is too long and Windows has issues with that.
    Is there anything I can do to prevent this temp folder behavior?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giulio.foletto
      wrote on last edited by
      #2

      I know this post is quite old, but maybe some folks might find this useful.

      I've had the same problem and I've solved it by changing the build directory of the project (in the project menu on the left) to a folder that already exists. In this way, QtCreator builds directly to that folder, rather than creating a new temporary one. Clearly this is just a workaround but it might be enough for some.

      1 Reply Last reply
      1

      • Login

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