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. How to define initial build options with CMakeLists.txt
QtWS25 Last Chance

How to define initial build options with CMakeLists.txt

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
creatorcmake
6 Posts 2 Posters 1.1k 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.
  • C Offline
    C Offline
    cube45
    wrote on last edited by
    #1

    Hi,
    I have a project using CMakeLists.txt that I've been historically building from the CLI, and I wanted to switch to QtCreator.

    I want all my cmake projects to build under build/Windows.x64 and to install all the exe files in bin/Windows.x64. For that, I was using cd build/Windows.x64 && cmake -DCMAKE_INSTALL_PREFIX=C:\Path\To\MyProject\bin\Windows.x64 ../.. to configure that.

    Now, with QtCreator, I can define the build destination by using the GUI, and I will likely be able to pass CMAKE_INSTALL_PREFIX in the same way. However, these settings will be saved in my CMakeLists.txt.user, which I'm not supposed to commit, if I understand correctly.

    Is there a way to configure these options and commit them, so that my coworker has nothing to configure to get up and running with QtCreator?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      No, and I don't see a reason why someone should tell me where and how I should name my build directory.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      C 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        No, and I don't see a reason why someone should tell me where and how I should name my build directory.

        C Offline
        C Offline
        cube45
        wrote on last edited by
        #3

        @Christian-Ehrlicher Thanks for your reply. Coming from plain CMake and being able to define the folder structure was very flexible, and allowed me to define a common structure for the company, in order to automate stuffs (I need the compiled binaries elsewhere in the solution).
        I guess the philosophy of QtCreator is more like "I use the folder that I want, stick with it", and I should adapt my build system to those folders...

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @cube45 said in How to define initial build options with CMakeLists.txt:

          in order to automate stuffs (I need the compiled binaries elsewhere in the solution).

          Using binaries from build dirs is no good idea.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          C 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @cube45 said in How to define initial build options with CMakeLists.txt:

            in order to automate stuffs (I need the compiled binaries elsewhere in the solution).

            Using binaries from build dirs is no good idea.

            C Offline
            C Offline
            cube45
            wrote on last edited by
            #5

            Using binaries from build dirs is no good idea.

            How do you publish your app then?
            I've always taken my exe that were compiled in my install prefix, but I can't specify that either without playing with the QtCreator UI

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @cube45 said in How to define initial build options with CMakeLists.txt:

              How do you publish your app then?

              'make install' is your friend.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              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