Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build as an installable package and use vcpkg manifest mode to build standalone #1026

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

timoore
Copy link
Contributor

@timoore timoore commented Dec 5, 2024

This PR has several moving parts:

  • Package files for cesium-native created on installation. Any hackery needed to create targets for external targets is moved to CMake Find modules that are installed with the package files.
  • A single vcpkg overlay port for asycplusplus
  • vcpkg.json and vcpkg-configuration.json
  • A CMakePresets.json file demonstrating how to do a manifest mode bulid.

I'm using this branch to build vsgCs using cesium-native as a vcpkg overlay port. That usage needs to be documented here too. Also, while I've tried to preserve the old behavior using exvcpkg, I haven't tested this yet with Cesium for Unreal and other integrations in the classic style of using cesium-native as a CMake subdirectory.

This is basically the addition of the vcpkg.json manifest and
vcpkg-configuration.json, which are both pretty minimal. In practice,
projects will probably copy those and add overlays.
Should be a no-op at this point, but will be required when we make
Cesium Native installable.
The intent is for public target sources to be compiled into consumers
of a target, but that is a no-op for header files. Including the
public headers, which have paths pointing inside the project, causes
an error when generating an export set.
This create the CMake files that create targets in an imported
package.
Add a find module for zlib-ng, which can be installed and included by
a config package. Other find modules may be necessary too.
VCPKG_MANIFEST_MODE isn't available before project() is called, so
define a new variable CESIUM_USE_EZVCPKG to control the early
loading of ezvcpkg.
Individual integrations can add their own overlay if they need it.
Also, try to make sure that vcpkg actually uses the desired triplet.
@azrogers
Copy link
Contributor

azrogers commented Dec 9, 2024

Looks like this causes the following issue in cesium-unreal:

  CMake Error at cesium-native/cmake_install.cmake:940 (file):
    file cannot create directory:
    C:/Dev/prs/cesium-native-1026/Plugins/cesium-unreal/extern/../Source/ThirdParty/lib/Windows-AMD64-$<IF:$<CONFIG:Debug>,Debug,Release>/cmake/cesium-native.
    Maybe need administrative privileges.
  Call Stack (most recent call first):
    cmake_install.cmake:37 (include)

Not sure why this would have broken here - the cesium-unreal/extern CMakeLists.txt is unchanged here and I don't see why the CONFIG generator expression would stop evaluating correctly here.

@timoore
Copy link
Contributor Author

timoore commented Dec 9, 2024

Thanks for being brave enough to test this with Cesium Unreal! What generator was used to build cesium-native?

@timoore
Copy link
Contributor Author

timoore commented Dec 10, 2024

The problem is in the new cesium-native/CMakeLists.txt, which defines exports to install. The install(EXPORT...) command doesn't support generator expressions in its destination argument... which makes a certain amount of sense, even if it's inconsistent. The export files won't be used in the Unreal build, but I'll change the command to use a more suitable variable.

In the Cesium for Unreal build, CMAKE_INSTALL_LIBDIR contains
a generator expression, which the install(EXPORT ...) command doesn't
process correctly. So, install the configuration files such as
"cesium-nativeTargets.cmake" in
${CMAKE_INSTALL_DATADIR}/cesium-native/cmake, which is a perfectly
fine location.

These files aren't used by the Cesium Unreal build anyway.
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.

2 participants