### Clone Cesium Gem Repository Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Documentation/developer-setup.md Clone the Cesium Gem repository and its submodules to get the complete source code. ```bash git clone git@github.com:CesiumGS/cesium-o3de.git --recurse-submodules ``` -------------------------------- ### Get Platform Specific Directory Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Retrieves the platform-specific directory for the current CMakeLists.txt file, considering potential restricted paths. ```cmake # Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} # Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. # i.e. It could here in our gem : Gems/Cesium/Code/Platform/ or # //Gems/Cesium/Code ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) ``` -------------------------------- ### Compile Cesium Native and Third-Party Libraries Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Documentation/developer-setup.md Build and package Cesium Native and other required third-party libraries for the Gem. This should be run from the Cesium Gem repo directory. ```bash cd External cmake -B Build -S . cmake --build Build --config release --target install ``` -------------------------------- ### Define Cesium.Editor.Static Target (Host Tools) Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Defines the Cesium.Editor.Static library target for host tools, including editor-specific files, include directories, and build dependencies. ```cmake if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME Cesium.Editor.Static STATIC NAMESPACE Gem AUTOMOC AUTORCC FILES_CMAKE cesium_editor_files.cmake INCLUDE_DIRECTORIES PRIVATE Source PUBLIC Include BUILD_DEPENDENCIES PUBLIC AZ::AzToolsFramework Gem::AtomToolsFramework.Static Gem::Cesium.Static ) ly_add_target( NAME Cesium.Editor GEM_MODULE NAMESPACE Gem AUTOMOC AUTORCC OUTPUT_NAME Gem.Cesium.Editor FILES_CMAKE cesium_editor_shared_files.cmake INCLUDE_DIRECTORIES PRIVATE Source PUBLIC Include BUILD_DEPENDENCIES PUBLIC Gem::Cesium.Editor.Static ) # By default, we will specify that the above target Cesium would be used by # Tool and Builder type targets when this gem is enabled. If you don't want it # active in Tools or Builders by default, delete one of both of the following lines: ly_create_alias(NAME Cesium.Tools NAMESPACE Gem TARGETS Gem::Cesium.Editor) ly_create_alias(NAME Cesium.Builders NAMESPACE Gem TARGETS Gem::Cesium.Editor) endif() ``` -------------------------------- ### Include Platform Specific Traits Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Includes the CMake file containing platform-specific traits based on the determined platform abstraction layer (PAL) directory. ```cmake # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this gem # is supported by this platform. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) ``` -------------------------------- ### Update Git Submodules Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Documentation/developer-setup.md If submodules were not initialized during the initial clone, use this command to update and initialize them. ```bash git submodule update --init --recursive ``` -------------------------------- ### Define Cesium.Static Target Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Defines the Cesium.Static library target, including common and platform-specific files, include directories, build dependencies, and compile definitions. ```cmake # Add the Cesium.Static target # Note: We include the common files and the platform specific files which are set in cesium_common_files.cmake # and in ${pal_dir}/cesium_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake ly_add_target( NAME Cesium.Static STATIC NAMESPACE Gem FILES_CMAKE cesium_files.cmake ${pal_dir}/cesium_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC Include PRIVATE Source BUILD_DEPENDENCIES PUBLIC 3rdParty::AWSNativeSDK::Core 3rdParty::CesiumNative 3rdParty::mikkelsen 3rdParty::zlib AZ::AzCore AZ::AzFramework AZ::AWSNativeSDKInit Legacy::CryCommon Gem::Atom_RPI.Public Gem::Atom_Feature_Common.Static Gem::LyShine.Static COMPILE_DEFINITIONS PUBLIC SPDLOG_COMPILED_LIB LIBASYNC_STATIC TIDY_STATIC ) ``` -------------------------------- ### Add Cesium.Tests to Googletest Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Integrates the Cesium.Tests target with the googletest framework. ```cmake ly_add_googletest( NAME Gem::Cesium.Tests ) ``` -------------------------------- ### Create Cesium Aliases Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Creates aliases for the Cesium target to be used by Client and Server targets by default when the gem is enabled. ```cmake # By default, we will specify that the above target Cesium would be used by # Client and Server type targets when this gem is enabled. If you don't want it # active in Clients or Servers by default, delete one of both of the following lines: ly_create_alias(NAME Cesium.Clients NAMESPACE Gem TARGETS Gem::Cesium) ly_create_alias(NAME Cesium.Servers NAMESPACE Gem TARGETS Gem::Cesium) ``` -------------------------------- ### Add Cesium.Editor.Tests to Googletest Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Integrates the Cesium.Editor.Tests target with the googletest framework. ```cmake ly_add_googletest( NAME Gem::Cesium.Editor.Tests ) ``` -------------------------------- ### Add CesiumNative Third Party Package Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Configures the CesiumNative package by setting server URLs, reading its SHA256 checksum, and associating it with a target. ```cmake # Add CesiumNative as a third party set(LY_PACKAGE_SERVER_URLS "${LY_PACKAGE_SERVER_URLS};file:///${CMAKE_CURRENT_LIST_DIR}/../External/Packages/Install" FORCE) file(READ ${CMAKE_CURRENT_LIST_DIR}/../External/Packages/Install/SHA256SUMS CesiumNative_SHA256_PACKAGE) ly_associate_package(PACKAGE_NAME CesiumNative TARGETS CesiumNative PACKAGE_HASH ${CesiumNative_SHA256_PACKAGE}) ``` -------------------------------- ### Add Cesium.Editor.Tests CMake Target Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Conditionally adds the Cesium.Editor.Tests target for host platforms if editor tests are supported. It defines source files, include directories, and build dependencies. ```cmake ly_add_target( NAME Cesium.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem FILES_CMAKE cesium_editor_tests_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests Source BUILD_DEPENDENCIES PRIVATE AZ::AzTest Gem::Cesium.Editor ) ``` -------------------------------- ### Define Cesium Target Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Defines the Cesium library target, which depends on Cesium.Static. It includes shared files and platform-specific files. ```cmake # Here add Cesium target, it depends on the Cesium.Static ly_add_target( NAME Cesium ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} NAMESPACE Gem FILES_CMAKE cesium_shared_files.cmake ${pal_dir}/cesium_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PRIVATE Source PUBLIC Include BUILD_DEPENDENCIES PRIVATE Gem::Cesium.Static ) ``` -------------------------------- ### Add Cesium.Tests CMake Target Source: https://github.com/sunniystudio/cesium-o3de/blob/main/Code/CMakeLists.txt Conditionally adds the Cesium.Tests target if build tests and Cesium tests are supported. It specifies source files, include directories, and build dependencies. ```cmake ly_add_target( NAME Cesium.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem FILES_CMAKE cesium_files.cmake cesium_tests_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests Source BUILD_DEPENDENCIES PRIVATE AZ::AzTest AZ::AzFramework Gem::Cesium.Static ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.