-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[osgearth] Add draco feature #13423
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
[osgearth] Add draco feature #13423
Changes from all commits
c0add3a
d0345a3
f4b34d9
b51cd97
770750a
3adac24
93a616c
a1d93e8
08c0a06
ff05971
ba669b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| Source: osgearth | ||
| Version: 3.1 | ||
| Homepage: https://github.com/gwaldron/osgearth | ||
| Port-Version: 1 | ||
| Homepage: https://github.com/gwaldron/osgearth | ||
| Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. | ||
| Build-Depends: osg[plugins] | ||
| Build-Depends: osg[plugins] | ||
|
|
||
| Feature: draco | ||
| Description: Build with Draco | ||
| Build-Depends: draco |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 049e37e..93bd89f 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -134,7 +134,6 @@ find_package(GDAL REQUIRED) | ||
| # optional | ||
| find_package(GEOS) | ||
| find_package(Sqlite3) | ||
| -find_package(Draco) | ||
| find_package(BASISU) | ||
| find_package(GLEW) | ||
| find_package(Protobuf) | ||
| @@ -162,9 +161,25 @@ IF(SQLITE3_FOUND) | ||
| ENDIF(SQLITE3_FOUND) | ||
|
|
||
| # DRACO enables geometry compression sometimes used in glTF: | ||
| +if(BUILD_WITH_DRACO) | ||
| + include(FindPackageHandleStandardArgs) | ||
| + include(SelectLibraryConfigurations) | ||
| + | ||
| + find_path(DRACO_INCLUDE_DIR draco/core/draco_version.h) | ||
| + find_library(DRACO_LIBRARY_DEBUG NAMES draco dracodec dracoenc libdraco libdracodec libdracoenc NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why isn't the draco port exposing the right bits here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I didn't make sense. Could you please help describe more details?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, there should probably be a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understand now. Thanks for your clarification.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried just making it REQUIRED and that seems to have passed over in #15777 ? |
||
| + find_library(DRACO_LIBRARY_RELEASE NAMES draco dracodec dracoenc libdraco libdracodec libdracoenc NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) | ||
| + | ||
| + select_library_configurations(DRACO) | ||
| + | ||
| + set(draco_INCLUDE_DIRS ${DRACO_INCLUDE_DIR}) | ||
| + set(draco_LIBRARIES ${DRACO_LIBRARY}) | ||
| + if(DRACO_LIBRARY) | ||
| + set(draco_FOUND 1) | ||
| + endif() | ||
| IF(draco_FOUND) | ||
| ADD_DEFINITIONS(-DOSGEARTH_HAVE_DRACO) | ||
| ENDIF(draco_FOUND) | ||
| +endif() | ||
|
|
||
| # GDAL is the underlying geospatial processing SDK | ||
| IF(GDAL_FOUND) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like these should also be listed as dependencies of the port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These ports are optional dependencies of the port. So I didn't add them to the dependency lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see here https://github.com/gwaldron/osgearth/blob/master/CMakeLists.txt#L134-L141
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're optional, but it makes this port behave totally differently depending on what other ports are selected. That is, it makes
and
produce completely different results. Generally we need to either provide all such optional components or patch them to always be off.
I think your fix here addresses the
Dracodependency, but the other dependencies here are just as likely to create the same problems.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would be better to add options for every optional dependency. We can add these ports to the dependency lists or make patches to fix them now. We can consider to ask for help from upstream to make optional dependencies more flexible for users.