aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-09-12 13:18:12 +0200
committerRiccardo Spagni <ric@spagni.net>2014-09-12 13:18:12 +0200
commite7c52d94c07f7b66ef428c764bb920e221a05048 (patch)
tree6e8c9e684e67dc0e840df991bde4640c3f76f87b /CMakeLists.txt
parentMerge pull request #129 from Jebes/master (diff)
parentMerge branch 'master' of http://github.com/fluffypony/bitmonero (diff)
downloadmonero-e7c52d94c07f7b66ef428c764bb920e221a05048.tar.xz
Merge pull request #132 from fluffypony/master
versioning now includes the commit hash, or -final for tagged releases
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 7 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e93c278da..b80712737 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,9 +30,6 @@
cmake_minimum_required(VERSION 2.8.6)
-set(VERSION "0.1")
-# $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$
-
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
enable_testing()
@@ -160,30 +157,16 @@ elseif(NOT MSVC)
set(Boost_LIBRARIES "${Boost_LIBRARIES};rt;pthread")
endif()
-set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version")
-if (NOT COMMIT_ID_IN_VERSION)
- set(VERSION "${VERSION}-unknown")
- configure_file("src/version.h.in" "version/version.h")
- add_custom_target(version ALL)
-elseif(DEFINED COMMIT)
- string(REPLACE "." "\\." VERSION_RE "${VERSION}")
- if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )")
- set(VERSION "${VERSION}-g${COMMIT}")
- endif()
+find_package(Git QUIET)
+if(Git_FOUND OR GIT_FOUND)
+ message(STATUS "Found Git: ${GIT_EXECUTABLE}")
+ add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
+else()
+ message(STATUS "WARNING: Git was not found!")
+ set(VERSIONTAG "unknown")
configure_file("src/version.h.in" "version/version.h")
add_custom_target(version ALL)
-else()
- find_package(Git QUIET)
- if(Git_FOUND OR GIT_FOUND)
- message(STATUS "Found Git: ${GIT_EXECUTABLE}")
- add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
- else()
- message(STATUS "WARNING: Git was not found!")
- set(VERSION "${VERSION}-unknown")
- configure_file("src/version.h.in" "version/version.h")
- add_custom_target(version ALL)
- endif()
endif()
add_subdirectory(external)