From c0bafa5cdbfc5145dc12f46779d9175cd4f67a02 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Sat, 13 Oct 2012 19:10:16 +0300 Subject: [PATCH] Add possibility to specify UHUB_REVISION manually. --- CMakeLists.txt | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e8c11d..3ab4990 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,13 +121,23 @@ if(UNIX) endif() endif() -if(GIT_FOUND AND IS_DIRECTORY ".git") - execute_process(COMMAND ${GIT_EXECUTABLE} show -s --pretty=format:%h OUTPUT_VARIABLE UHUB_REVISION) - set (UHUB_GIT_VERSION "${UHUB_VERSION_MAJOR}.${UHUB_VERSION_MINOR}.${UHUB_VERSION_PATCH}-git-${UHUB_REVISION}") -else() - set (UHUB_GIT_VERSION "${UHUB_VERSION_MAJOR}.${UHUB_VERSION_MINOR}.${UHUB_VERSION_PATCH}-release") +if (NOT UHUB_REVISION AND GIT_FOUND) + execute_process(COMMAND ${GIT_EXECUTABLE} show -s --pretty=format:%h + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE UHUB_REVISION_TEMP + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (UHUB_REVISION_TEMP) + set (UHUB_REVISION "git-${UHUB_REVISION_TEMP}") + endif() endif() +if (NOT UHUB_REVISION) + set (UHUB_REVISION "release") +endif() + +set (UHUB_GIT_VERSION "${UHUB_VERSION_MAJOR}.${UHUB_VERSION_MINOR}.${UHUB_VERSION_PATCH}-${UHUB_REVISION}") +message (STATUS "Current uHub version: ${UHUB_GIT_VERSION}") + if(OPENSSL_FOUND) add_definitions(-DSSL_SUPPORT=1) include_directories(${OPENSSL_INCLUDE_DIR})