[geos-commits] [SCM] GEOS branch master updated. 4add2acf806196c2c1f3e7119ec6ae7911a2f083
git at osgeo.org
git at osgeo.org
Mon Feb 17 14:26:08 PST 2020
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 4add2acf806196c2c1f3e7119ec6ae7911a2f083 (commit)
via daf24a4d4025b9068a6f0354da981270182fbdb4 (commit)
from 58e46a8d489fc0a9d1c1cd2b4796282798ca2473 (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 4add2acf806196c2c1f3e7119ec6ae7911a2f083
Merge: 58e46a8 daf24a4
Author: Regina Obe <lr at pcorp.us>
Date: Mon Feb 17 14:26:05 2020 -0800
Merge branch 'config' of mwtoews/geos into master
commit daf24a4d4025b9068a6f0354da981270182fbdb4
Author: Mike Taves <mwtoews at gmail.com>
Date: Mon Feb 17 14:18:38 2020 +1300
Update geos-config tool for consistency and escape paths
* Specify bash, and use printf to escape paths (if needed)
* Restore bash variables, e.g. ${prefix}, and use CMake's @ONLY option
* Consistent indents and style between .in and .cmake versions
* Remove exec_prefix, which has never been used
* Disable configure and install for MSVC builds
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b78ca54..29d4596 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -270,14 +270,21 @@ add_subdirectory(doc)
# Install and export targets - support 'make install' or equivalent
#-----------------------------------------------------------------------------
include(CMakePackageConfigHelpers)
+
+set(GEOS_INSTALL_FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/geos-config-version.cmake")
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/geos-config-version.cmake"
VERSION ${GEOS_VERSION}
COMPATIBILITY AnyNewerVersion)
-configure_file(cmake/geos-config.cmake
- "${CMAKE_CURRENT_BINARY_DIR}/geos-config.cmake"
- COPYONLY)
+if(NOT MSVC)
+ configure_file(cmake/geos-config.cmake
+ "${CMAKE_CURRENT_BINARY_DIR}/geos-config.cmake"
+ COPYONLY)
+ list(APPEND GEOS_INSTALL_FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/geos-config.cmake")
+endif()
install(TARGETS geos geos_cxx_flags
EXPORT geos-targets
@@ -301,8 +308,7 @@ install(EXPORT geos-targets
DESTINATION lib/cmake/GEOS)
install(FILES
- "${CMAKE_CURRENT_BINARY_DIR}/geos-config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/geos-config-version.cmake"
+ ${GEOS_INSTALL_FILES}
DESTINATION lib/cmake/GEOS)
install(DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/include/geos"
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 1f27b80..b30428f 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -12,14 +12,20 @@
#################################################################################
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/geos-config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/geos-config)
-
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/geos-config
- DESTINATION bin
- PERMISSIONS
- OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+if(NOT MSVC)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/geos-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/geos-config
+ @ONLY NEWLINE_STYLE UNIX)
+
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/geos-config
+ DESTINATION bin
+ PERMISSIONS
+ OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()
add_subdirectory(astyle)
diff --git a/tools/geos-config.cmake b/tools/geos-config.cmake
index 24a5725..abef1e3 100644
--- a/tools/geos-config.cmake
+++ b/tools/geos-config.cmake
@@ -1,12 +1,12 @@
-#!/bin/sh
+#!/bin/bash -e
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
-libdir=@CMAKE_INSTALL_PREFIX@/lib
+# escape path
+prefix=$(printf %q "@CMAKE_INSTALL_PREFIX@")
+libdir=${prefix}/lib
usage()
{
- cat <<EOF
+ cat <<EOF
Usage: geos-config [OPTIONS]
Options:
[--prefix]
@@ -21,7 +21,7 @@ Options:
[--includes]
[--jtsport]
EOF
- exit $1
+ exit $1
}
if test $# -eq 0; then
@@ -29,43 +29,45 @@ if test $# -eq 0; then
fi
while test $# -gt 0; do
-case "$1" in
+ case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
-esac
-case $1 in
+ esac
+ case $1 in
--prefix)
- echo @CMAKE_INSTALL_PREFIX@
+ echo ${prefix}
;;
--version)
echo @GEOS_VERSION@
;;
- --cflags)
- echo -I at CMAKE_INSTALL_PREFIX@/include
- ;;
--libs)
- echo -L at CMAKE_INSTALL_PREFIX@/lib -lgeos- at GEOS_VERSION_MAJOR@
+ # TODO: make an alias for --clibs
+ # see http://trac.osgeo.org/geos/ticket/497
+ echo -L${libdir} -lgeos- at GEOS_VERSION_MAJOR@
;;
--clibs)
- echo -L at CMAKE_INSTALL_PREFIX@/lib -lgeos_c
+ echo -L${libdir} -lgeos_c
;;
--cclibs)
- echo -L at CMAKE_INSTALL_PREFIX@/lib -lgeos
+ echo -L${libdir} -lgeos
;;
--static-clibs)
- echo -L at CMAKE_INSTALL_PREFIX@/lib -lgeos_c -lgeos -lm
+ echo -L${libdir} -lgeos_c -lgeos -lm
;;
--static-cclibs)
- echo -L at CMAKE_INSTALL_PREFIX@/lib -lgeos -lm
+ echo -L${libdir} -lgeos -lm
+ ;;
+ --cflags)
+ echo -I${prefix}/include
;;
--ldflags)
- echo -L at CMAKE_INSTALL_PREFIX@/lib
+ echo -L${libdir}
;;
--includes)
- echo @CMAKE_INSTALL_PREFIX@/include
+ echo ${prefix}/include
;;
--jtsport)
- echo @JTS_PORT@
+ echo @JTS_PORT@
;;
*)
usage 1 1>&2
diff --git a/tools/geos-config.in b/tools/geos-config.in
index b7638d2..dfb9deb 100644
--- a/tools/geos-config.in
+++ b/tools/geos-config.in
@@ -1,11 +1,12 @@
-#!/bin/sh
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
+#!/bin/bash -e
+
+# escape paths
+prefix=$(printf %q "@prefix@")
+libdir=$(printf %q "@libdir@")
usage()
{
- cat <<EOF
+ cat <<EOF
Usage: geos-config [OPTIONS]
Options:
[--prefix]
@@ -20,51 +21,53 @@ Options:
[--includes]
[--jtsport]
EOF
- exit $1
+ exit $1
}
+
if test $# -eq 0; then
usage 1 1>&2
fi
+
while test $# -gt 0; do
-case "$1" in
+ case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
-esac
-case $1 in
+ esac
+ case $1 in
--prefix)
- echo @prefix@
- ;;
+ echo ${prefix}
+ ;;
--version)
- echo @VERSION@
- ;;
- --cflags)
- echo -I at prefix@/include
+ echo @VERSION@
;;
--libs)
# TODO: make an alias for --clibs
# see http://trac.osgeo.org/geos/ticket/497
- echo -L at libdir@ -lgeos- at VERSION_RELEASE@
+ echo -L${libdir} -lgeos- at VERSION_RELEASE@
;;
--clibs)
- echo -L at libdir@ -lgeos_c
+ echo -L${libdir} -lgeos_c
;;
--cclibs)
- echo -L at libdir@ -lgeos
+ echo -L${libdir} -lgeos
;;
--static-clibs)
- echo -L at libdir@ -lgeos_c -lgeos -lm
+ echo -L${libdir} -lgeos_c -lgeos -lm
;;
--static-cclibs)
- echo -L at libdir@ -lgeos -lm
+ echo -L${libdir} -lgeos -lm
+ ;;
+ --cflags)
+ echo -I${prefix}/include
;;
--ldflags)
- echo -L at libdir@
+ echo -L${libdir}
;;
--includes)
- echo @prefix@/include
+ echo ${prefix}/include
;;
--jtsport)
- echo @JTS_PORT@
+ echo @JTS_PORT@
;;
*)
usage 1 1>&2
-----------------------------------------------------------------------
Summary of changes:
CMakeLists.txt | 16 +++++++++++-----
tools/CMakeLists.txt | 22 ++++++++++++++--------
tools/geos-config.cmake | 44 +++++++++++++++++++++++---------------------
tools/geos-config.in | 49 ++++++++++++++++++++++++++-----------------------
4 files changed, 74 insertions(+), 57 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list