Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt creator/Cmake - How to add/customize default parameters in CMakeList.txt automatically



  • i have been trying for a real long time to modify Cmake options in Qtcreator in a way that allowed me to change the starting variables and parameters in the auto-generated CMakelists.txt, i saw some posts saying that only qtmake files are automatically added in the projects window, but i also saw that there is a new c++ plugin that actually adds ".h/.hpp" files to a "HEADER" library automatically, i wonder if is not possible to do that with ".c/.cpp" source files or at least change the default "MakeList.txt" to add them automatically, i know this may be a lazy work, but that's why i entered this area, optimize and automate XD

    file, so every project started would have those attributes

    i read that you could change the Cmake configurations, but i didn't see where they were being created

    i also saw i could try to make a "custom step" in the build, but i couldn't figure out how to use the cmake variables to do this.

    my only goal is to make from this: starting alt text

    to this, everytime i start a project: My humble goal
    (even though i heard using "GLOB" isn't a good programming pratice so i'm open to suggestions)

    here's the cmake configuration and build: CMake config, Build


Log in to reply