Skip to content

Help: get/set_property: Fix SOURCE grammars

Frank Dana requested to merge ferdnyc/cmake:get-property-syntax into master

The grammar for get_property reads:

 get_property(<variable>
              <GLOBAL             |
               DIRECTORY [<dir>]  |
               TARGET    <target> |
               SOURCE    <source> |
                         [DIRECTORY <dir> | TARGET_DIRECTORY <target>] |
               INSTALL   <file>   |
               TEST      <test>   |
               CACHE     <entry>  |
               VARIABLE           >
              PROPERTY <name>
              [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])

But the | after SOURCE <source> is misleading, implying that the DIRECTORY or TARGET_DIRECTORY arguments can be used instead of <source>, not in addition to. It shouldn't be there. (The | at the end of the next line is the correct one.)

The set_property() grammar, meanwhile, contained this:

                SOURCE    [<src1> ...]
                          [DIRECTORY <dirs> ...] |
                          [TARGET_DIRECTORY <targets> ...]

which should be:

                SOURCE    [<src1> ...]
                          [DIRECTORY <dirs> ...]
                          [TARGET_DIRECTORY <targets> ...] |

according to the prose documentation. (Either or both of DIRECTORY, TARGET_DIRECTORY is/are optionally supported following SOURCE.)

Edited by Frank Dana

Merge request reports