versioning added to CMakeLists.txt

pull/5/head
moneroexamples 7 years ago
parent c14dcbd8a5
commit e7d21494b4

@ -1,8 +1,13 @@
cmake_minimum_required(VERSION 3.2)
project(restbed_xmr)
set(PROJECT_NAME
openmonero)
project(${PROJECT_NAME})
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++14")
"${CMAKE_CXX_FLAGS} -std=c++11")
# find boost
find_package(Boost COMPONENTS
@ -30,6 +35,7 @@ set(MONERO_HEADERS_DIR
include_directories(
${MONERO_HEADERS_DIR}/src
${MONERO_HEADERS_DIR}/external
${MONERO_HEADERS_DIR}/build
${MONERO_HEADERS_DIR}/external/easylogging++
${MONERO_HEADERS_DIR}/contrib/epee/include
${MONERO_HEADERS_DIR}/external/db_drivers/liblmdb)
@ -97,13 +103,39 @@ include_directories(${Boost_INCLUDE_DIRS})
include_directories(
"ext/restbed/source")
# add src/ subfolder
add_subdirectory(src/)
# add ext/ subfolder
add_subdirectory(ext/)
# 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}")
@ -125,14 +157,20 @@ endmacro(configure_files)
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/config ${CMAKE_CURRENT_BINARY_DIR}/config)
# add src/ subfolder
add_subdirectory(src/)
# add ext/ subfolder
add_subdirectory(ext/)
set(SOURCE_FILES
main.cpp)
add_executable(restbed_xmr
add_executable(${PROJECT_NAME}
${SOURCE_FILES})
target_link_libraries(restbed_xmr
target_link_libraries(${PROJECT_NAME}
myxrm
myext
restbed

@ -23,6 +23,10 @@ to use, host and modify. Additionally, the following features were added/changed
- added dynamic fees for testnet.
- minimum mixin set to 4.
## Screenshot
![Open Monero](https://raw.githubusercontent.com/moneroexamples/restbed-xmr/master/screenshot/screen1.png)
## Limitations
@ -37,7 +41,6 @@ Open Monero is not as fast as MyMonero. This is because it is basic, easy to und
they can't be restarted without user logging in back, as Open Monero does not store viewkeys.
## Host it yourself
The Open Monero consists of four components that need to be setup for it to work:
@ -54,19 +57,25 @@ The Open Monero consists of four components that need to be setup for it to work
with Monero deamon.
## Screenshot
## Example setup on Ubuntu 16.04
![Open Monero](https://raw.githubusercontent.com/moneroexamples/restbed-xmr/master/screenshot/screen1.png)
Below are example instructions on how to setup up and run Open Monero on Ubuntu 16.04.
#### Mysql/Mariadb
#### Lighttpd
## Compilation on Ubuntu
#### Monero libraries
Before proceeding, please make sure that Monero's libraries and header files are setup correctly,
as shown here:
Monero's libraries and header files are setup is described here:
- [compile-monero-on-ubuntu-16-04](https://github.com/moneroexamples/compile-monero-09-on-ubuntu-16-04)
#### Compilation of the Open Monero
```bash
sudo apt install libmysql++-dev
# need mysql++ libraries
sudo apt install libmysql++-dev
git clone https://github.com/moneroexamples/restbed-xmr.git
@ -79,6 +88,8 @@ cmake ..
make
```
#### Run Open Monero
## Scrap notes
### Generate your own ssl certificate

@ -12,7 +12,8 @@ set(SOURCE_FILES
ssqlses.cpp
YourMoneroRequests.cpp
TxSearch.cpp
OutputInputIdentification.cpp)
OutputInputIdentification.cpp
version.h.in)
# make static library called libmyxrm
# that we are going to link to

@ -4,6 +4,7 @@
#define MYSQLPP_SSQLS_NO_STATICS 1
#include "YourMoneroRequests.h"
#include "ssqlses.h"

@ -9,6 +9,8 @@
#include <functional>
#include "version.h"
#include "CurrentBlockchainStatus.h"
#include "MySqlAccounts.h"

@ -16,6 +16,8 @@
#define FEE_ESTIMATE_GRACE_BLOCKS 10
#include "release/version/version.h"
#include "net/http_client.h"
#include "storages/http_abstract_invoke.h"

@ -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…
Cancel
Save