Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,928
    • Issues 3,928
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Merge requests
  • !5999

Autogen: Add detection of UI file changes to the pre-build VS case

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Duncan Barber requested to merge dunquan/cmake:vs-autouic-on-ui-file-change into master Apr 10, 2021
  • Overview 2
  • Commits 4
  • Pipelines 1
  • Changes 2

This fixes a flaw (#17959 (closed), #18741 (closed)) with the pre-build version of Visual Studio AUTOUIC support where modification of the UI file doesn't trigger a re-run of autogen in order to run the modified file through UIC. Given that autogen needs to run before any of the target's sources are compiled (so must be in the pre-build event which doesn't support file dependencies) it seems the only way to fix the issue within the current framework (except reverting to the other method of adding autogen projects into the generated solution) is to add a rule file which depends on the UI files so it will trigger a build if any of them change. The output file for the rule file command is set to a timestamp file which gets touched by the pre-build event (rather than the rule file build command itself) so it represents the time autogen actually ran.

This only works for *.ui files that are included in the target sources which, as per this comment, seems a reasonable limitation.

Fixes: #17959 (closed), #18741 (closed)

Edited Apr 13, 2021 by Brad King
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: vs-autouic-on-ui-file-change