[marble] [Bug 383883] Broken development bundle installation under Windows and macOS
bugzilla_noreply at kde.org
bugzilla_noreply at kde.org
Wed Aug 23 13:16:09 UTC 2017
https://bugs.kde.org/show_bug.cgi?id=383883
--- Comment #1 from facitol at gmail.com ---
In addition to having libraries in ${CMAKE_INSTALL_PREFIX}, one can also copy
them to ${CMAKE_INSTALL_LIBDIR}. Otherwise .pri file knows nothing about
${CMAKE_INSTALL_PREFIX} location and it is hard to locate the actual libraries
automatically. When information about actual libraries is available through
.pri file, one can automate the deployment through QMake. Otherwise a dependent
application will compile and link OK, but user will need to manually copy all
dynamic libraries to executable (or modify the path).
So, install rules for marblewidget can be:
if(WIN32)
install(TARGETS marblewidget
EXPORT MarbleTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS marblewidget RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})
elseif(APPLE)
install(TARGETS marblewidget
EXPORT MarbleTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib)
install(TARGETS marblewidget LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
install(TARGETS marblewidget
EXPORT MarbleTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
Another option will be to include more information in .pri file:
set(PRI_DATA_DIR "${MARBLE_DATA_INSTALL_PATH}")
if(NOT IS_ABSOLUTE "${PRI_DATA_DIR}")
set(PRI_DATA_DIR "${CMAKE_INSTALL_PREFIX}/${PRI_DATA_DIR}")
endif()
set(PRI_PLUGIN_DIR "${MARBLE_PLUGIN_INSTALL_PATH}")
if(NOT IS_ABSOLUTE "${PRI_PLUGIN_DIR}")
set(PRI_PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${PRI_PLUGIN_DIR}")
endif()
...
QT.Marble.depends = ${PRI_DEPS}
QT.Marble.data = ${PRI_DATA_DIR}
QT.Marble.plugins = ${PRI_PLUGIN_DIR}
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Marble-bugs
mailing list