From bc876b38fc85c08a70ced81ab6941069484ce252 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 1 Mar 2014 13:52:14 +0000 Subject: [PATCH] Clean repo reporting. --- CMakeLists.txt | 17 ++++++++++++----- alethzero/MainWin.cpp | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa9a3d265..090fdc576 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,10 +131,10 @@ else () # Always "found", given last block. include_directories(${CRYPTOPP_INCLUDE_DIR}) - if (NOT APPLE) + if(NOT APPLE) link_directories(${CRYPTOPP_LIBRARIES}) - endif () -endif () + endif() +endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_directories(/usr/local/lib) @@ -142,9 +142,16 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Generate header file containing useful build information execute_process(COMMAND git --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git --work-tree=${CMAKE_CURRENT_SOURCE_DIR} rev-parse HEAD OUTPUT_VARIABLE ETH_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE) -message("Commit Hash: ${ETH_COMMIT_HASH}") +execute_process(COMMAND git --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git --work-tree=${CMAKE_CURRENT_SOURCE_DIR} diff --shortstat OUTPUT_VARIABLE ETH_LOCAL_CHANGES OUTPUT_STRIP_TRAILING_WHITESPACE) +if("x${ETH_LOCAL_CHANGES}" STREQUAL "x") + set(ETH_CLEAN_REPO 1) +else() + set(ETH_CLEAN_REPO 0) +endif() + +message("Commit Hash: ${ETH_COMMIT_HASH} (Clean: ${ETH_CLEAN_REPO} - ${ETH_LOCAL_CHANGES})") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.h "// This file was automatically generated by cmake\n#pragma once\n\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.h "#define ETH_COMMIT_HASH ${ETH_COMMIT_HASH}\n#define ETH_BUILD_TYPE ${CMAKE_BUILD_TYPE}\n#define ETH_BUILD_PLATFORM ${ETH_BUILD_PLATFORM}\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.h "#define ETH_COMMIT_HASH ${ETH_COMMIT_HASH}\n#define ETH_CLEAN_REPO ${ETH_CLEAN_REPO}\n#define ETH_BUILD_TYPE ${CMAKE_BUILD_TYPE}\n#define ETH_BUILD_PLATFORM ${ETH_BUILD_PLATFORM}\n") include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(secp256k1) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index e2e84ef63..83ceab115 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -180,7 +180,7 @@ Address Main::fromString(QString const& _a) const void Main::on_about_triggered() { - QMessageBox::about(this, "About AlethZero PoC-" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1), "AlethZero/v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) "\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Eric Lombrozo, Marko Simovic, Alex Leverington, Tim Hughes and several others."); + QMessageBox::about(this, "About AlethZero PoC-" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1), QString("AlethZero/v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) "\n" ETH_QUOTED(ETH_COMMIT_HASH)) + (ETH_CLEAN_REPO ? "\nCLEAN" : "\n+ LOCAL CHANGES") + "\n\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Eric Lombrozo, Marko Simovic, Alex Leverington, Tim Hughes and several others."); } void Main::writeSettings()