fix git-revision.h generation: output to build tree and add missing dependencies

Generate git-revision.h into CMAKE_BINARY_DIR/src/ (which is in the
include path) instead of the source tree. Remove the header from
add_executable() source lists, and add missing add_dependencies on
git_revision for all Qt5/Qt6 targets.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-29 19:52:16 +01:00
parent 00c980af68
commit d4f0855b19
11 changed files with 51 additions and 16 deletions

View File

@@ -90,6 +90,10 @@ target_include_directories(mupp
#--- use the Widgets and XML modules from Qt5 ---------------------------------
target_link_libraries(mupp PRIVATE Qt5::Widgets Qt5::Xml)
if (IS_GIT_REPO)
add_dependencies(mupp git_revision)
endif (IS_GIT_REPO)
#--- if macOS make an app rather than just a command line executable ----------
set_target_properties(mupp PROPERTIES
VERSION ${mupp_VERSION}

View File

@@ -51,6 +51,10 @@ target_compile_options(musrStep
target_link_libraries(musrStep PRIVATE ${qt_libs})
if (IS_GIT_REPO)
add_dependencies(musrStep git_revision)
endif (IS_GIT_REPO)
#--- installation info --------------------------------------------------------
if (APPLE)
set_target_properties(musrStep PROPERTIES

View File

@@ -55,6 +55,10 @@ target_compile_options(musrWiz
target_link_libraries(musrWiz PRIVATE ${qt_libs})
if (IS_GIT_REPO)
add_dependencies(musrWiz git_revision)
endif (IS_GIT_REPO)
#--- installation info --------------------------------------------------------
if (APPLE)
set_target_properties(musrWiz PROPERTIES

View File

@@ -105,6 +105,10 @@ target_compile_options(musredit
target_link_libraries(musredit PRIVATE ${qt_libs})
if (IS_GIT_REPO)
add_dependencies(musredit git_revision)
endif (IS_GIT_REPO)
#--- installation info --------------------------------------------------------
if (APPLE)
set_target_properties(musredit PROPERTIES