diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/version.h.in | 19 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6f231b4..03f6c17 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,14 +6,6 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) -# configure a header file to pass version information -# if you don't have git, or are building this off the source tarball, define versions in version.h.in -execute_process(COMMAND hg log -r '.' --template={latesttag} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsVersion OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND hg identify --id WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsCommit OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND hg identify --num WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsRevision OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND hg identify --branch WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsBranch OUTPUT_STRIP_TRAILING_WHITESPACE) -configure_file(version.h.in "${PROJECT_BINARY_DIR}/src/version.h") - add_executable(poi # main main.cpp diff --git a/src/version.h.in b/src/version.h.in index 2e6ecf2..a5c3204 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,6 +1,10 @@ #ifndef VERSION_H #define VERSION_H +// VcsVersion gets defined by the CMakeLists if project-src/.hg exists +#cmakedefine VcsVersion + +#ifdef VcsVersion // Version: 1.2.3 #define SMOLBOTE_VERSION "@VcsVersion@" @@ -13,4 +17,19 @@ // Branch: default #define SMOLBOTE_BRANCH "@VcsBranch@" +#else +// Version: 1.2.3 +#define SMOLBOTE_VERSION "0.3.0" + +// Describe: 1.2.3-r123-0123456789ab +#define SMOLBOTE_DESCRIBE "0.3.0-release" + +// Commit +#define SMOLBOTE_COMMIT "package" + +// Branch: default +#define SMOLBOTE_BRANCH "release" + +#endif + #endif //VERSION_H |