cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
958 stars 105 forks source link

Support `BYPRODUCTS` keyword for `add_custom_command` #121

Closed d closed 4 years ago

d commented 5 years ago

It was added in CMake 3.2 . It's frequently used when a project uses the Ninja generator because Ninja is quite particular about the exact "outcome" of each target / command.

I am willing to contribute, it seems I can fiddle with https://github.com/cheshirekow/cmake_format/blob/master/cmake_format/parse_funs/add_xxx.py . But I'll need a few pointers about what the coding conventions are, how to run tests locally, and how I should add tests.

cheshirekow commented 5 years ago

Thanks for the suggestion. Certainly cmake-format should understand it's own listfiles ;). If you want to hack on it:

  1. You found the right file to edit
  2. Some developer notes in the README with how to run tests
  3. You can add a test to add_custom_command_tests.py. It's a typical python unittest. You can just add a test function with self.expect_format="""...""" indicating the expected format. The base class will take care of the rest (don't worry about self.expect_parse in the existing test).

But it's also a pretty trivial change and I'm happy to just add it to the next incremental release.