diff --git a/CMakeModules/FindCesiumNative.cmake b/CMakeModules/FindCesiumNative.cmake index 9fb90ff71c..82d331b69e 100644 --- a/CMakeModules/FindCesiumNative.cmake +++ b/CMakeModules/FindCesiumNative.cmake @@ -9,9 +9,9 @@ FIND_PATH(CESIUM_NATIVE_INCLUDE_DIR CesiumUtility/Uri.h MACRO( FIND_CESIUM_LIBRARY MYLIBRARY MYLIBRARYNAME ) -FIND_LIBRARY(${MYLIBRARY} +FIND_LIBRARY(${MYLIBRARY}_LIBRARY_DEBUG NAMES - ${MYLIBRARYNAME} + ${MYLIBRARYNAME}d PATHS ${CESIUM_NATIVE_DIR}/lib $ENV{CESIUM_NATIVE_DIR} @@ -19,34 +19,46 @@ FIND_LIBRARY(${MYLIBRARY} NO_DEFAULT_PATH ) +FIND_LIBRARY(${MYLIBRARY}_LIBRARY_RELEASE + NAMES + ${MYLIBRARYNAME} + PATHS + ${CESIUM_NATIVE_DIR}/lib + $ENV{CESIUM_NATIVE_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + ) + +select_library_configurations(${MYLIBRARY}) + ENDMACRO(FIND_CESIUM_LIBRARY LIBRARY LIBRARYNAME) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_LIBRARY Cesium3DTiles) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_SELECTION_LIBRARY Cesium3DTilesSelection) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GEOSPATIAL_LIBRARY CesiumGeospatial) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_UTILITY_LIBRARY CesiumUtility) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ION_CLIENT_LIBRARY CesiumIonClient) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF_READER_LIBRARY CesiumGltfReader) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_READER_LIBRARY Cesium3DTilesReader) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GEOMETRY_LIBRARY CesiumGeometry) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF_LIBRARY CesiumGltf) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_KTX_READ_LIBRARY ktx_read) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_DRACO_LIBRARY draco) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_SPDLOG_LIBRARY spdlog) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ASYNC++_LIBRARY async++) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_WEBPDECODER_LIBRARY webpdecoder) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_MESHOPTIMIZER_LIBRARY meshoptimizer) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_URIPARSER_LIBRARY uriparser) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_TURBOJPEG_LIBRARY turbojpeg) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_CSPRNG_LIBRARY csprng) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_MODPB64_LIBRARY modp_b64) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_JSONREADER_LIBRARY CesiumJsonReader) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ASYNC_LIBRARY CesiumAsync) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_S2GEOMETRY_LIBRARY s2geometry) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_RASTER_OVERLAYS_LIBRARY CesiumRasterOverlays) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_CONTENT_LIBRARY Cesium3DTilesContent) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF_CONTENT_LIBRARY CesiumGltfContent) -FIND_CESIUM_LIBRARY(CESIUM_NATIVE_TINYXML2_LIBRARY tinyxml2) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES Cesium3DTiles) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_SELECTION Cesium3DTilesSelection) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GEOSPATIAL CesiumGeospatial) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_UTILITY CesiumUtility) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ION_CLIENT CesiumIonClient) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF_READER CesiumGltfReader) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_READER Cesium3DTilesReader) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GEOMETRY CesiumGeometry) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF CesiumGltf) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_KTX_READ ktx_read) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_DRACO draco) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_SPDLOG spdlog) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ASYNC++ async++) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_WEBPDECODER webpdecoder) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_MESHOPTIMIZER meshoptimizer) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_URIPARSER uriparser) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_TURBOJPEG turbojpeg) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_CSPRNG csprng) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_MODPB64 modp_b64) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_JSONREADER CesiumJsonReader) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_ASYNC CesiumAsync) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_S2GEOMETRY s2geometry) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_RASTER_OVERLAYS CesiumRasterOverlays) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_3DTILES_CONTENT Cesium3DTilesContent) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_GLTF_CONTENT CesiumGltfContent) +FIND_CESIUM_LIBRARY(CESIUM_NATIVE_TINYXML2 tinyxml2) diff --git a/CMakeModules/FindDraco.cmake b/CMakeModules/FindDraco.cmake index 8040216c72..4efa9de3aa 100644 --- a/CMakeModules/FindDraco.cmake +++ b/CMakeModules/FindDraco.cmake @@ -30,6 +30,8 @@ else() find_library(draco_LIBRARIES NAMES draco.lib libdraco.a) endif() +select_library_configurations(draco) + # Store path to library. get_filename_component(draco_LIBRARY_DIRS ${draco_LIBRARIES} DIRECTORY) diff --git a/src/osgEarthCesium/PrepareRenderResources.cpp b/src/osgEarthCesium/PrepareRenderResources.cpp index a38995b80e..7b92f348d7 100644 --- a/src/osgEarthCesium/PrepareRenderResources.cpp +++ b/src/osgEarthCesium/PrepareRenderResources.cpp @@ -35,6 +35,11 @@ using namespace osgEarth::Cesium; namespace { + #ifdef GL_R + const GLenum redFormat = GL_R; + #else + const GLenum redFormat = GL_RED; + #endif osg::Image* getOsgImage(CesiumGltf::ImageCesium& image) { @@ -48,7 +53,7 @@ namespace switch (image.channels) { case 1: - format = GL_R; + format = redFormat; texFormat = GL_R8; break; case 2: @@ -82,7 +87,7 @@ namespace texFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case CesiumGltf::GpuCompressedPixelFormat::BC4_R: - format = GL_R; + format = redFormat; texFormat = GL_COMPRESSED_RED_RGTC1_EXT; break; case CesiumGltf::GpuCompressedPixelFormat::BC5_RG: @@ -114,7 +119,7 @@ namespace return nullptr; break; case CesiumGltf::GpuCompressedPixelFormat::ETC2_EAC_R11: - format = GL_R; + format = redFormat; texFormat = GL_COMPRESSED_R11_EAC; break; case CesiumGltf::GpuCompressedPixelFormat::ETC2_EAC_RG11: