forked from gpospelov/qt-mvvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto generation of version.h from CMake PROJECT_VERSION string
- Loading branch information
Gennady Pospelov
committed
Jun 18, 2020
1 parent
17700a0
commit d2b4815
Showing
7 changed files
with
90 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ env: | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master ] | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -45,22 +45,22 @@ jobs: | |
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ninja.zip) | ||
- name: Prepare ccache timestamp | ||
- name: ccache timestamp | ||
id: ccache_cache_timestamp | ||
shell: cmake -P {0} | ||
run: | | ||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | ||
message("::set-output name=timestamp::${current_date}") | ||
- name: Prepare ccache files | ||
- name: ccache files | ||
uses: actions/[email protected] | ||
with: | ||
path: .ccache | ||
key: qtmvvm-win-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | ||
restore-keys: | | ||
qtmvvm-win-ccache- | ||
- name: Build | ||
- name: build | ||
shell: cmd | ||
env: | ||
CCACHE_BASEDIR: $GITHUB_WORKSPACE | ||
|
@@ -81,7 +81,7 @@ jobs: | |
ccache -p | ||
cmake --build . --config Release -j4 | ||
- name: Run functional tests | ||
- name: ctest | ||
if: success() | ||
shell: cmd | ||
run: | | ||
|
@@ -92,7 +92,7 @@ jobs: | |
ccache -s | ||
ctest --output-on-failure | ||
- name: Functional test output | ||
- name: ctest output | ||
if: failure() | ||
shell: cmd | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ************************************************************************** // | ||
// | ||
// Model-view-view-model framework for large GUI applications | ||
// | ||
//! @license GNU General Public License v3 or higher (see COPYING) | ||
//! @authors see AUTHORS | ||
// | ||
// ************************************************************************** // | ||
|
||
#ifndef SCRIPTS_MVVM_VERSION_H | ||
#define SCRIPTS_MVVM_VERSION_H | ||
|
||
//! @file mvvm_version.h | ||
//! Automatically generated in <builddir>/inc from mvvm_version.h.in | ||
|
||
#include <string> | ||
|
||
namespace ModelView | ||
{ | ||
|
||
//! Returns major project version. | ||
inline int ProjectVersionMajor() | ||
{ | ||
const int project_version_major = @PROJECT_VERSION_MAJOR@; | ||
return project_version_major; | ||
} | ||
|
||
//! Returns minor project version. | ||
inline int ProjectVersionMinor() | ||
{ | ||
const int project_version_minor = @PROJECT_VERSION_MAJOR@; | ||
return project_version_minor; | ||
} | ||
|
||
//! Returns patch project version. | ||
inline int ProjectVersionPatch() | ||
{ | ||
const int project_version_path = @PROJECT_VERSION_PATCH@; | ||
return project_version_path; | ||
} | ||
|
||
//! Returns project version string | ||
inline std::string ProjectVersion() | ||
{ | ||
const std::string project_version = @PROJECT_VERSION_PATCH@; | ||
return project_version; | ||
} | ||
|
||
} // namespace ModelView | ||
|
||
#endif // BAVERSION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ************************************************************************** // | ||
// | ||
// Model-view-view-model framework for large GUI applications | ||
// | ||
//! @license GNU General Public License v3 or higher (see COPYING) | ||
//! @authors see AUTHORS | ||
// | ||
// ************************************************************************** // | ||
|
||
#ifndef MVVM_CORE_VERSION_H | ||
#define MVVM_CORE_VERSION_H | ||
|
||
#include "mvvm_version.h" // auto generated in <build>/inc | ||
|
||
#endif // MVVM_CORE_VERSION_H |