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 Enable auto format on file save using *.astylerc defined in project file for CMake based project
Forum Updated to NodeBB v4.3 + New Features

How to Enable auto format on file save using *.astylerc defined in project file for CMake based project

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 1.2k 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.
  • O Offline
    O Offline
    Oleksandr Malyushytskyy
    wrote on last edited by Oleksandr Malyushytskyy
    #1

    My goal is to have per-project auto formating.
    Enabling Beautifier in QtCreator with artistic style works in case .astylerc file is placed at home folder,
    but I am not able to force usage *.astylerc file in CMake based project.

    I tried to set DISTFILES variable in CMakeList.txt, but this seems has no effect and QtCreator complains that style definition file can't be found.

    Any help is appreciated.

    Best Regards,
    Alex

    1 Reply Last reply
    0
    • O Offline
      O Offline
      Oleksandr Malyushytskyy
      wrote on last edited by
      #2

      Answering my own question: after looking into qtcreator source code I realized that it is sufficient to add myoptions.astylerc file to the project similar to any source file.

      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