summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-16 14:34:33 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-16 15:33:30 -0800
commitd4184f852d9d4fedec84273f8fccf7745053e9b1 (patch)
tree853fccfa0c6bfd85b00e42b83ba6f0fd996c2edb /CMakeLists.txt
parent5672d3f567dc3e8cf24681f63a7119db37797da2 (diff)
downloadsubsurface-d4184f852d9d4fedec84273f8fccf7745053e9b1.tar.gz
Cmake: bring back the QtXml hack and other Mac changes
The hack in commit c8be04edad5e ("Mac build: move the QtXml hack into Cmake") had been lost in the latest cmake rewrite. Similarly, the modified BUNDLE info and the manual QML deployment. Strangely this still doesn't correctly create a Subsurface-mobile.app on Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt43
1 files changed, 36 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b02ffec64..f338f0ec6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,10 +152,17 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${HID_LIB})
set(EXTRA_LIBS ${APP_SERVICES_LIBRARY})
set(ICON_FILE ${CMAKE_SOURCE_DIR}/packaging/macosx/Subsurface.icns)
- set(MACOSX_BUNDLE_INFO_STRING "Subsurface")
- set(MACOSX_BUNDLE_ICON_FILE Subsurface.icns)
- set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.subsurface-divelog")
- set(MACOSX_BUNDLE_BUNDLE_NAME "Subsurface")
+ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
+ set(MACOSX_BUNDLE_INFO_STRING "Subsurface-mobile")
+ set(MACOSX_BUNDLE_ICON_FILE Subsurface.icns)
+ set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.subsurface-divelog")
+ set(MACOSX_BUNDLE_BUNDLE_NAME "Subsurface-mobile")
+ else()
+ set(MACOSX_BUNDLE_INFO_STRING "Subsurface")
+ set(MACOSX_BUNDLE_ICON_FILE Subsurface.icns)
+ set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.subsurface-divelog")
+ set(MACOSX_BUNDLE_BUNDLE_NAME "Subsurface")
+ endif()
set(MACOSX_BUNDLE_BUNDLE_VERSION "${SSRF_VERSION_STRING}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${SSRF_VERSION_STRING}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${SSRF_VERSION_STRING}")
@@ -319,8 +326,14 @@ if(ANDROID)
PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/android-mobile
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
- set(RESOURCEDIR ${CMAKE_BINARY_DIR}/Subsurface.app/Contents/Resources)
- set(PLUGINDIR ${CMAKE_BINARY_DIR}/Subsurface.app/Contents/PlugIns)
+ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
+ set(APP_BUNDLE_DIR Subsurface-mobile.app)
+ set(MACDEPLOY_ARGS "-qmldir=${APP_BUNDLE_DIR}/Contents/Frameworks/qml")
+ else()
+ set(APP_BUNDLE_DIR Subsurface.app)
+ endif()
+ set(RESOURCEDIR ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources)
+ set(PLUGINDIR ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/PlugIns)
install(DIRECTORY marbledata/maps DESTINATION ${RESOURCEDIR}/data)
install(DIRECTORY marbledata/bitmaps DESTINATION ${RESOURCEDIR}/data)
install(DIRECTORY Documentation/images DESTINATION ${RESOURCEDIR}/share/Documentation)
@@ -334,7 +347,23 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
install(DIRECTORY ${Grantlee5_DIR}/../../grantlee DESTINATION ${PLUGINDIR})
# this is a hack - but I don't know how else to find the macdeployqt program if it's not in the PATH
string(REPLACE moc macdeployqt MACDEPLOYQT ${QT_MOC_EXECUTABLE})
- install(CODE "execute_process(COMMAND ${MACDEPLOYQT} Subsurface.app)")
+ install(CODE "execute_process(COMMAND ${MACDEPLOYQT} ${APP_BUNDLE_DIR} ${MACDEPLOY_ARGS})")
+ # and another hack to get the QML Components in the right place
+ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable")
+ install(CODE "execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/qml)")
+ install(CODE "execute_process(COMMAND cp -a ${_qt5Core_install_prefix}/qml/QtQuick ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/qml)")
+ endif()
+ if(NOT NO_MARBLE)
+ # more hackery - this time for QtXml which is needed by libssrfmarblewidget
+ install(CODE "execute_process(COMMAND cp -a ${_qt5Core_install_prefix}/lib/QtXml.framework ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks)")
+ install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/Versions/5/Headers)")
+ install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/Headers)")
+ install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/QtXml.prl)")
+ install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/Versions/5/*_debug)")
+ install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework//*_debug)")
+ install(CODE "execute_process(COMMAND install_name_tool -id @executable_path/../Frameworks/QtXml ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/QtXml)")
+ install(CODE "execute_process(COMMAND install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/QtCore ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Frameworks/QtXml.framework/QtXml)")
+ endif()
install(CODE "message(STATUS \"two ERRORS here about libmysqlclient and libpq not found are harmless\")")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Windows bundling rules