[geos-commits] r4112 - trunk

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Nov 2 04:52:12 PST 2015


Author: mloskot
Date: 2015-11-02 04:52:12 -0800 (Mon, 02 Nov 2015)
New Revision: 4112

Modified:
   trunk/CMakeLists.txt
Log:
CMake should not try to generate geos_svn_revision.h if GEOS is built from packaged sources.
Fixes #753

Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2015-10-31 09:23:00 UTC (rev 4111)
+++ trunk/CMakeLists.txt	2015-11-02 12:52:12 UTC (rev 4112)
@@ -253,28 +253,35 @@
 ENDMACRO(GET_SVN_REVISION)
 
 # Determine SVN/Git revision
+set(GEOS_BUILD_PACKAGED TRUE)
 if(EXISTS "${PROJECT_SOURCE_DIR}/.svn")
+  set(GEOS_BUILD_PACKAGED FALSE)
   GET_SVN_REVISION()
+elseif(EXISTS "${PROJECT_SOURCE_DIR}/.git")
+  set(GEOS_BUILD_PACKAGED FALSE)
 endif()
-message(STATUS "Generating GEOS revision header in ${PROJECT_BINARY_DIR}/geos_svn_revision.h")
-if ( NOT ${Project_WC_REVISION} EQUAL 0 )
-   set( GEOS_SVN_REVISION ${Project_WC_REVISION} )
-   configure_file ( 
-      "${PROJECT_SOURCE_DIR}/tools/geos_svn_revision_cmake.h.in"
-      "${PROJECT_BINARY_DIR}/include/geos_svn_revision.h" )
-else()
-   find_program(SH sh)
-   if(SH)
-      execute_process(COMMAND ${SH} -c 
-      "cd ${PROJECT_SOURCE_DIR} && ${PROJECT_SOURCE_DIR}/tools/svn_repo_revision.sh")
 
-      file(RENAME "${PROJECT_SOURCE_DIR}/geos_svn_revision.h"
-      "${PROJECT_BINARY_DIR}/geos_svn_revision.h")
-   else()
-      message("*** sh-compatible command not found, cannot create geos_svn_revision.h")
-      message("*** Check SVN revision and create revision header manually:")
-      message("*** echo '#define GEOS_SVN_REVISION XYZ' > ${PROJECT_SOURCE_DIR}/geos_svn_revision.h")
-   endif()
+if (NOT GEOS_BUILD_PACKAGED)
+  message(STATUS "Generating GEOS revision header in ${PROJECT_BINARY_DIR}/geos_svn_revision.h")
+  if ( NOT ${Project_WC_REVISION} EQUAL 0 )
+     set( GEOS_SVN_REVISION ${Project_WC_REVISION} )
+     configure_file ( 
+        "${PROJECT_SOURCE_DIR}/tools/geos_svn_revision_cmake.h.in"
+        "${PROJECT_BINARY_DIR}/include/geos_svn_revision.h" )
+  else()
+     find_program(SH sh)
+     if(SH)
+        execute_process(COMMAND ${SH} -c 
+        "cd ${PROJECT_SOURCE_DIR} && ${PROJECT_SOURCE_DIR}/tools/svn_repo_revision.sh")
+
+        file(RENAME "${PROJECT_SOURCE_DIR}/geos_svn_revision.h"
+        "${PROJECT_BINARY_DIR}/geos_svn_revision.h")
+     else()
+        message("*** sh-compatible command not found, cannot create geos_svn_revision.h")
+        message("*** Check SVN revision and create revision header manually:")
+        message("*** echo '#define GEOS_SVN_REVISION XYZ' > ${PROJECT_SOURCE_DIR}/geos_svn_revision.h")
+     endif()
+  endif()
 endif()
 # End: Determine SVN/Git revision
 



More information about the geos-commits mailing list