From e0eb3feb89e6789bd16908d031ca275700e0be27 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Fri, 12 Jan 2024 23:49:53 +0000 Subject: [PATCH] Use OSG_PLUGIN_PREFIX instead of CMAKE_SHARED_MODULE_PREFIX Logic to generate it copied from OSG's CMake instead of guessed. --- components/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 536d1098c5..a7f6d666d0 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -41,7 +41,14 @@ endif (GIT_CHECKOUT) list (APPEND COMPONENT_FILES "${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}") # OSG plugin checker -list(TRANSFORM USED_OSG_PLUGINS PREPEND "${CMAKE_SHARED_MODULE_PREFIX}" OUTPUT_VARIABLE USED_OSG_PLUGIN_FILENAMES) +# Helpfully, OSG doesn't export this to its CMake config as it doesn't have one +set(OSG_PLUGIN_PREFIX "") +if (CYGWIN) + SET(OSG_PLUGIN_PREFIX "cygwin_") +elseif(MINGW) + SET(OSG_PLUGIN_PREFIX "mingw_") +endif() +list(TRANSFORM USED_OSG_PLUGINS PREPEND "${OSG_PLUGIN_PREFIX}" OUTPUT_VARIABLE USED_OSG_PLUGIN_FILENAMES) list(TRANSFORM USED_OSG_PLUGIN_FILENAMES APPEND "${CMAKE_SHARED_MODULE_SUFFIX}") list(TRANSFORM USED_OSG_PLUGIN_FILENAMES PREPEND "\"" OUTPUT_VARIABLE USED_OSG_PLUGIN_FILENAMES_FORMATTED) list(TRANSFORM USED_OSG_PLUGIN_FILENAMES_FORMATTED APPEND "\"")