From beb50c529e406fd6cfbc5ded82068baee5d91cf8 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 27 Jan 2021 21:49:34 +0000 Subject: [PATCH] Reorganize the CMake folder to separate build and configure steps The BuildSteps folder now contains the CMake scripts that are called during the build process as individual stages, while the root CMakeModules directory contains the CMake files used during the configuration phase. --- .gitignore | 1 + CMakeModules/{ => BuildSteps}/CreateDocsetDoxyfile.cmake | 0 CMakeModules/{ => BuildSteps}/Html2C.cmake | 0 CMakeModules/{ => BuildSteps}/LemonParserGenerator.cmake | 0 CMakeModules/{ => BuildSteps}/PNG2cpp.cmake | 0 CMakeModules/{ => BuildSteps}/TokenList2DsnLexer.cmake | 0 CMakeModules/{ => BuildSteps}/Txt2C.cmake | 0 .../{ => BuildSteps}/WritePlatformMetadata_linux.cmake | 0 CMakeModules/{ => BuildSteps}/WriteVersionHeader.cmake | 0 CMakeModules/{ => BuildSteps}/markdown2C.cmake | 0 CMakeModules/Functions.cmake | 6 +++--- Documentation/docset/CMakeLists.txt | 2 +- bitmaps_png/CMakeLists.txt | 4 ++-- common/CMakeLists.txt | 2 +- eeschema/CMakeLists.txt | 8 ++++---- pcb_calculator/CMakeLists.txt | 8 ++++---- pcbnew/CMakeLists.txt | 4 ++-- resources/CMakeLists.txt | 2 +- 18 files changed, 19 insertions(+), 18 deletions(-) rename CMakeModules/{ => BuildSteps}/CreateDocsetDoxyfile.cmake (100%) rename CMakeModules/{ => BuildSteps}/Html2C.cmake (100%) rename CMakeModules/{ => BuildSteps}/LemonParserGenerator.cmake (100%) rename CMakeModules/{ => BuildSteps}/PNG2cpp.cmake (100%) rename CMakeModules/{ => BuildSteps}/TokenList2DsnLexer.cmake (100%) rename CMakeModules/{ => BuildSteps}/Txt2C.cmake (100%) rename CMakeModules/{ => BuildSteps}/WritePlatformMetadata_linux.cmake (100%) rename CMakeModules/{ => BuildSteps}/WriteVersionHeader.cmake (100%) rename CMakeModules/{ => BuildSteps}/markdown2C.cmake (100%) diff --git a/.gitignore b/.gitignore index 1323ef01be..1782791cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,4 @@ i18n_status.csv # Don't actually ignore any of these files, since we need them in the tree !resources/linux/icons/hicolor/**/**/* +!CMakeModules/**/* diff --git a/CMakeModules/CreateDocsetDoxyfile.cmake b/CMakeModules/BuildSteps/CreateDocsetDoxyfile.cmake similarity index 100% rename from CMakeModules/CreateDocsetDoxyfile.cmake rename to CMakeModules/BuildSteps/CreateDocsetDoxyfile.cmake diff --git a/CMakeModules/Html2C.cmake b/CMakeModules/BuildSteps/Html2C.cmake similarity index 100% rename from CMakeModules/Html2C.cmake rename to CMakeModules/BuildSteps/Html2C.cmake diff --git a/CMakeModules/LemonParserGenerator.cmake b/CMakeModules/BuildSteps/LemonParserGenerator.cmake similarity index 100% rename from CMakeModules/LemonParserGenerator.cmake rename to CMakeModules/BuildSteps/LemonParserGenerator.cmake diff --git a/CMakeModules/PNG2cpp.cmake b/CMakeModules/BuildSteps/PNG2cpp.cmake similarity index 100% rename from CMakeModules/PNG2cpp.cmake rename to CMakeModules/BuildSteps/PNG2cpp.cmake diff --git a/CMakeModules/TokenList2DsnLexer.cmake b/CMakeModules/BuildSteps/TokenList2DsnLexer.cmake similarity index 100% rename from CMakeModules/TokenList2DsnLexer.cmake rename to CMakeModules/BuildSteps/TokenList2DsnLexer.cmake diff --git a/CMakeModules/Txt2C.cmake b/CMakeModules/BuildSteps/Txt2C.cmake similarity index 100% rename from CMakeModules/Txt2C.cmake rename to CMakeModules/BuildSteps/Txt2C.cmake diff --git a/CMakeModules/WritePlatformMetadata_linux.cmake b/CMakeModules/BuildSteps/WritePlatformMetadata_linux.cmake similarity index 100% rename from CMakeModules/WritePlatformMetadata_linux.cmake rename to CMakeModules/BuildSteps/WritePlatformMetadata_linux.cmake diff --git a/CMakeModules/WriteVersionHeader.cmake b/CMakeModules/BuildSteps/WriteVersionHeader.cmake similarity index 100% rename from CMakeModules/WriteVersionHeader.cmake rename to CMakeModules/BuildSteps/WriteVersionHeader.cmake diff --git a/CMakeModules/markdown2C.cmake b/CMakeModules/BuildSteps/markdown2C.cmake similarity index 100% rename from CMakeModules/markdown2C.cmake rename to CMakeModules/BuildSteps/markdown2C.cmake diff --git a/CMakeModules/Functions.cmake b/CMakeModules/Functions.cmake index c2c4996f99..7ffe84620e 100644 --- a/CMakeModules/Functions.cmake +++ b/CMakeModules/Functions.cmake @@ -40,13 +40,13 @@ function( make_lexer outputTarget inputFile outHeaderFile outCppFile enum ) -DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/${inputFile} -DoutHeaderFile=${CMAKE_CURRENT_BINARY_DIR}/${outHeaderFile} -DoutCppFile=${CMAKE_CURRENT_BINARY_DIR}/${outCppFile} - -P ${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/TokenList2DsnLexer.cmake COMMENT "TokenList2DsnLexer.cmake creating: ${outHeaderFile} and ${outCppFile} from ${inputFile}" DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${inputFile} - ${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake + ${CMAKE_MODULE_PATH}/BuildSteps/TokenList2DsnLexer.cmake ) target_sources( ${outputTarget} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${outCppFile} ) @@ -84,7 +84,7 @@ function( generate_lemon_grammar TGT GRAMMAR_DIR CONSUMING_FILE GRAMMAR_FILE ) -DLEMON_TEMPLATE=${LEMON_TEMPLATE} -DGRAMMAR_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${GRAMMAR_FILE} -DGRAMMAR_DIR=${CMAKE_CURRENT_BINARY_DIR}/${GRAMMAR_DIR} - -P ${CMAKE_MODULE_PATH}/LemonParserGenerator.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/LemonParserGenerator.cmake COMMENT "Running Lemon on ${GRAMMAR_FILE} to generate ${GRAMMAR_DIR}/${GRAMMAR_BASE}.c" DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/${GRAMMAR_FILE} diff --git a/Documentation/docset/CMakeLists.txt b/Documentation/docset/CMakeLists.txt index e6b732ebf4..b6f1d84298 100644 --- a/Documentation/docset/CMakeLists.txt +++ b/Documentation/docset/CMakeLists.txt @@ -63,7 +63,7 @@ if(DOXYGEN_FOUND AND DOXYTAG2ZEALDB AND SED) -DDOCSET_DOXYFILE=${DOCSET_DOXYFILE} -DOUTPUT_DIRECTORY="${CMAKE_CURRENT_BINARY_DIR}/doxygen" -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} - -P ${CMAKE_MODULE_PATH}/CreateDocsetDoxyfile.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/CreateDocsetDoxyfile.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ OUTPUT ${DOCSET_DOXYFILE} DEPENDS ${CMAKE_BINARY_DIR}/kicad_build_version.h diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 258db38cdb..690b768099 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -647,9 +647,9 @@ function( png2cpp inputFile outFile ) OUTPUT ${outFile} COMMAND ${CMAKE_COMMAND} -DinputFile=${inputFile} -DoutCppFile=${outFile} - -P ${CMAKE_MODULE_PATH}/PNG2cpp.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/PNG2cpp.cmake - DEPENDS ${inputFile} ${CMAKE_MODULE_PATH}/PNG2cpp.cmake + DEPENDS ${inputFile} ${CMAKE_MODULE_PATH}/BuildSteps/PNG2cpp.cmake COMMENT "Creating ${outFile}" ) endfunction() diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 1ce6b9eb6f..00308c80f3 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -146,7 +146,7 @@ add_custom_target( -DTEXT_OUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.txt -DSRC_PATH=${PROJECT_SOURCE_DIR} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} - -P ${CMAKE_MODULE_PATH}/WriteVersionHeader.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/WriteVersionHeader.cmake WORKING_DIRECTORY ${CMAKE_BINARY_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/kicad_build_version.h COMMENT "Generating version string header" diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 010a57cded..b9699f8a22 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -315,8 +315,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help.md -DoutputFile=${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help_md.h - -P ${CMAKE_MODULE_PATH}/markdown2C.cmake - DEPENDS ${CMAKE_MODULE_PATH}/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help.md + -P ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake + DEPENDS ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help.md COMMENT "creating ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help_md.h from ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help.md" ) @@ -332,8 +332,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md -DoutputFile=${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h - -P ${CMAKE_MODULE_PATH}/markdown2C.cmake - DEPENDS ${CMAKE_MODULE_PATH}/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md + -P ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake + DEPENDS ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md COMMENT "creating ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h from ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help.md" ) diff --git a/pcb_calculator/CMakeLists.txt b/pcb_calculator/CMakeLists.txt index 756a65805a..922a32f1c2 100644 --- a/pcb_calculator/CMakeLists.txt +++ b/pcb_calculator/CMakeLists.txt @@ -161,8 +161,8 @@ function( html_doc2h inputFile ) add_custom_command( OUTPUT ${inputFile}.h COMMAND ${CMAKE_COMMAND} -DinputFile=${inputFile}.html -DoutputFile=${inputFile}.h - -P ${CMAKE_MODULE_PATH}/Html2C.cmake - DEPENDS ${inputFile}.html ${CMAKE_MODULE_PATH}/Html2C.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/Html2C.cmake + DEPENDS ${inputFile}.html ${CMAKE_MODULE_PATH}/BuildSteps/Html2C.cmake COMMENT "creating ${inputFile}.h from ${inputFile}.html" ) endfunction() @@ -175,8 +175,8 @@ function( md_doc2h inputFile ) OUTPUT ${inputFile}.h COMMAND ${CMAKE_COMMAND} -DinputFile=${inputFile}.md -DoutputFile=${inputFile}.h - -P ${CMAKE_MODULE_PATH}/markdown2C.cmake - DEPENDS ${inputFile}.md ${CMAKE_MODULE_PATH}/markdown2C.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake + DEPENDS ${inputFile}.md ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake COMMENT "creating ${inputFile}.h from ${inputFile}.md" ) endfunction() diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 0617aab641..d851279c60 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -578,8 +578,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md -DoutputFile=${CMAKE_CURRENT_BINARY_DIR}/dialogs/panel_setup_rules_help_md.h - -P ${CMAKE_MODULE_PATH}/markdown2C.cmake - DEPENDS ${CMAKE_MODULE_PATH}/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md + -P ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake + DEPENDS ${CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md COMMENT "creating ${CMAKE_CURRENT_BINARY_DIR}/dialogs/panel_setup_rules_help_md.h from ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/panel_setup_rules_help.md" ) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 63978783e5..7c345ea8f4 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -12,7 +12,7 @@ elseif( UNIX ) -DSRC_PATH=${PROJECT_SOURCE_DIR} -DBUILD_PATH=${PROJECT_BINARY_DIR} -DCMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/CMakeModules - -P ${CMAKE_MODULE_PATH}/WritePlatformMetadata_linux.cmake + -P ${CMAKE_MODULE_PATH}/BuildSteps/WritePlatformMetadata_linux.cmake COMMENT "Configuring Linux appdata" )