summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 14:50:35 +0000
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 14:50:35 +0000
commiteb526c939371ea648867aec06a36daeb219f4505 (patch)
tree4fa2d22b198605fa0933fcd43e6b53cf9fe30a86 /cmake
parent5767e352e09340c4142169ffcaf380ada28c2827 (diff)
downloadnavit-eb526c939371ea648867aec06a36daeb219f4505.tar.gz
Fix:Build/cmake:Fixed fetching of svn revision for out-of-source builds
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3961 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'cmake')
-rw-r--r--cmake/version.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/version.cmake b/cmake/version.cmake
index 798781560..4f9c6d017 100644
--- a/cmake/version.cmake
+++ b/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
)