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:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user