From: rikky Date: Mon, 24 Jan 2011 14:50:35 +0000 (+0000) Subject: Fix:Build/cmake:Fixed fetching of svn revision for out-of-source builds X-Git-Tag: navit-0.5.0.5194svn~1234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a0c30089c532a9be0b9501bb65361014e9b34a3;p=profile%2Fivi%2Fnavit.git Fix:Build/cmake:Fixed fetching of svn revision for out-of-source builds git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3961 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/cmake/version.cmake b/navit/cmake/version.cmake index 7987815..4f9c6d0 100644 --- a/navit/cmake/version.cmake +++ b/navit/cmake/version.cmake @@ -1,9 +1,11 @@ FIND_PROGRAM(GIT_EXECUTABLE git DOC "git command line client") +get_filename_component(SOURCE_DIR ${SRC} PATH) + EXECUTE_PROCESS( COMMAND ${GIT_EXECUTABLE} svn info COMMAND grep "Revision" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + WORKING_DIRECTORY "${SOURCE_DIR}" OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -17,7 +19,7 @@ if (NOT VERSION) EXECUTE_PROCESS( COMMAND svnversion - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + WORKING_DIRECTORY "${SOURCE_DIR}" OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )