Fix merge conflict
This commit is contained in:
parent
997eed7403
commit
7dddcffe5f
|
@ -100,6 +100,39 @@ set(SOURCE_FILES
|
|||
add_executable(${PROJECT_NAME}
|
||||
${SOURCE_FILES})
|
||||
|
||||
# Get the current working branch
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Get the date and time of last commit
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%cd --date=short
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_DATETIME
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/src/version.h.in
|
||||
${CMAKE_BINARY_DIR}/gen/version.h
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_BINARY_DIR}/gen)
|
||||
|
||||
macro(configure_files srcDir destDir)
|
||||
message(STATUS "Configuring directory ${destDir}")
|
||||
make_directory(${destDir})
|
||||
|
|
|
@ -14,7 +14,7 @@ set(SOURCE_FILES
|
|||
CmdLineOptions.cpp
|
||||
tx_details.cpp
|
||||
page.h
|
||||
rpccalls.cpp rpccalls.h)
|
||||
rpccalls.cpp rpccalls.h version.h.in)
|
||||
|
||||
# make static library called libmyxrm
|
||||
# that we are going to link to
|
||||
|
|
19
src/page.h
19
src/page.h
|
@ -12,6 +12,7 @@
|
|||
#include "../ext/format.h"
|
||||
#include "../ext/member_checker.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include "monero_headers.h"
|
||||
|
||||
|
@ -3622,6 +3623,24 @@ private:
|
|||
return mixin_no;
|
||||
}
|
||||
|
||||
string
|
||||
get_full_page(string& middle)
|
||||
{
|
||||
// set last git commit date based on
|
||||
// autogenrated version.h during compilation
|
||||
static const mstch::map footer_context {
|
||||
{"last_git_commit_hash", string {GIT_COMMIT_HASH}},
|
||||
{"last_git_commit_date", string {GIT_COMMIT_DATETIME}}
|
||||
};
|
||||
|
||||
string footer_html = mstch::render(xmreg::read(TMPL_FOOTER), footer_context);
|
||||
|
||||
return xmreg::read(TMPL_HEADER)
|
||||
+ middle
|
||||
+ footer_html;
|
||||
}
|
||||
|
||||
|
||||
string
|
||||
get_full_page(string& middle)
|
||||
{
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
<h6 style="margin-top:10px">
|
||||
Help support the hosting and maintenance of this service by donating to: <br/>
|
||||
48daf1rG3hE1Txapcsxh6WXNe9MLNKtu7W7tKTivtSoVLHErYzvdcpea2nSTgGkz66RFP4GKVAsTV14v6G3oddBTHfxP6tU
|
||||
<br/><br/>
|
||||
Version: {{last_git_commit_date}}
|
||||
</h6>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// Created by mwo on 23/11/16.
|
||||
//
|
||||
|
||||
#ifndef XMRBLOCKS_VERSION_H_IN_H
|
||||
#define XMRBLOCKS_VERSION_H_IN_H
|
||||
|
||||
#define GIT_BRANCH "@GIT_BRANCH@"
|
||||
#define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@"
|
||||
#define GIT_COMMIT_DATETIME "@GIT_COMMIT_DATETIME@"
|
||||
|
||||
|
||||
#endif //XMRBLOCKS_VERSION_H_IN_H
|
Loading…
Reference in New Issue