mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
cmake/FindOSGPlugins: Support lib-prefixed plugins
With a regular OSG build, the plugin names are prefixed with `lib`, e.g. `libosgdb_jpeg.a` for a static build. However, on Debian on Ubuntu they are not. With this commit we now try both options. Fixes #5972 Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
This commit is contained in:
parent
7455dfb3a1
commit
11dfb9daff
1 changed files with 5 additions and 2 deletions
|
@ -27,9 +27,12 @@ foreach(_library ${OSGPlugins_FIND_COMPONENTS})
|
||||||
string(TOUPPER ${_library} _library_uc)
|
string(TOUPPER ${_library} _library_uc)
|
||||||
set(_component OSGPlugins_${_library})
|
set(_component OSGPlugins_${_library})
|
||||||
|
|
||||||
set(${_library_uc}_DIR ${OSGPlugins_LIB_DIR}) # to help function osg_find_library
|
# On some systems, notably Debian and Ubuntu, the OSG plugins do not have
|
||||||
|
# the usual "lib" prefix. We temporarily add the empty string to the list
|
||||||
|
# of prefixes CMake searches for (via osg_find_library) to support these systems.
|
||||||
set(_saved_lib_prefix ${CMAKE_FIND_LIBRARY_PREFIXES}) # save CMAKE_FIND_LIBRARY_PREFIXES
|
set(_saved_lib_prefix ${CMAKE_FIND_LIBRARY_PREFIXES}) # save CMAKE_FIND_LIBRARY_PREFIXES
|
||||||
set(CMAKE_FIND_LIBRARY_PREFIXES "") # search libraries with no prefix
|
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "") # search libraries with no prefix
|
||||||
|
set(${_library_uc}_DIR ${OSGPlugins_LIB_DIR}) # to help function osg_find_library
|
||||||
osg_find_library(${_library_uc} ${_library}) # find it into ${_library_uc}_LIBRARIES
|
osg_find_library(${_library_uc} ${_library}) # find it into ${_library_uc}_LIBRARIES
|
||||||
set(CMAKE_FIND_LIBRARY_PREFIXES ${_saved_lib_prefix}) # restore prefix
|
set(CMAKE_FIND_LIBRARY_PREFIXES ${_saved_lib_prefix}) # restore prefix
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue