The pull-request can be seen here, PR2477. I have also created a README.md which tries to outline the intent of splitting out the logic.
In general, I am open to any critique on the system used. I have simply created macros with practical names.
I elected to put each into its own file because I've run into issues in the past where large changes to CMakeLists.txt caused merge conflicts in git. Hopefully giving each macro its own file can reduce these conflicts.
I have two main areas that I would say I am "concerned" about, or perhaps put better that I am seeking input on:
- The use of file(GLOB...) and foreach(..) in cMake/FreeCAD_Helpers/CMakeLists.txt
- The seemingly random naming conventions used for the various files in cMake/FreeCAD_Helpers
- This choice broke down to one of two:
- Use the file(GLOB...) technique, which should allow any future developer to simply drop their file in cMake/FreeCAD_Helpers and go about their business
- Individually add each new file to cMake/FreeCAD_Helpers/CMakeLists.txt
- The filenames were chosen to match the macro names in order to remain descriptive. However, I have considered prepending each filename with an ordering prefix, i.e. "10_CompilerChecksAndSetups.cmake", "15_ConfigureCMakeVariables.cmake" etc... This has the effect of allowing us to order the filenames in cMake/FreeCAD_Helpers in the same order as they appear in CMakeLists.txt. However, I could think of no practical usefulness for this feature aside from my own OCD as well as making it somewhat easier to see the parallels between the contents of cMake/FreeCAD_Helpers and CMakeLists.txt.