From 50bcb65ee0c01ead148010f42b66c74eb1a56ccd Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 8 Oct 2016 19:20:10 +0200 Subject: [PATCH] Move USED_OSG_PLUGINS to the top of the CMakeLists to be used by all platforms --- CMakeLists.txt | 21 +++++++++++---------- apps/openmw/CMakeLists.txt | 15 ++++++++------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 559e4a850..8f60b80e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,13 +223,23 @@ endif() find_package(OpenSceneGraph 3.3.4 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX) include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) +set(USED_OSG_PLUGINS + osgdb_bmp + osgdb_dds + osgdb_jpeg + osgdb_osg + osgdb_png + osgdb_serializers_osg + osgdb_tga + ) + get_filename_component(OSG_LIB_DIR ${OSGDB_LIBRARY} DIRECTORY) set(OSGPlugins_LIB_DIR "${OSG_LIB_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}") if(OSG_STATIC) add_definitions(-DOSG_LIBRARY_STATIC) - find_package(OSGPlugins REQUIRED COMPONENTS osgdb_png osgdb_tga osgdb_dds osgdb_jpeg) + find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS}) list(APPEND OPENSCENEGRAPH_LIBRARIES ${OSGPlugins_LIBRARIES}) endif() @@ -740,15 +750,6 @@ if (APPLE) " COMPONENT Runtime) set(ABSOLUTE_PLUGINS "") - set(USED_OSG_PLUGINS - osgdb_bmp - osgdb_dds - osgdb_jpeg - osgdb_osg - osgdb_png - osgdb_serializers_osg - osgdb_tga - ) foreach (PLUGIN_NAME ${USED_OSG_PLUGINS}) set(PLUGIN_ABS "${OSGPlugins_LIB_DIR}/${PLUGIN_NAME}.so") diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 5423322e8..aba2a6af4 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -142,14 +142,15 @@ target_link_libraries(openmw if (ANDROID) set (OSG_PLUGINS -Wl,--whole-archive - ${OSG_PLUGINS_DIR}/libosgdb_dds.a - ${OSG_PLUGINS_DIR}/libosgdb_bmp.a - ${OSG_PLUGINS_DIR}/libosgdb_tga.a - ${OSG_PLUGINS_DIR}/libosgdb_gif.a - ${OSG_PLUGINS_DIR}/libosgdb_jpeg.a - ${OSG_PLUGINS_DIR}/libosgdb_png.a - -Wl,--no-whole-archive ) + foreach(PLUGIN_NAME ${USED_OSG_PLUGINS}) + set(OSG_PLUGINS ${OSG_PLUGINS} ${OSG_PLUGINS_DIR}/lib${PLUGIN_NAME}.a) + endforeach() + + set (OSG_PLUGINS + ${OSG_PLUGINS} -Wl,--no-whole-archive + ) + target_link_libraries(openmw EGL android