Browse Source

Place project version in cmake variable PROJECT_VERSION.

cl-refactor
Paweł Bylica 10 years ago
parent
commit
6d10e19fb1
  1. 4
      BuildInfo.h.in
  2. 11
      CMakeLists.txt
  3. 4
      libdevcore/Common.cpp

4
BuildInfo.h.in

@ -1,7 +1,7 @@
#pragma once
#define ETH_PROJECT_VERSION "@PROJECT_VERSION@"
#define ETH_COMMIT_HASH @ETH_COMMIT_HASH@
#define ETH_CLEAN_REPO @ETH_CLEAN_REPO@
#define ETH_BUILD_TYPE @ETH_BUILD_TYPE@
#define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@
#define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@

11
CMakeLists.txt

@ -1,7 +1,13 @@
# cmake global
cmake_minimum_required(VERSION 2.8.12)
project(ethereum)
set(PROJECT_VERSION "0.9.34")
if (${CMAKE_VERSION} VERSION_GREATER 3.0)
cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project()
project(ethereum VERSION ${PROJECT_VERSION})
else()
project(ethereum)
endif()
set(CMAKE_AUTOMOC ON)
@ -136,6 +142,7 @@ function(createBuildInfo)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -DETH_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DETH_DST_DIR="${CMAKE_BINARY_DIR}"
-DETH_BUILD_TYPE="${_cmake_build_type}" -DETH_BUILD_PLATFORM="${ETH_BUILD_PLATFORM}"
-DPROJECT_VERSION="${PROJECT_VERSION}"
-P "${ETH_SCRIPTS_DIR}/buildinfo.cmake"
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@ -539,7 +546,7 @@ if (WIN32)
set(CPACK_PACKAGE_VENDOR "ethereum.org")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION "0.9.34")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR "NSIS")
# seems to be not working
# set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/alethzero/alethzero.bmp")

4
libdevcore/Common.cpp

@ -22,13 +22,14 @@
#include "Common.h"
#include "Exceptions.h"
#include "Log.h"
#include "BuildInfo.h"
using namespace std;
using namespace dev;
namespace dev
{
char const* Version = "0.9.34";
char const* Version = ETH_PROJECT_VERSION;
const u256 UndefinedU256 = ~(u256)0;
@ -57,4 +58,3 @@ TimerHelper::~TimerHelper()
}
}

Loading…
Cancel
Save