[geos-commits] [SCM] GEOS branch master updated. 3f09f50fed5514b02c366964b2b550c0e5baafb2

git at osgeo.org git at osgeo.org
Sat Aug 18 21:11:03 PDT 2018


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  3f09f50fed5514b02c366964b2b550c0e5baafb2 (commit)
      from  83b3f4210ef30208daa966ae82aa20d12aa319a7 (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 3f09f50fed5514b02c366964b2b550c0e5baafb2
Author: Regina Obe <lr at pcorp.us>
Date:   Sun Aug 19 00:10:52 2018 -0400

    Allow building C API as static lib for CMake. References #878 for GEOS 3.7.0, closes https://github.com/libgeos/geos/pull/102

diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt
index 77d5ff5..a40fde1 100644
--- a/capi/CMakeLists.txt
+++ b/capi/CMakeLists.txt
@@ -21,8 +21,8 @@ set(geos_c_SOURCES
 
 file(GLOB geos_capi_HEADERS ${CMAKE_BINARY_DIR}/capi/*.h) # fix source_group issue
 
-if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK)
-  # if building OS X framework, CAPI built into C++ library
+if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK AND GEOS_BUILD_SHARED)
+  # if building OS X framework or only building static libs, CAPI built into C++ library
   add_library(geos_c SHARED ${geos_c_SOURCES})
 
   target_link_libraries(geos_c geos)
@@ -57,7 +57,7 @@ else()
     DESTINATION include)
 endif()
 
-if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK)
+if(NOT GEOS_ENABLE_MACOSX_FRAMEWORK AND GEOS_BUILD_SHARED)
   install(TARGETS geos_c
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4a1e688..e477ed4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,15 +14,16 @@
 file(GLOB_RECURSE geos_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
 file(GLOB_RECURSE geos_ALL_HEADERS ${CMAKE_SOURCE_DIR}/include/*.h) # fix source_group issue
 
+# Include CAPI in OS X framework binary and in static libs
+set(geos_c_SOURCES
+  ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_c.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_ts_c.cpp)
+
 if(GEOS_ENABLE_MACOSX_FRAMEWORK)
   # OS X frameworks don't have static libs
   # also 1 binary, so include CAPI here
   # and, make name all caps
 
-  set(geos_c_SOURCES
-    ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_c.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/../capi/geos_ts_c.cpp)
-
   add_library(GEOS SHARED ${geos_SOURCES} ${geos_c_SOURCES})
 
   math(EXPR CVERSION "${VERSION_MAJOR} + 1") 
@@ -77,7 +78,8 @@ else()
   endif()
 
   if(GEOS_BUILD_STATIC)
-    add_library(geos-static STATIC ${geos_SOURCES} ${geos_ALL_HEADERS})
+    file(GLOB geos_capi_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../capi/*.h) # fix source_group issue
+    add_library(geos-static STATIC ${geos_SOURCES} ${geos_c_SOURCES} ${geos_ALL_HEADERS} ${geos_capi_HEADERS})
 
     set_target_properties(geos-static
       PROPERTIES
@@ -85,6 +87,8 @@ else()
       PREFIX "lib"
       CLEAN_DIRECT_OUTPUT 1)
 
+    add_dependencies(geos-static geos_revision)
+
     install(TARGETS geos-static
       RUNTIME DESTINATION bin
       LIBRARY DESTINATION lib

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

Summary of changes:
 capi/CMakeLists.txt |  6 +++---
 src/CMakeLists.txt  | 14 +++++++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list