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

[osg] Fix plugin installation and target locations #26214

Merged
merged 10 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions ports/osg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(APPEND "${CURRENT_PACKAGES_DIR}/include/osg/Config" "#ifndef OSG_LIBRARY_STATIC\n#define OSG_LIBRARY_STATIC 1\n#endif\n")
endif()

# Move all osg plugins to [/debug]/plugins/osgPlugins-${OSG_VER},
# as a staging area for later deployment.
set(osg_plugins_subdir "osgPlugins-${OSG_VER}")
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${osg_plugins_subdir}")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/plugins")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${osg_plugins_subdir}" "${CURRENT_PACKAGES_DIR}/plugins/${osg_plugins_subdir}")
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/${osg_plugins_subdir}" "${CURRENT_PACKAGES_DIR}/debug/plugins/${osg_plugins_subdir}")
endif()
endif()

if("tools" IN_LIST FEATURES)
set(osg_plugin_pattern "${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}osgdb*${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
file(GLOB osg_plugins "${CURRENT_PACKAGES_DIR}/plugins/${osg_plugins_subdir}/${osg_plugin_pattern}")
Expand Down
19 changes: 14 additions & 5 deletions ports/osg/unofficial-export.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,34 @@ index f6714c5..d58f6fd 100644
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake
index dcc1fe3..a12fcf1 100644
index dcc1fe37d..76429b85a 100644
--- a/CMakeModules/OsgMacroUtils.cmake
+++ b/CMakeModules/OsgMacroUtils.cmake
@@ -345,6 +345,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
@@ -345,18 +350,20 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
+ EXPORT osg-plugins
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
@@ -354,6 +355,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
- LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
+ LIBRARY DESTINATION plugins/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
- INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
- INSTALL(FILES $<TARGET_PDB_FILE:${TARGET_TARGETNAME}> DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
+ INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION plugins/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
+ INSTALL(FILES $<TARGET_PDB_FILE:${TARGET_TARGETNAME}> DESTINATION plugins/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
+ EXPORT osg-plugins
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
- LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
+ LIBRARY DESTINATION plugins${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
ENDIF(WIN32)
ENDMACRO(SETUP_PLUGIN)

diff --git a/src/OpenThreads/pthreads/CMakeLists.txt b/src/OpenThreads/pthreads/CMakeLists.txt
index e18969c..5a8ad62 100644
--- a/src/OpenThreads/pthreads/CMakeLists.txt
Expand Down
2 changes: 1 addition & 1 deletion ports/osg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "osg",
"version": "3.6.5",
"port-version": 15,
"port-version": 16,
"description": "The OpenSceneGraph is an open source high performance 3D graphics toolkit.",
"homepage": "https://github.com/openscenegraph/OpenSceneGraph",
"supports": "!uwp",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5438,7 +5438,7 @@
},
"osg": {
"baseline": "3.6.5",
"port-version": 15
"port-version": 16
},
"osg-qt": {
"baseline": "Qt5",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/osg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "281da46b90cdaae75ab0dfa81bc00a0630424290",
"version": "3.6.5",
"port-version": 16
},
{
"git-tree": "219045e2b75fc651860c70dbf97557d543269842",
"version": "3.6.5",
Expand Down