more work on the none git source version.

This commit is contained in:
suter_a 2021-07-12 16:00:19 +02:00
parent 39485d6f72
commit 668b4bf481
4 changed files with 38 additions and 2 deletions

View File

@ -1,5 +1,12 @@
#--- musrStep for Qt > 5.0 ----------------------------------------------------
#--- check if project source is repo ------------------------------------------
if (IS_GIT_REPO)
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
else (IS_GIT_REPO)
set(HAVE_GIT_REV_H "")
endif (IS_GIT_REPO)
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Svg)
set(musrStep_src
@ -47,6 +54,11 @@ target_include_directories(musrStep
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
)
target_compile_options(musrWiz
PRIVATE
"${HAVE_GIT_REV_H}"
)
target_link_libraries(musrStep ${qt_libs})
#--- installation info --------------------------------------------------------

View File

@ -5,7 +5,9 @@
#include <QtDebug>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
#include "PMusrStep.h"
//-------------------------------------------------------------------------
@ -29,7 +31,11 @@ int main(int argc, char *argv[])
return 1;
} else {
if (!strcmp(argv[1], "--version") || (!strcmp(argv[1], "-v"))) {
std::cout << std::endl << "musrStep git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "musrStep - git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "musrStep - git-branch: unknown, git-rev: unknown" << std::endl << std::endl;
#endif
return 0;
} else if (!strcmp(argv[1], "--help") || (!strcmp(argv[1], "-h"))) {
musrStep_syntax();

View File

@ -1,5 +1,12 @@
#--- musrStep for Qt > 6.0 ----------------------------------------------------
#--- check if project source is repo ------------------------------------------
if (IS_GIT_REPO)
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
else (IS_GIT_REPO)
set(HAVE_GIT_REV_H "")
endif (IS_GIT_REPO)
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Svg)
set(musrStep_src
@ -47,6 +54,11 @@ target_include_directories(musrStep
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
)
target_compile_options(musrStep
PRIVATE
"${HAVE_GIT_REV_H}"
)
target_link_libraries(musrStep ${qt_libs})
#--- installation info --------------------------------------------------------

View File

@ -5,7 +5,9 @@
#include <QtDebug>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
#include "PMusrStep.h"
//-------------------------------------------------------------------------
@ -29,7 +31,11 @@ int main(int argc, char *argv[])
return 1;
} else {
if (!strcmp(argv[1], "--version") || (!strcmp(argv[1], "-v"))) {
std::cout << std::endl << "musrStep git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "musrStep - git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "musrStep - git-branch: unknown, git-rev: unknown" << std::endl << std::endl;
#endif
return 0;
} else if (!strcmp(argv[1], "--help") || (!strcmp(argv[1], "-h"))) {
musrStep_syntax();