Skip to content

Commit

Permalink
Merge pull request #1 from uilianries/add-geos-3.8.0
Browse files Browse the repository at this point in the history
Use external patch for geos
  • Loading branch information
SpaceIm authored Feb 11, 2020
2 parents a3389d7 + 74fe7eb commit e5bcc61
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 13 deletions.
4 changes: 4 additions & 0 deletions recipes/geos/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ sources:
"3.8.0":
url: "https://git.osgeo.org/gitea/geos/geos/archive/3.8.0.tar.gz"
sha256: "90e2ea9db689f5ca8c0bd61e671ac47c749e85998a867b777c3ded8a6399a695"
patches:
"3.8.0":
base_path: "source_subfolder"
patch_file: "patches/0001-cmake.patch"
17 changes: 4 additions & 13 deletions recipes/geos/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GeosConan(ConanFile):
topics = ("conan", "geos", "osgeo", "geometry", "topology", "geospatial")
homepage = "https://trac.osgeo.org/geos"
url = "https://github.com/conan-io/conan-center-index"
exports_sources = "CMakeLists.txt"
exports_sources = ["CMakeLists.txt", "patches/*"]
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
options = {
Expand All @@ -22,7 +22,6 @@ class GeosConan(ConanFile):
"fPIC": True,
"inline": True
}

_cmake = None

@property
Expand All @@ -42,20 +41,10 @@ def source(self):
os.rename(self.name, self._source_subfolder)

def build(self):
self._patch_sources()
tools.patch(**self.conan_data["patches"][self.version])
cmake = self._configure_cmake()
cmake.build()

def _patch_sources(self):
cmakelists_path = os.path.join(self._source_subfolder, "CMakeLists.txt")
tools.replace_in_file(cmakelists_path, "cmake_minimum_required(VERSION 3.13 FATAL_ERROR)", "")
tools.replace_in_file(cmakelists_path, "add_subdirectory(benchmarks)", "")
tools.replace_in_file(cmakelists_path, "add_subdirectory(doc)", "")
tools.replace_in_file(cmakelists_path, "LIBRARY DESTINATION lib NAMELINK_SKIP", "LIBRARY DESTINATION lib")
tools.replace_in_file(cmakelists_path, "add_subdirectory(tools)", "")
tools.replace_in_file(cmakelists_path, "find_package(MakeDistCheck)", "")
tools.replace_in_file(cmakelists_path, "AddMakeDistCheck()", "")

def _configure_cmake(self):
if self._cmake:
return self._cmake
Expand All @@ -76,6 +65,8 @@ def package(self):

def package_info(self):
self.cpp_info.libs = ["geos_c", "geos"]
if self.settings.os == "Linux":
self.cpp_info.system_libs = ["m"]
if self.options.inline:
self.cpp_info.defines.append("GEOS_INLINE")
self.cpp_info.names["cmake_find_package"] = "GEOS"
Expand Down
57 changes: 57 additions & 0 deletions recipes/geos/all/patches/0001-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c893fea..f248cc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ set(DEFAULT_BUILD_TYPE Release)
# Require CMake 3.13+ with VS generator for complete support of VS versions
# and support by AppVeyor.
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
- cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
+
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
@@ -259,12 +259,12 @@ endif()
#-----------------------------------------------------------------------------
# Benchmarks
#-----------------------------------------------------------------------------
-add_subdirectory(benchmarks)
+

#-----------------------------------------------------------------------------
# Documentation/Examples
#-----------------------------------------------------------------------------
-add_subdirectory(doc)
+

#-----------------------------------------------------------------------------
# Install and export targets - support 'make install' or equivalent
@@ -281,7 +281,7 @@ configure_file(cmake/geos-config.cmake

install(TARGETS geos geos_cxx_flags
EXPORT geos-targets
- LIBRARY DESTINATION lib NAMELINK_SKIP
+ LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
@@ -312,7 +312,7 @@ install(DIRECTORY
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/capi/geos_c.h"
DESTINATION include)

-add_subdirectory(tools)
+

#-----------------------------------------------------------------------------
# Uninstall
@@ -372,8 +372,8 @@ add_custom_target(check COMMAND ${CMAKE_BUILD_TOOL} test)
# "make distcheck" workalike
#-----------------------------------------------------------------------------
if(NOT _is_multi_config_generator)
- find_package(MakeDistCheck)
- AddMakeDistCheck()
+
+
message(STATUS "GEOS: Configured 'distcheck' target")
endif()

0 comments on commit e5bcc61

Please sign in to comment.