Skip to content

osgEarthCesium ported to Cesium Native 0.52.1. - #2853

Open
remoe wants to merge 1 commit into
pelicanmapping:masterfrom
remoe:fix/cesium-native-0.52-build
Open

osgEarthCesium ported to Cesium Native 0.52.1.#2853
remoe wants to merge 1 commit into
pelicanmapping:masterfrom
remoe:fix/cesium-native-0.52-build

Conversation

@remoe

@remoe remoe commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

The following changes to Cesium Native are relevant for this port:

  • Renamed ImageCesium to ImageAsset (v0.41.0)
  • Switched from gsl::span to std::span throughout the library and API. The GSL library has been removed. (0.42.0)
  • Refactored CreditSystem (v0.47.0)

I've not tested FindCesiumNative.cmake because I use my own. I built Cesium Native with own CMake based package system but I let build the static library dependencies with vcpkg. But the current one should partially work as well.

Here is a part of my draft version:

...

# 1) Blend2D (used by CesiumVectorData)
find_package(blend2d REQUIRED
  PATHS ${CESIUM_NATIVE_DEP_PREFIX}
  NO_DEFAULT_PATH
)

# 2) picosha2 (header-only; some builds have no *Config.cmake)

find_package(picosha2 CONFIG QUIET
  PATHS ${CESIUM_NATIVE_DEP_PREFIX}
 NO_DEFAULT_PATH
)

# picosha2 doesn't provide a config in vcpkg 
if(NOT picosha2_FOUND)
  find_path(PICOSHA2_INCLUDE_DIR
    NAMES picosha2.h picosha2/picosha2.h
    PATHS ${CESIUM_NATIVE_DEP_PREFIX}
    PATH_SUFFIXES include Include
    NO_DEFAULT_PATH
  )

  add_library(picosha2::picosha2 INTERFACE IMPORTED)
  set_target_properties(picosha2::picosha2 PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${PICOSHA2_INCLUDE_DIR}"
  )
endif()

find_package(cesium-native REQUIRED)

set(CESIUM_NATIVE_IMPORT_LIBRARIES "")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "${CESIUM_NATIVE_DIR}")

list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "Cesium3DTilesSelection")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumIonClient")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumRasterOverlays")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "Cesium3DTilesContent")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "Cesium3DTilesReader")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "Cesium3DTiles")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumQuantizedMeshTerrain")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumGltfContent")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumGltfReader")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumGltf")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumGeospatial")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumGeometry")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumAsync")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumJsonReader")
list(APPEND CESIUM_NATIVE_IMPORT_LIBRARIES "CesiumUtility") 

if(cesium-native_FOUND)
    set(CESIUM_NATIVE_FOUND TRUE)
    add_library(OE::CESIUM_NATIVE INTERFACE IMPORTED)
    set_property(TARGET OE::CESIUM_NATIVE PROPERTY
        INTERFACE_LINK_LIBRARIES ${CESIUM_NATIVE_IMPORT_LIBRARIES} )
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CesiumNative DEFAULT_MSG CESIUM_NATIVE_FOUND)

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant