-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add:for gdal lib Signed-off-by: tasty-gumi <[email protected]> * remove .gitignore dev sh Signed-off-by: tasty-gumi <[email protected]> --------- Signed-off-by: tasty-gumi <[email protected]>
- Loading branch information
1 parent
e8b9d7e
commit 39735d6
Showing
64 changed files
with
2,742 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.docker/ | ||
**/build | ||
**/build-release | ||
**/build-aux | ||
velox/all/source_subfolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"3.12.0": | ||
url: "https://github.com/libgeos/geos/releases/download/3.12.0/geos-3.12.0.tar.bz2" | ||
sha256: "d96db96011259178a35555a0f6d6e75a739e52a495a6b2aa5efb3d75390fbc39" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
from conan import ConanFile | ||
from conan.errors import ConanInvalidConfiguration | ||
from conan.tools.build import check_min_cppstd, stdcpp_library | ||
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout | ||
from conan.tools.files import copy, get, rmdir, replace_in_file | ||
from conan.tools.scm import Version | ||
import os | ||
|
||
required_conan_version = ">=1.54.0" | ||
|
||
|
||
class GeosConan(ConanFile): | ||
name = "geos" | ||
description = "GEOS is a C++ library for performing operations on two-dimensional vector geometries." | ||
license = "LGPL-2.1" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://libgeos.org/" | ||
topics = ("osgeo", "geometry", "topology", "geospatial") | ||
package_type = "library" | ||
settings = "os", "arch", "compiler", "build_type" | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"inline": [True, False], | ||
"utils": [True, False], | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"inline": True, | ||
"utils": True, | ||
} | ||
|
||
@property | ||
def _min_cppstd(self): | ||
return "14" if Version(self.version) >= "3.12.0" else "11" | ||
|
||
@property | ||
def _compilers_minimum_version(self): | ||
return { | ||
"14": { | ||
"gcc": "6", | ||
"clang": "5", | ||
"apple-clang": "10", | ||
"Visual Studio": "15", | ||
"msvc": "191", | ||
}, | ||
}.get(self._min_cppstd, {}) | ||
|
||
@property | ||
def _has_inline_option(self): | ||
return Version(self.version) < "3.11.0" | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
if not self._has_inline_option: | ||
del self.options.inline | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
self.options.rm_safe("fPIC") | ||
|
||
def layout(self): | ||
cmake_layout(self, src_folder="src") | ||
|
||
def validate(self): | ||
if self.settings.compiler.cppstd: | ||
check_min_cppstd(self, self._min_cppstd) | ||
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) | ||
if minimum_version and Version(self.settings.compiler.version) < minimum_version: | ||
raise ConanInvalidConfiguration( | ||
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." | ||
) | ||
|
||
def source(self): | ||
get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
if Version(self.version) < "3.11.0": | ||
# these 2 options are declared before project() in geos < 3.11.0 | ||
tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared | ||
tc.cache_variables["BUILD_BENCHMARKS"] = False | ||
else: | ||
tc.variables["BUILD_BENCHMARKS"] = False | ||
tc.cache_variables["CMAKE_BUILD_TYPE"] = str(self.settings.build_type) | ||
if self._has_inline_option: | ||
tc.variables["DISABLE_GEOS_INLINE"] = not self.options.inline | ||
tc.variables["BUILD_TESTING"] = False | ||
tc.variables["BUILD_DOCUMENTATION"] = False | ||
tc.variables["BUILD_ASTYLE"] = False | ||
tc.variables["BUILD_GEOSOP"] = self.options.utils | ||
tc.generate() | ||
|
||
def _patch_sources(self): | ||
# Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are used. | ||
# https://github.com/libgeos/geos/pull/945 | ||
if Version(self.version) <= "3.12.1": | ||
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), | ||
"set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})", "") | ||
|
||
def build(self): | ||
self._patch_sources() | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) | ||
cmake = CMake(self) | ||
cmake.install() | ||
copy(self, "geos.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) | ||
rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) | ||
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) | ||
|
||
def package_info(self): | ||
self.cpp_info.set_property("cmake_file_name", "geos") | ||
# Avoid to create unwanted geos::geos target | ||
# (geos_c component overrides this global target and it's fine since it depends on all other components) | ||
self.cpp_info.set_property("cmake_target_name", "GEOS::geos_c") | ||
self.cpp_info.set_property("pkg_config_name", "geos") | ||
|
||
self.cpp_info.filenames["cmake_find_package"] = "geos" | ||
self.cpp_info.filenames["cmake_find_package_multi"] = "geos" | ||
self.cpp_info.names["cmake_find_package"] = "GEOS" | ||
self.cpp_info.names["cmake_find_package_multi"] = "GEOS" | ||
|
||
# GEOS::geos_cxx_flags | ||
self.cpp_info.components["geos_cxx_flags"].set_property("cmake_target_name", "GEOS::geos_cxx_flags") | ||
self.cpp_info.components["geos_cxx_flags"].defines.append("USE_UNSTABLE_GEOS_CPP_API") | ||
if self.options.get_safe("inline"): | ||
self.cpp_info.components["geos_cxx_flags"].defines.append("GEOS_INLINE") | ||
if self.settings.os == "Windows": | ||
self.cpp_info.components["geos_cxx_flags"].defines.append("TTMATH_NOASM") | ||
|
||
# GEOS::geos | ||
self.cpp_info.components["geos_cpp"].set_property("cmake_target_name", "GEOS::geos") | ||
self.cpp_info.components["geos_cpp"].names["cmake_find_package"] = "geos" | ||
self.cpp_info.components["geos_cpp"].names["cmake_find_package_multi"] = "geos" | ||
self.cpp_info.components["geos_cpp"].libs = ["geos"] | ||
if self.settings.os in ["Linux", "FreeBSD"]: | ||
self.cpp_info.components["geos_cpp"].system_libs.append("m") | ||
if not self.options.shared: | ||
libcxx = stdcpp_library(self) | ||
if libcxx: | ||
self.cpp_info.components["geos_cpp"].system_libs.append(libcxx) | ||
self.cpp_info.components["geos_cpp"].requires = ["geos_cxx_flags"] | ||
|
||
# GEOS::geos_c | ||
self.cpp_info.components["geos_c"].set_property("cmake_target_name", "GEOS::geos_c") | ||
self.cpp_info.components["geos_c"].libs = ["geos_c"] | ||
self.cpp_info.components["geos_c"].requires = ["geos_cpp"] | ||
|
||
if self.options.utils: | ||
self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package LANGUAGES C) | ||
|
||
find_package(geos CONFIG REQUIRED geos_c) | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE GEOS::geos_c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <geos_c.h> | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <stdarg.h> | ||
|
||
void notice(const char *fmt, ...) { | ||
va_list ap; | ||
|
||
fprintf(stdout, "NOTICE: "); | ||
|
||
va_start(ap, fmt); | ||
vfprintf(stdout, fmt, ap); | ||
va_end(ap); | ||
fprintf(stdout, "\n"); | ||
} | ||
|
||
void log_and_exit(const char *fmt, ...) { | ||
va_list ap; | ||
|
||
fprintf(stdout, "ERROR: "); | ||
|
||
va_start(ap, fmt); | ||
vfprintf(stdout, fmt, ap); | ||
va_end(ap); | ||
fprintf(stdout, "\n"); | ||
exit(1); | ||
} | ||
|
||
int main() { | ||
initGEOS(notice, log_and_exit); | ||
printf("GEOS version %s\n", GEOSversion()); | ||
|
||
finishGEOS(); | ||
|
||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package | ||
${CMAKE_CURRENT_BINARY_DIR}/test_package) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
versions: | ||
"3.12.0": | ||
folder: all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"0.17": | ||
url: "https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz" | ||
sha256: "024d302a3aadcbf9f78735320a6d5aedf8b77876c8ac8bbb95081ca55054c7eb" |
Oops, something went wrong.