mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 20:09:41 +00:00
CMake: Fix support for OSG static lib paths
`$<TARGET_FILE:...>` fails if the argument is already a path (instead of a library name). This happens when a static library is found via `osg_find_library`. If the argument contains `/` or `.`, do not use `$<TARGET_FILE:...>`
This commit is contained in:
parent
92300733c5
commit
13c5b1b0c5
2 changed files with 10 additions and 2 deletions
|
@ -233,7 +233,11 @@ if(OSG_STATIC)
|
|||
add_library(openmw_cs_osg_plugins INTERFACE)
|
||||
foreach(_plugin ${USED_OSG_PLUGINS})
|
||||
string(TOUPPER ${_plugin} _plugin_uc)
|
||||
list(APPEND _osg_plugins_static_files $<TARGET_FILE:${${_plugin_uc}_LIBRARY}>)
|
||||
if (${_plugin_uc}_LIBRARY MATCHES "[/.]")
|
||||
list(APPEND _osg_plugins_static_files ${${_plugin_uc}_LIBRARY})
|
||||
else()
|
||||
list(APPEND _osg_plugins_static_files $<TARGET_FILE:${${_plugin_uc}_LIBRARY}>)
|
||||
endif()
|
||||
target_link_libraries(openmw_cs_osg_plugins INTERFACE ${${_plugin_uc}_LIBRARY})
|
||||
endforeach()
|
||||
# We use --whole-archive because OSG plugins use registration.
|
||||
|
|
|
@ -148,7 +148,11 @@ if(OSG_STATIC)
|
|||
add_library(openmw_osg_plugins INTERFACE)
|
||||
foreach(_plugin ${USED_OSG_PLUGINS})
|
||||
string(TOUPPER ${_plugin} _plugin_uc)
|
||||
list(APPEND _osg_plugins_static_files $<TARGET_FILE:${${_plugin_uc}_LIBRARY}>)
|
||||
if (${_plugin_uc}_LIBRARY MATCHES "[/.]")
|
||||
list(APPEND _osg_plugins_static_files ${${_plugin_uc}_LIBRARY})
|
||||
else()
|
||||
list(APPEND _osg_plugins_static_files $<TARGET_FILE:${${_plugin_uc}_LIBRARY}>)
|
||||
endif()
|
||||
target_link_libraries(openmw_osg_plugins INTERFACE ${${_plugin_uc}_LIBRARY})
|
||||
endforeach()
|
||||
# We use --whole-archive because OSG plugins use registration.
|
||||
|
|
Loading…
Reference in a new issue