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.
This commit is contained in:
Ian McInerney 2021-01-27 21:49:34 +00:00
parent 09f1e32513
commit beb50c529e
18 changed files with 19 additions and 18 deletions

1
.gitignore vendored
View File

@ -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/**/*

View File

@ -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}

View File

@ -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

View File

@ -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()

View File

@ -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"

View File

@ -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"
)

View File

@ -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()

View File

@ -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"
)

View File

@ -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"
)