aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-04 16:28:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-04 16:29:01 -0700
commit115268c8fd17546fd2b9c4d7ac5530eaa4db3278 (patch)
treefc664e5fd6cf91125e726fbc3dda03ffeb664c99 /CMakeLists.txt
parent072422075e9d4f50b297091efe1ed4c4d56c279d (diff)
downloadsubsurface-115268c8fd17546fd2b9c4d7ac5530eaa4db3278.tar.gz
cmake: correctly create a Mac bundle
Don't try to install the TARGET into the Subsurface.app or we get a neat infinite recursion. As a bundle cmake does all these things automagically. Right now the version is hard coded which is ugly but since it's determined in a separate cmake file it seemed non-obvious how to do this right... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee0eccc1e..871b804dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,6 +162,17 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(NOT DEFINED LRELEASE)
set(LRELEASE lrelease)
endif()
+ 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")
+ SET(MACOSX_BUNDLE_BUNDLE_VERSION "4.4.1")
+ SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "4.4.1")
+ SET(MACOSX_BUNDLE_LONG_VERSION_STRING "4.4.1")
+ SET(MACOSX_BUNDLE_COPYRIGHT "Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, and others")
+ SET_SOURCE_FILES_PROPERTIES(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
+ SET(SUBSURFACE_PKG MACOSX_BUNDLE ${ICON_FILE})
ENDIF()
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
SET(PLATFORM_SRC windows.c)
@@ -315,7 +326,7 @@ TARGET_LINK_LIBRARIES(subsurface_interface ${QT_LIBRARIES} ${MARBLE_LIBRARIES})
# create the executables
-ADD_EXECUTABLE(subsurface ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
+ADD_EXECUTABLE(subsurface ${SUBSURFACE_PKG} ${SUBSURFACE_APP} ${SUBSURFACE_RESOURCES})
target_link_libraries( subsurface
subsurface_generated_ui
subsurface_interface
@@ -449,7 +460,6 @@ endforeach()
# now for each platform the install instructions
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
- # right now make install creates a self contained .app file in Subsurface.app
set(RESOURCEDIR ${CMAKE_BINARY_DIR}/Subsurface.app/Contents/Resources)
install(DIRECTORY marbledata/maps DESTINATION ${RESOURCEDIR}/data)
install(DIRECTORY marbledata/bitmaps DESTINATION ${RESOURCEDIR}/data)
@@ -459,7 +469,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
install(FILES ${TRANSLATIONS} DESTINATION ${RESOURCEDIR}/translations)
install(FILES ${QTTRANSLATIONS} DESTINATION ${RESOURCEDIR}/translations)
install(FILES ${CMAKE_SOURCE_DIR}/gpl-2.0.txt DESTINATION ${RESOURCEDIR})
- install(TARGETS subsurface DESTINATION ${RESOURCEDIR}/../MacOS)
install(CODE "execute_process(COMMAND mac-deploy Subsurface.app)")
ENDIF()