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. Generating QtCreator project for CMakeLists.txt from command line
Forum Updated to NodeBB v4.3 + New Features

Generating QtCreator project for CMakeLists.txt from command line

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 2.7k Views 2 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.
  • NikolausDemmelN Offline
    NikolausDemmelN Offline
    NikolausDemmel
    wrote on last edited by NikolausDemmel
    #1

    Hi,

    I was woundering if it is at all possible to generate a QtCreator project for a given CMakeLists.txt from command line? I.e. generation of the CMakeLists.txt.user from command line while giving some parameters, such as the desired configurations and according build directories.

    My use case is the following.

    Background:
    I am developing software within the ROS framework. One of the many aspects of ROS is the catkin build system, which makes it easy for you to manage many different ROS packages and their depedencies. For example, the latest ROS distribution "Jade" has almost 1000 packages released. catkin is CMake-based, and as such in a typical ROS workspace you might have 10s or even >100 CMake projects.

    Now while you can use catkin with the standard CMake workflow of mkidr build && cd build && cmake ../src && make, there also exists a command line tool suite catkin_tools, which aids you in building all catkin/CMake projects in your workspace independently, while still respecting the interdependencies. As such, it manages the cmake invocations and build-locations for each package. It also has support for profiles, such that you could handle different configurations at the same time (debug, relase, ...).

    My current workflow using this together with QtCreator is the following: I use catkin build to compile all my packages, which also entails calling cmake in a specific build directory for each package. Then, whenever I want to work on a specific package, I open the CMakeLists.txt as a project in QtCreator, but need to manually select the correct build directory. If I have different profiles, I need to select each of the build directories for the different configurations.

    Desired workflow:
    It would be nice if for a catkin workspace such as described above, I could generate QtCreator projects for all packages with the appropriate build directories set up. For example, to do the same for Eclipse, I can call something like catkin build --force-cmake -G"Eclipse CDT4 - Unix Makefiles", and then import the generated projects into Eclipse, which is extremely convenient. But since IMHO QtCreator is the superiour C++ IDE (at least for my needs) and I also like the CMake integration much better, it would be great to be able to generate these project files without user intervention.

    I think we really only would need to generate the CMakeLists.txt.user file. The .cbp files generated by cmake itself could be created when the user first opens the project in QtCreator and invokes cmake through QtCreator (note that at this point all the build directories with cmake-cache etc already exist from the original catkin build call). The only parameters I currently would want to pass are the configurations and according build-directories.

    Does anyone have any input on what would the best way to achieve this? Should this be a standalone script/application, or somehow built into qtcreator with a specific command line invocation? Would it be easier to utilise the cmakeproject-related classes implemented in QtCreator, or generate the xml independently? Is there some kind of spec describing the contents of CMakeLists.txt.user?

    Any comments or insights are welcome.

    Cheers,
    Niko

    P.S.: A bit of praise: I'm loving the CMake improvements in QtCreator 4.0. It just keeps getting better and better! Thanks for all.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I'd recommend bringing this to the Qt Creator mailing list You'll find there Qt Creator's developers/maintainers. This forum is more user oriented.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      NikolausDemmelN 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        I'd recommend bringing this to the Qt Creator mailing list You'll find there Qt Creator's developers/maintainers. This forum is more user oriented.

        NikolausDemmelN Offline
        NikolausDemmelN Offline
        NikolausDemmel
        wrote on last edited by NikolausDemmel
        #3

        @SGaist Thanks for your response. I posted to the mailing list.

        For future reference: http://lists.qt-project.org/pipermail/qt-creator/2016-March/005621.html

        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