Don't try to guess svn version when current path is a symlink.
authorOscar Fuentes <ofv@wanadoo.es>
Fri, 22 Oct 2010 17:16:26 +0000 (17:16 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Fri, 22 Oct 2010 17:16:26 +0000 (17:16 +0000)
See PR 8473.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117109 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/VersionFromVCS.cmake

index 55142c648aed5d36b849433457e8170f6c1d0e15..81739be927a4eacb610f25d642ff352d3d7be4d6 100644 (file)
@@ -4,9 +4,12 @@
 
 function(add_version_info_from_vcs VERS)
   set(result ${${VERS}})
-  if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn )
+  if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn" )
     set(result "${result}svn")
-    find_package(Subversion)
+    # FindSubversion does not work with symlinks. See PR 8437
+    if( NOT IS_SYMLINK "${CMAKE_CURRENT_SOURCE_DIR}" )
+      find_package(Subversion)
+    endif()
     if( Subversion_FOUND )
       subversion_wc_info( ${CMAKE_CURRENT_SOURCE_DIR} Project )
       if( Project_WC_REVISION )