From 5bea5d34ecc5a76bd4804ff4ce1f8a1cc2c9a34e Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 9 May 2014 14:46:58 +0200 Subject: [PATCH] Add the notion of version in both build systems. Remove redundant code. --- CMakeLists.txt | 3 +++ Makefile | 3 +++ lib/Interpreter/CMakeLists.txt | 12 ------------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a679e7f..a190e586 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,9 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ add_definitions( -D_GNU_SOURCE -DCLING_INCLUDE_PATHS="${CLING_SOURCE_DIR}/include:${CLING_BINARY_DIR}/include" ) +# Determine cling's version: +file (STRINGS "VERSION" CLING_VERSION) + add_subdirectory(lib) add_subdirectory(tools) diff --git a/Makefile b/Makefile index 3326e0dd..0efce8d0 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,9 @@ endif # We can revisit this when LLVM/Cling support it. CXX.Flags += -fno-strict-aliasing +# Determine cling's version: +CLING_VERSION=$(shell cat "VERSION") + ### # Cling Top Level specific stuff. diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 1b9fdc63..5d131846 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -82,18 +82,6 @@ add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/Interpreter.cpp # Remove all -I from CMAKE_CXX_FLAGS string(REPLACE ";" " " __flags "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "-I[^ ]+" "" CMAKE_CXX_FLAGS_NO_I "${__flags}") -find_program(git_executable NAMES git git.exe git.cmd) -if( git_executable ) - execute_process(COMMAND ${git_executable} describe --always - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - TIMEOUT 5 - RESULT_VARIABLE git_result - OUTPUT_VARIABLE git_output - OUTPUT_STRIP_TRAILING_WHITESPACE) - if( git_result EQUAL 0 ) - set(CLING_VERSION "${git_output}") - endif( ) -endif( git_executable ) # Remove absolute path from CMAKE_CXX_COMPILER get_filename_component(_path ${CMAKE_CXX_COMPILER} PATH)