diff --git a/recipes/osgearth/all/CMakeLists.txt b/recipes/osgearth/all/CMakeLists.txt new file mode 100644 index 0000000000000..c394d4b3d7dca --- /dev/null +++ b/recipes/osgearth/all/CMakeLists.txt @@ -0,0 +1,77 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +if(WIN32) + add_compile_definitions(NOGDI) +endif() + +# osgearth ships with custom cmake find modules. Unfortunately these set +# different variables than the ones generated by conan (most notably *_LIBRARY +# instead of *_LIBRARIES, but also different names). In the following +# these different variables are set using the variables set by conan's +# find modules. + +# OSG +find_package(OpenSceneGraph REQUIRED) + +set(OSG_PLUGINS "osgPlugins-${OPENSCENEGRAPH_VERSION}" CACHE STRING "" FORCE) +set(OSG_LIBRARY ${OPENSCENEGRAPH_LIBRARIES}) +set(OSG_FOUND ${OPENSCENEGRAPH_FOUND}) +set(OSG_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIRS}) +set(OSG_INCLUDE_DIR "${OPENSCENEGRAPH_INCLUDE_DIRS}") +set(OSG_GEN_INCLUDE_DIR "${OPENSCENEGRAPH_INCLUDE_DIRS}") + +# gdal +find_package(GDAL REQUIRED) +set(GDAL_LIBRARY ${GDAL_LIBRARIES}) + +# curl +find_package(CURL REQUIRED) +set(CURL_LIBRARY ${CURL_LIBRARIES}) + +# protobuf +find_package(Protobuf) +set(Protobuf_INCLUDE_DIR ${protobuf_INCLUDE_DIR}) +set(Protobuf_LIBRARIES ${protobuf_LIBRARIES}) + +# GEOS +if (OSGEARTH_WITH_GEOS) + find_package(geos) +endif () +set(GEOS_LIBRARY ${GEOS_LIBS}) +set(GEOS_FOUND ${GEOS_LIBRARY}) + +# SQLite3 +if (OSGEARTH_WITH_SQLITE3) + find_package(SQLite3) +endif () +set(SQLITE3_FOUND ${SQLite3_FOUND}) +set(SQLITE3_LIBRARY ${SQLite_LIBRARIES}) +set(SQLITE3_INCLUDE_DIR ${SQLite_INCLUDE_DIR}) + +# WebP +if (OSGEARTH_WITH_WEBP) + find_package(WebP) +endif () +set(WEBP_FOUND ${WebP_FOUND}) +set(WEBP_LIBRARY ${WebP_LIBRARIES}) +set(WEBP_INCLUDE_DIR ${WebP_INCLUDE_DIR}) + +# libzip +if (OSGEARTH_BUILD_ZIP_PLUGIN) + find_package(LIBZIP) +endif () +set(LIBZIP_FOUND ${libzip_FOUND}) +set(LIBZIP_LIBRARY ${libzip_LIBRARIES}) +set(LIBZIP_INCLUDE_DIR ${libzip_INCLUDE_DIR}) + +# leveldb +find_package(leveldb) +set(LEVELDB_FOUND ${leveldb_FOUND}) +set(LEVELDB_LIBRARY ${leveldb_LIBRARIES}) +set(LEVELDB_INCLUDE_DIR ${leveldb_INCLUDE_DIR}) + +add_subdirectory(source_subfolder) diff --git a/recipes/osgearth/all/conandata.yml b/recipes/osgearth/all/conandata.yml new file mode 100644 index 0000000000000..326d8584c8f7f --- /dev/null +++ b/recipes/osgearth/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + '3.2': + sha256: 7e1dd643b1f3b8d1ba9561b899c18176af988342b86c42d89a70be924cb747f6 + url: https://github.com/gwaldron/osgearth/archive/refs/tags/osgearth-3.2.tar.gz +patches: + '3.2': + - patch_file: patches/3.2-osgearth.patch + base_path: source_subfolder diff --git a/recipes/osgearth/all/conanfile.py b/recipes/osgearth/all/conanfile.py new file mode 100644 index 0000000000000..23358c88b035c --- /dev/null +++ b/recipes/osgearth/all/conanfile.py @@ -0,0 +1,299 @@ +from conans import ConanFile, CMake, tools +from conan.tools.files import rename +from conans.errors import ConanInvalidConfiguration +from conans.tools import os_info +import os + + +class OsgearthConan(ConanFile): + name = "osgearth" + license = "LGPL-3.0" + url = "https://github.com/conan-io/conan-center-index" + description = "osgEarth is a C++ geospatial SDK and terrain engine. \ + Just create a simple XML file, point it at your map data, \ + and go! osgEarth supports all kinds of data and comes with \ + lots of examples to help you get up and running quickly \ + and easily." + topics = "openscenegraph", "graphics" + settings = "os", "compiler", "build_type", "arch" + homepage = "http://osgearth.org/" + options = { + "shared": [True, False], + "fPIC": [True, False], + "build_procedural_nodekit": [True, False], + # "build_triton_nodekit": [True, False], + # "build_silverlining_nodekit": [True, False], + "build_leveldb_cache": [True, False], + "build_rocksdb_cache": [True, False], + "build_zip_plugin": [True, False], + "enable_geocoder": [True, False], + "with_geos": [True, False], + "with_sqlite3": [True, False], + "with_draco": [True, False], + # "with_basisu": [True, False], + # "with_glew": [True, False], + "with_protobuf": [True, False], + "with_webp": [True, False], + "install_shaders": [True, False], + "enable_nvtt_cpu_mipmaps": [True, False], + "enable_wininet_for_http": [True, False], + } + + default_options = { + "shared": False, + "fPIC": True, + "build_procedural_nodekit": True, + # "build_triton_nodekit": False, + # "build_silverlining_nodekit": False, + "build_leveldb_cache": False, + "build_rocksdb_cache": False, + "build_zip_plugin": True, + "enable_geocoder": False, + "with_geos": True, + "with_sqlite3": True, + "with_draco": False, + # "with_basisu": False, + # "with_glew": True, + "with_protobuf": True, + "with_webp": True, + "install_shaders": True, + "enable_nvtt_cpu_mipmaps": False, + "enable_wininet_for_http": False, + } + + short_paths = True + exports_sources = "CMakeLists.txt", "patches/*.patch" + generators = "cmake", "cmake_find_package" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, 11) + elif self.settings.compiler == "apple-clang": + raise ConanInvalidConfiguration("With apple-clang cppstd needs to be set, since default is not at least c++11.") + + def configure(self): + if self.options.shared: + del self.options.fPIC + + def config_options(self): + if self.settings.os != "Windows": + self.options.enable_wininet_for_http = False + + if self.settings.os == "Windows": + del self.options.fPIC + + if self.settings.compiler == "Visual Studio": + self.options.build_procedural_nodekit = False + + if self.settings.compiler == "gcc" and self.settings.compiler.version == "11": + # need draco >= 1.4.0 for gcc11 + # https://github.com/google/draco/issues/635 + self.options.with_draco = False + + def requirements(self): + + self.requires("opengl/system") + self.requires("gdal/3.3.1") + self.requires("openscenegraph/3.6.5") + self.requires("libcurl/7.79.1") + + self.requires("libtiff/4.3.0", override=True) + self.requires("openssl/1.1.1l", override=True) + + # if self.options.build_triton_nodekit: + # self.requires("triton_nodekit") + # if self.options.build_silverlining_nodekit: + # self.requires("silverlining_nodekit") + if self.options.build_leveldb_cache: + self.requires("leveldb/1.22") + if self.options.build_rocksdb_cache: + self.requires("rocksdb/6.20.3") + if self.options.build_zip_plugin: + self.requires("libzip/1.7.3") + self.requires("zstd/1.4.9") # override + if self.options.with_geos: + self.requires("geos/3.9.1") + if self.options.with_sqlite3: + self.requires("sqlite3/3.36.0") + if self.options.with_draco: + self.requires("draco/1.4.3") + # if self.options.with_basisu: + # self.requires("basisu") + # if self.options.with_glew: + # self.requires("glew/2.2.0") + if self.options.with_protobuf: + self.requires("protobuf/3.17.1") + if self.options.with_webp: + self.requires("libwebp/1.2.0") + + def _patch_sources(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) + + for package in ("Draco", "GEOS", "LevelDB", "OSG", "RocksDB", "Sqlite3", "WEBP"): + # Prefer conan's find package scripts over osgEarth's + os.unlink(os.path.join(self._source_subfolder, "CMakeModules", "Find{}.cmake".format(package))) + + def source(self): + tools.get(**self.conan_data["sources"][self.version], + destination=self._source_subfolder, strip_root=True) + + self._patch_sources() + + def _configured_cmake(self): + if hasattr(self, "_cmake"): + return self._cmake + + self._cmake = cmake = CMake(self) + cmake.definitions["OSGEARTH_BUILD_SHARED_LIBS"] = self.options.shared + cmake.definitions["OSGEARTH_BUILD_TOOLS"] = False + cmake.definitions["OSGEARTH_BUILD_EXAMPLES"] = False + cmake.definitions["OSGEARTH_BUILD_TESTS"] = False + + cmake.definitions["OSGEARTH_BUILD_PROCEDURAL_NODEKIT"] = self.options.build_procedural_nodekit + # cmake.definitions["OSGEARTH_BUILD_TRITON_NODEKIT"] = self.options.build_triton_nodekit + # cmake.definitions["OSGEARTH_BUILD_SILVERLINING_NODEKIT"] = self.options.build_silverlining_nodekit + cmake.definitions["OSGEARTH_BUILD_LEVELDB_CACHE"] = self.options.build_leveldb_cache + cmake.definitions["OSGEARTH_BUILD_ROCKSDB_CACHE"] = self.options.build_rocksdb_cache + cmake.definitions["OSGEARTH_BUILD_ZIP_PLUGIN"] = self.options.build_zip_plugin + cmake.definitions["OSGEARTH_ENABLE_GEOCODER"] = self.options.enable_geocoder + + cmake.definitions["WITH_EXTERNAL_DUKTAPE"] = False + cmake.definitions["WITH_EXTERNAL_TINYXML"] = False + cmake.definitions["CURL_IS_STATIC"] = not self.options["libcurl"].shared + cmake.definitions["CURL_INCLUDE_DIR"] = self.deps_cpp_info["libcurl"].include_paths[0] + cmake.definitions["OSGEARTH_INSTALL_SHADERS"] = self.options.install_shaders + cmake.definitions["OSGEARTH_ENABLE_NVTT_CPU_MIPMAPS"] = self.options.enable_nvtt_cpu_mipmaps + cmake.definitions["OSGEARTH_ENABLE_WININET_FOR_HTTP"] = self.options.enable_wininet_for_http + + # our own defines for using in our top-level CMakeLists.txt + cmake.definitions["OSGEARTH_WITH_GEOS"] = self.options.with_geos + cmake.definitions["OSGEARTH_WITH_SQLITE3"] = self.options.with_sqlite3 + cmake.definitions["OSGEARTH_WITH_WEBP"] = self.options.with_webp + + cmake.configure() + + return cmake + + def build(self): + self._configured_cmake().build() + + def package(self): + self._configured_cmake().install() + self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + + if self.options.install_shaders: + rename(self, os.path.join(self.package_folder, "resources"), os.path.join(self.package_folder, "res")) + + if os_info.is_linux: + rename(self, os.path.join(self.package_folder, "lib64"), os.path.join(self.package_folder, "lib")) + + def package_info(self): + if self.settings.build_type == "Debug": + postfix = "d" + elif self.settings.build_type == "RelWithDebInfo": + postfix = "rd" + elif self.settings.build_type == "MinSizeRel": + postfix = "s" + else: + postfix = "" + + def setup_lib(library, required_components): + lib = self.cpp_info.components[library] + lib.libs = [library + postfix] + + for source_lib, components in required_components.items(): + lib.requires += [source_lib + "::" + comp for comp in components] + + return lib + + # osgEarth the main lib + required_libs = {"openscenegraph": ["osg", "osgUtil", "osgSim", "osgViewer", "osgText", "osgGA", "osgShadow", + "OpenThreads", "osgManipulator"], + "libcurl": ["libcurl"], + "gdal": ["gdal"], + "opengl": ["opengl"], + } + + osgearth = setup_lib("osgEarth", required_libs) + + if not self.options.shared and self.settings.compiler == "Visual Studio": + osgearth.defines += ["OSGEARTH_LIBRARY_STATIC"] + if self.options.build_zip_plugin: + osgearth.requires += ["libzip::libzip"] + osgearth.requires += ["zstd::zstd"] + if self.options.with_geos: + osgearth.requires += ["geos::geos"] + if self.options.with_sqlite3: + osgearth.requires += ["sqlite3::sqlite3"] + if self.options.with_protobuf: + osgearth.requires += ["protobuf::protobuf"] + if self.options.with_webp: + osgearth.requires += ["libwebp::libwebp"] + + # osgEarthProcedural + if self.options.build_procedural_nodekit: + setup_lib("osgEarthProcedural", {}).requires.append("osgEarth") + + # plugins + def setup_plugin(plugin): + libname = "osgdb_" + plugin + plugin_library = self.cpp_info.components[libname] + plugin_library.libs = [] if self.options.shared else [libname + postfix] + plugin_library.requires = ["osgEarth"] + if not self.options.shared: + plugin_library.libdirs = [os.path.join("lib", "osgPlugins-{}" + .format(self.deps_cpp_info["openscenegraph"].version))] + return plugin_library + + setup_plugin("osgearth_bumpmap") + setup_plugin("osgearth_cache_filesystem") + + if self.options.build_leveldb_cache: + setup_plugin("osgearth_cache_leveldb").requires.append("leveldb::leveldb") + + if self.options.build_rocksdb_cache: + setup_plugin("osgearth_cache_rocksdb").requires.append("rocksdb::rocksdb") + + setup_plugin("osgearth_bumpmap") + setup_plugin("osgearth_cache_filesystem") + setup_plugin("osgearth_colorramp") + setup_plugin("osgearth_detail") + setup_plugin("earth") + setup_plugin("osgearth_engine_rex") + setup_plugin("osgearth_featurefilter_intersect") + setup_plugin("osgearth_featurefilter_join") + setup_plugin("gltf") + setup_plugin("kml") + setup_plugin("osgearth_mapinspector") + setup_plugin("osgearth_monitor") + setup_plugin("osgearth_scriptengine_javascript") + setup_plugin("osgearth_sky_gl") + setup_plugin("osgearth_sky_simple") + setup_plugin("template") + setup_plugin("osgearth_terrainshader") + + if self.options.with_webp: + setup_plugin("webp").requires.append("libwebp::libwebp") + + setup_plugin("lerc") + setup_plugin("osgearth_vdatum_egm2008") + setup_plugin("osgearth_vdatum_egm84") + setup_plugin("osgearth_vdatum_egm96") + setup_plugin("osgearth_viewpoints") + setup_plugin("fastdxt") + + if self.settings.os == "Windows": + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.PATH.append(os.path.join(self.package_folder, "bin/osgPlugins-{}" + .format(self.deps_cpp_info["openscenegraph"].version))) + elif self.settings.os == "Linux": + self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, "lib")) diff --git a/recipes/osgearth/all/patches/3.2-osgearth.patch b/recipes/osgearth/all/patches/3.2-osgearth.patch new file mode 100644 index 0000000000000..a5dba06fe428d --- /dev/null +++ b/recipes/osgearth/all/patches/3.2-osgearth.patch @@ -0,0 +1,171 @@ +diff --git a/src/osgEarthProcedural/GroundCoverLayer.cpp b/src/osgEarthProcedural/GroundCoverLayer.cpp +--- a/src/osgEarthProcedural/GroundCoverLayer.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/GroundCoverLayer.cpp (date 1639490999900) +@@ -1329,7 +1329,8 @@ + void + GroundCoverLayer::Renderer::releaseGLObjects(osg::State* state) const + { +- _cameraState.forEach(CameraStateRGLO(state)); ++ CameraStateRGLO state_rglo(state); ++ _cameraState.forEach(state_rglo); + + if (_texArena.valid()) + { +diff --git a/src/osgEarthProcedural/LifeMapLayer.cpp b/src/osgEarthProcedural/LifeMapLayer.cpp +--- a/src/osgEarthProcedural/LifeMapLayer.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/LifeMapLayer.cpp (date 1639490999912) +@@ -206,7 +206,7 @@ + std::vector> hits; + + if (_index.Search(a_min, a_max, &hits, ~0) == 0) +- return false; ++ return nullptr; + + const LifeMapValue* result = nullptr; + +@@ -223,7 +223,7 @@ + return result; + } + } +- return false; ++ return nullptr; + } + }; + } +diff --git a/src/osgEarth/Units b/src/osgEarth/Units +--- a/src/osgEarth/Units (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarth/Units (date 1639490999868) +@@ -196,17 +196,17 @@ + class qualified_double + { + public: +- qualified_double( double value, const Units& units ) : _value(value), _units(units) { } ++ qualified_double( double value, const Units& units ) : _value(value), _units(units) { } + +- qualified_double( const T& rhs ) : _value(rhs._value), _units(rhs._units) { } ++ qualified_double( const T& rhs ) : _value(rhs._value), _units(rhs._units) { } + + // parses the qualified number from a parseable string (e.g., "123km") +- qualified_double(const std::string& parseable, const Units& defaultUnits) : _value(0.0), _units(defaultUnits) { ++ qualified_double(const std::string& parseable, const Units& defaultUnits) : _value(0.0), _units(defaultUnits) { + Units::parse( parseable, _value, _units, defaultUnits ); + } + + // loads the qualified number from an old-school config (e.g., { value="123" units="km" } ) +- qualified_double( const Config& conf, const Units& defaultUnits ) : _value(0.0) { ++ qualified_double( const Config& conf, const Units& defaultUnits ) : _value(0.0) { + if ( conf.hasValue("value") ) { + _value = conf.value("value", 0.0); + if ( !Units::parse( conf.value("units"), _units ) ) +diff --git a/src/osgEarthProcedural/CMakeLists.txt b/src/osgEarthProcedural/CMakeLists.txt +--- a/src/osgEarthProcedural/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthProcedural/CMakeLists.txt (date 1639490999885) +@@ -102,4 +102,5 @@ + # Add this project to the NodeKits solution folder + set_property( TARGET ${LIB_NAME} PROPERTY FOLDER "NodeKits" ) + +-INCLUDE(ModuleInstall OPTIONAL) +\ No newline at end of file ++INCLUDE(ModuleInstall OPTIONAL) ++INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/source_subfolder/src/osgEarth) +\ No newline at end of file +diff --git a/src/osgEarth/CMakeLists.txt b/src/osgEarth/CMakeLists.txt +--- a/src/osgEarth/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarth/CMakeLists.txt (date 1639490999857) +@@ -494,7 +494,7 @@ + + + SET(VERSION_GIT_SOURCE "") +-find_package(git) ++find_package(Git) + if (GIT_FOUND) + option(OSGEARTH_EMBED_GIT_SHA "Encode the SHA in the Version header code" OFF) + if(OSGEARTH_EMBED_GIT_SHA) +diff --git a/src/osgEarthDrivers/fastdxt/dxt.cpp b/src/osgEarthDrivers/fastdxt/dxt.cpp +--- a/src/osgEarthDrivers/fastdxt/dxt.cpp (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthDrivers/fastdxt/dxt.cpp (date 1639491170857) +@@ -119,7 +119,11 @@ + int &outputBytes ) + { + byte *tmpBuf; ++#ifdef __MINGW32__ ++ tmpBuf = (byte*)__mingw_aligned_malloc(width*height*4,16); ++#else + tmpBuf = (byte*)memalign(16, width*height*4); ++#endif + memset(tmpBuf, 0, width*height*4); + RGBAtoYCoCg(inBuf, tmpBuf, width, height); + CompressImageDXT5(tmpBuf, outBuf, width, height, outputBytes); +diff --git a/CMakeModules/OsgEarthMacroUtils.cmake b/CMakeModules/OsgEarthMacroUtils.cmake +--- a/CMakeModules/OsgEarthMacroUtils.cmake (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/CMakeModules/OsgEarthMacroUtils.cmake (date 1639490999842) +@@ -505,7 +505,7 @@ + + # generate the build-time script that will create out cpp file with inline shaders: + configure_file( +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureShaders.cmake" + @ONLY) + +@@ -518,7 +518,7 @@ + DEPENDS + ${GLSL_FILES} + "${TEMPLATE_FILE}" +- "${CMAKE_SOURCE_DIR}/CMakeModules/ConfigureShaders.cmake.in" ) ++ "${CMAKE_SOURCE_DIR}/source_subfolder/CMakeModules/ConfigureShaders.cmake.in" ) + + endmacro(configure_shaders) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/CMakeLists.txt (date 1639490999923) +@@ -127,29 +127,14 @@ + find_package(OpenGL) + ENDIF (OSGEARTH_USE_GLES) + +-# required +-find_package(OSG REQUIRED) +-find_package(CURL REQUIRED) +-find_package(GDAL REQUIRED) +- + # optional +-find_package(GEOS) +-find_package(Sqlite3) +-find_package(Draco) +-find_package(BASISU) + find_package(GLEW) +-find_package(Protobuf) +-find_package(WEBP) + find_package(Blend2D) + + if(OSGEARTH_ENABLE_PROFILING) + find_package(Tracy) + endif() + +-if(OSGEARTH_BUILD_ZIP_PLUGIN) +- find_package(LIBZIP) +-endif() +- + if(OSGEARTH_BUILD_TRITON_NODEKIT) + find_package(Triton QUIET) + endif() +@@ -216,7 +201,8 @@ + INCLUDE(OsgEarthMacroUtils) + + # OpenSceneGraph is the 3D rendering toolkit +-DETECT_OSG_VERSION() ++set(OPENSCENEGRAPH_VERSION "3.6.5") ++set(OSG_PLUGINS "osgPlugins-${OPENSCENEGRAPH_VERSION}" CACHE STRING "" FORCE) + + IF (NOT OPENSCENEGRAPH_VERSION) + SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) +diff --git a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt +--- a/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (revision 15d5340f174212d6f93ae55c0d9af606c3d361c0) ++++ b/src/osgEarthDrivers/cache_leveldb/CMakeLists.txt (date 1639490999877) +@@ -1,5 +1,3 @@ +-FIND_PACKAGE(LevelDB) +- + IF(LEVELDB_FOUND) + + INCLUDE_DIRECTORIES( ${LEVELDB_INCLUDE_DIR} ) diff --git a/recipes/osgearth/all/test_package/CMakeLists.txt b/recipes/osgearth/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..3737cad073075 --- /dev/null +++ b/recipes/osgearth/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +set(CMAKE_CXX_STANDARD 11) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} CONAN_PKG::osgearth) diff --git a/recipes/osgearth/all/test_package/conanfile.py b/recipes/osgearth/all/test_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/osgearth/all/test_package/conanfile.py @@ -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) diff --git a/recipes/osgearth/all/test_package/test_package.cpp b/recipes/osgearth/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..84fb80ae0a602 --- /dev/null +++ b/recipes/osgearth/all/test_package/test_package.cpp @@ -0,0 +1,6 @@ +#include + +int main( int argc, char** argv ) +{ + osgEarth::initialize(); +} diff --git a/recipes/osgearth/config.yml b/recipes/osgearth/config.yml new file mode 100644 index 0000000000000..8774dc1bd7eb4 --- /dev/null +++ b/recipes/osgearth/config.yml @@ -0,0 +1,3 @@ +versions: + '3.2': + folder: all