From 7bf04a5889d327b0704c4ebeb72dbd9905a8f1e0 Mon Sep 17 00:00:00 2001 From: bgk Date: Tue, 27 Dec 2011 21:02:22 +0000 Subject: [PATCH] CMake: Fix building outside of a working copy when subversion is installed. git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1054 a31d4220-a93d-0410-bf67-fe4944624d44 --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b92be3b..5fed46f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,13 +35,15 @@ endif( NOT ENABLE_DEBUGGER AND ENABLE_SDL ) # Set the version number with -DVERSION=X.X.X-uber IF( NOT VERSION ) - FIND_PACKAGE(Subversion) - IF(SUBVERSION_FOUND) - Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} SVN_INFO) - SET( VERSION "1.8.0-SVN${SVN_INFO_WC_REVISION}" ) - ELSE(SUBVERSION_FOUND) - SET( VERSION "1.8.0-SVN" ) - ENDIF(SUBVERSION_FOUND) + SET( VERSION "1.8.0-SVN" ) + + IF(EXISTS "${CMAKE_SOURCE_DIR}/.svn") + FIND_PACKAGE(Subversion) + IF(SUBVERSION_FOUND) + Subversion_WC_INFO(${CMAKE_SOURCE_DIR} SVN_INFO) + SET( VERSION "1.8.0-SVN${SVN_INFO_WC_REVISION}" ) + ENDIF(SUBVERSION_FOUND) + ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/.svn") ENDIF( NOT VERSION ) # Fill in SDLMAIN_LIBRARY on OS X manually to avoid using SDLMain.m