← Back to team overview

kicad-developers team mailing list archive

CMakeLists.txt if() else() endif() suggestions

 

Recently I have spent much time writing cmake scripts, in the preparation of Python
a-mingw-us.

I have found CMake's

    endif( SOME LONG DUPLICATION )

to be both tiresome and a detriment to readability and maintenance of the scripts.

CMake does not require content inbetween endif(  *  ).

As a personal rule of thumb, what I am currently doing is leaving that text out of the
endif() and else() statements if the if() block is say less than 30-40 lines. 

It enhances readability and ease of maintenance.  For exceptionally long blocks, or if
they are nested, then it may bring some value.

FYI,

Dick



Follow ups