aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/QtTopLevelHelpers.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Fix ignored submodules if a submodule does not have a dependency.yamlKai Köhne2021-03-311-1/+2
| | | | | | | | | | | | If a subdirectory has a CMakeLists.txt file, but no dependency.yaml file qt_internal_add_module_dependencies will bail out early, with out_module_dependencies being empty. Fixes: QTBUG-92257 Change-Id: I024e812e9debd3c83b24bf306ff0375b2cb08659 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1397f8c123ab493639f8ccdd5347fb52c2adee11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Checkout as detached if checking out branch failsVolker Hilsheimer2020-12-021-0/+9
| | | | | | | | | | | | | Having several toplevel worktrees for the same branch is problematic, but but we do want to be able to have one toplevel worktree synchronized to e.g. one submodule's dev and another with all submodules at the respective dev heads. So fall back to detached checkout if regular checkout fails, and generate a warning. Change-Id: I13981ab931cbbd8b56187979708bfe63f7373718 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add worktrees as detachedVolker Hilsheimer2020-12-021-2/+2
| | | | | | | | | | | | Since we later check the worktree out to the revision specified in the dependency file, add it as detached to avoid conflicts with already existing worktrees for the default branch. As a drive-bye, fix a typo in a comment. Pick-to: 6.0 Change-Id: I81c30c1fa3cfc9831fe7884a103746b43478dd8e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Initialize missing submodules if a supermodule is presentVolker Hilsheimer2020-12-021-0/+15
| | | | | | | | | | When fetching dependencies, the submodule directory might not exist or might be empty. If so, try to initialize the submodule before trying to add the worktree. Pick-to: 6.0 Change-Id: Ie4d6ec483ac9ea3f9207d5ab4cea34d6e0fb2921 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Support absorbed and unabsorbed submodulesVolker Hilsheimer2020-12-011-0/+4
| | | | | | | | | | | Modern git usage for submodules is that the git object storage is absorbed into the supermodule (see git submodule absorbgitdirs). Handle both cases when trying to locate the gitdir for the target module. Pick-to: 6.0 Change-Id: Icddbae3a4d9a8823551106f089dbbff2c935ff35 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Be less quiet when cloning or adding worktreesVolker Hilsheimer2020-11-211-17/+17
| | | | | | | | | | | | | Since doing either for qtbase and qtdeclarative can take a long time, and since it's a relevant change to the local file system, log what's going on. Swallow output from most git commands unless cmake runs in VERBOSE mode. Pick-to: 6.0 Change-Id: I984915689247d6372240744b5bc9183660046084 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make syncing script capable of setting up new worktrees and clonesVolker Hilsheimer2020-11-171-0/+66
| | | | | | | | For missing dependencies, create worktrees from existing clones if found, otherwise clone from the same remote. Change-Id: Ie624e6c1b3f621dce43ee8cc7f06ce469851285b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add a script to synchronize the repo to a consistent (sub)setVolker Hilsheimer2020-11-171-12/+130
| | | | | | | | | | | | | | | | | | Make a few modifications to the dependency evaluation to include the revision of each dependency, and a method that checks each dependency out to the revision necessary to create a consistent set for the requested module. If the requested module is ".", check all modules out to the given revision. Can be called (ideally from a git-sync-to alias script): cmake -DSYNC_TO_MODULE="$1" -DSYNC_TO_BRANCH="$2" \ -P cmake/QtSynchronizeRepo.cmake Change-Id: I007e9f9023bae949907b64e264ae7869dff1da2e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix dependency handling when module is skippedAlexey Edelev2020-11-141-6/+19
| | | | | | | | | Put dependencies of all modules to top-level variables and check for unmet dependencies before module configuring. Fixes: QTBUG-88214 Change-Id: I089feb474687652f3f8fd1bb1959179ea1114983 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use dependencies.yaml to order sub modulesVolker Hilsheimer2020-11-111-0/+85
Don't rely on .gitmodules, instead parse the dependencies.yaml file from every subdirectory with a CMakeLists.txt, and sort all projects based on that data. Projects with no dependencies are added last. This allows us to get rid of the duplication of dependency information in .gitmodules, and makes each module the authoritative source of its own dependencies. Change-Id: Ib1ec6c63bde2aa1852399d598dac5b8e1efda31d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>