[geos-commits] [SCM] GEOS branch master updated. 44acf18e52a6ed07e6074c99ddd75f9994d806a6

git at osgeo.org git at osgeo.org
Tue May 21 15:03:11 PDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  44acf18e52a6ed07e6074c99ddd75f9994d806a6 (commit)
       via  0b86731eae275bd3b09a581d11e3778d9770aa7d (commit)
       via  740c984fc32ffbfba265c803854824358cb5a20b (commit)
      from  2ba3d4a30721e7c04b4abf58938236eb34c9584f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 44acf18e52a6ed07e6074c99ddd75f9994d806a6
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue May 21 15:02:58 2019 -0700

    Add prototype 'make distcheck' target

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6e9d8e..e84b445 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
   cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
 endif()
 
-list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 
 # TODO: Follow CMake detection of git and version tagging
 #       https://gitlab.kitware.com/cmake/cmake/blob/master/Source/CMakeVersionSource.cmake
@@ -102,7 +102,7 @@ project(GEOS VERSION "${_version_major}.${_version_minor}.${_version_patch}"
 if("${_version_patch_word}" STREQUAL "")
   set(GEOS_VERSION_FULL "${GEOS_VERSION}")
 else()
-  set(GEOS_VERSION_FULL "${GEOS_VERSION}-${_version_patch_word}")
+  set(GEOS_VERSION_FULL "${GEOS_VERSION}${_version_patch_word}")
 endif()
 
 unset(_version_major)
@@ -267,7 +267,7 @@ add_custom_target(uninstall
   "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
 
 #-----------------------------------------------------------------------------
-# Make Dist
+# "make dist" workalike
 #-----------------------------------------------------------------------------
 
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GEOS Computational Geometry Library")
@@ -277,30 +277,31 @@ set(CPACK_SOURCE_GENERATOR "TBZ2")
 set(CPACK_PACKAGE_VERSION_MAJOR ${GEOS_VERSION_MAJOR})
 set(CPACK_PACKAGE_VERSION_MINOR ${GEOS_VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${GEOS_VERSION_PATCH})
-set(CPACK_SOURCE_PACKAGE_FILE_NAME
-  "geos-${GEOS_VERSION}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "geos-${GEOS_VERSION_FULL}")
 
-#  ".*\.yml"
 set(CPACK_SOURCE_IGNORE_FILES
   "/\\\\.git"
   "/autogen\\\\.sh"
   "/tools/ci"
   "/HOWTO_RELEASE"
   "/autom4te\\\\.cache"
-  ".yml\$"
-  ".deps"
+  "\\\\.yml\$"
+  "\\\\.deps"
   "/debian/"
   "/php/"
   )
-# set(CPACK_SOURCE_IGNORE_FILES
-#   ".git"
-#   "autogen.sh"
-#   "HOWTO_RELEASE"
-#   "autom4te.cache"
-#   "debian"
-#   "php"
-#   )
+
+message(STATUS "GEOS: CPACK_SOURCE_PACKAGE_FILE_NAME: ${CPACK_SOURCE_PACKAGE_FILE_NAME}")
 message(STATUS "GEOS: CPACK_SOURCE_IGNORE_FILES: ${CPACK_SOURCE_IGNORE_FILES}")
+message(STATUS "GEOS: CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
 include(CPack)
 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
 
+#-----------------------------------------------------------------------------
+# "make distcheck" workalike
+#-----------------------------------------------------------------------------
+
+find_package(MakeDistCheck)
+AddMakeDistCheck()
+
+
diff --git a/cmake/FindMakeDistCheck.cmake b/cmake/FindMakeDistCheck.cmake
new file mode 100644
index 0000000..78096c2
--- /dev/null
+++ b/cmake/FindMakeDistCheck.cmake
@@ -0,0 +1,61 @@
+# Inspired by CMake Distcheck for LAAS-CNRS
+#
+# DEFINE_DISTCHECK
+# ---------------
+#
+# Add a distcheck target to check the generated tarball.
+#
+# This step calls `make dist' to generate a copy of the sources as it
+# stands in the current git HEAD i.e., unversioned files are skipped.
+#
+# Then:
+# - create _build and _inst to respectively create a build
+#   and an installation directory.
+# - run cmake with _inst as the installation prefix
+# - run make, make check, make install and make uninstall
+# - remove _build and _inst.
+# - remove dist directory and confirm success.
+#
+# During the compilation phase, all files in the source tree are modified
+# to *not* be writeable to detect bad compilation steps which tries to modify
+# the source tree. Permissions are reverted at the end of the check.
+#
+macro(AddMakeDistCheck)
+  find_program(_tar tar)
+  find_program(_bzip2 bzip2)
+  string(TOLOWER "${CPACK_SOURCE_PACKAGE_FILE_NAME}" _distbasename)
+  set(_distname "${_distbasename}.tar.bz2")
+  set(_builddir "${CMAKE_BINARY_DIR}/${_distbasename}/_build")
+  set(_instdir  "${CMAKE_BINARY_DIR}/${_distbasename}/_inst")
+  # message(STATUS "GEOS: _distbasename: ${_distbasename}")
+  # message(STATUS "GEOS: _distname: ${_distname}")
+  # message(STATUS "GEOS: _builddir: ${_builddir}")
+  # message(STATUS "GEOS: _instdir: ${_instdir}")
+
+  add_custom_target(distcheck
+    COMMAND rm -rf "${_distbasename}"
+      && \(${_bzip2} -d -c "${_distname}" | ${_tar} xf -\)
+      && mkdir -vp "${_builddir}"
+      && mkdir -vp "${_instdir}"
+      && cd "${_builddir}"
+      && ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH="${_instdir}" ..
+        || \(echo "ERROR: the cmake configuration failed." && false\)
+      && make
+        || \(echo "ERROR: the compilation failed." && false\)
+      && make test
+        || \(echo "ERROR: the test suite failed." && false\)
+      && make install
+        || \(echo "ERROR: the install target failed." && false\)
+      && make uninstall
+        || \(echo "ERROR: the uninstall target failed." && false\)
+      && make clean
+        || \(echo "ERROR: the clean target failed." && false\)
+      && cd ../..
+      && rm -rf "${_distbasename}"
+      && echo "=============================================================="
+      && echo "${_distname} is ready for distribution."
+      && echo "=============================================================="
+    )
+
+  add_dependencies(distcheck dist)
+endmacro()

commit 0b86731eae275bd3b09a581d11e3778d9770aa7d
Merge: 740c984 2ba3d4a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue May 21 09:12:53 2019 -0700

    Merge branch 'master' of https://git.osgeo.org/gogs/geos/geos


commit 740c984fc32ffbfba265c803854824358cb5a20b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue May 21 09:12:14 2019 -0700

    Work on cmake patterns for 'dist' target

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc344e2..e5b9aa6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -283,13 +283,15 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME
 
 #  ".*\.yml"
 set(CPACK_SOURCE_IGNORE_FILES
-  "/\.git/"
-  "autogen.sh"
-  "HOWTO_RELEASE"
-  "autom4te.cache"
-  "/.*\.yml/"
-  "/\/debian\//"
-  "/\/php\//"
+  "/\\\\.git"
+  "/autogen\\\\.sh"
+  "/tools/ci"
+  "/HOWTO_RELEASE"
+  "/autom4te\\\\.cache"
+  ".yml\$"
+  ".deps"
+  "/debian/"
+  "/php/"
   )
 # set(CPACK_SOURCE_IGNORE_FILES
 #   ".git"

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt                | 45 ++++++++++++++++---------------
 cmake/FindMakeDistCheck.cmake | 61 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+), 21 deletions(-)
 create mode 100644 cmake/FindMakeDistCheck.cmake


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list