mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 00:46:41 +02:00
add failsafe for hydra load, look in app frameworks folder
This commit is contained in:
parent
5d67739ab7
commit
172ee3d7dc
2 changed files with 21 additions and 5 deletions
|
@ -139,6 +139,8 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
|||
|
||||
if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE")
|
||||
target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES})
|
||||
elseif (APPLE)
|
||||
add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach()
|
||||
|
|
|
@ -96,15 +96,29 @@ void SixenseManager::initialize() {
|
|||
#ifdef __APPLE__
|
||||
|
||||
if (!_sixenseLibrary) {
|
||||
const QString SIXENSE_LIBRARY_NAME = "libsixense_x64.dylib";
|
||||
_sixenseLibrary = new QLibrary(SIXENSE_LIBRARY_NAME);
|
||||
|
||||
|
||||
#ifdef SIXENSE_LIB_FILENAME
|
||||
_sixenseLibrary = new QLibrary(SIXENSE_LIB_FILENAME);
|
||||
#else
|
||||
const QString SIXENSE_LIBRARY_NAME = "libsixense_x64";
|
||||
QFileInfo frameworkSixenseLibrary = QCoreApplication::applicationDirPath() + "../Frameworks/"
|
||||
+ SIXENSE_LIBRARY_NAME;
|
||||
|
||||
_sixenseLibrary = new QLibrary(frameworkSixenseLibrary.fileName());
|
||||
#endif
|
||||
}
|
||||
|
||||
if (_sixenseLibrary->load()){
|
||||
qDebug() << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName();
|
||||
} else {
|
||||
qDebug() << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load."
|
||||
<< "Continuing without hydra support.";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "Initializing sixense library for hydra support - libsixense_x64.dylib load state is"
|
||||
<< _sixenseLibrary->isLoaded();
|
||||
SixenseBaseFunction sixenseInit = (SixenseBaseFunction) _sixenseLibrary->resolve("sixenseInit");
|
||||
#endif
|
||||
|
||||
sixenseInit();
|
||||
|
||||
_isInitialized = true;
|
||||
|
|
Loading…
Reference in a new issue