From 70e10c610e808680b9f758b46d0cff830b9dc9ef Mon Sep 17 00:00:00 2001 From: Karl Goetz Date: Mon, 22 Dec 2014 22:17:32 +1100 Subject: [PATCH] Change Mac specific CMakeLists for CPack This commit includes several fixes and some shuffling of entries to improve readability. The major changes are Removing MG_VERSION_H_CONTENTS which *includes* the file with the version in it in favour of VER_* variables and removing the CPack include at the end of the file. CPack has to be included after all variables are set and this file is sourced before all the common options are configured. One more fixme is added - this and other runtime issues will have to be dealt with when i test the packaging, so far I've only got it to build. --- mk/macosx/CMakeLists.txt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mk/macosx/CMakeLists.txt b/mk/macosx/CMakeLists.txt index 7660b1d8..cecf5f9b 100644 --- a/mk/macosx/CMakeLists.txt +++ b/mk/macosx/CMakeLists.txt @@ -31,22 +31,28 @@ LINK_DIRECTORIES(/opt/local/lib) ##install part -set(CPACK_PACKAGE_FILE_NAME MegaGlest-${MG_VERSION_H_CONTENTS}) - -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") - +# This changes Info.plist from something with variables and CMakeisms to +# something that can be installed on disk. +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist" + "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") include (InstallRequiredSystemLibraries) +# Use bundle generator (OSX has 3 other options if you feel adventurous) +set (CPACK_GENERATOR "Bundle") + +# The following CPACK_* options are all required +set (CPACK_PACKAGE_FILE_NAME MegaGlest-${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}) +set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt") -set (CPACK_GENERATOR Bundle) set (CPACK_BUNDLE_NAME "MegaGlest") set (CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/data/glest_game/megaglest") set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") -set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") -#set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist.template") + +# Install files in to the package (FIXME: how? we sure?) INSTALL(FILES ${LUA_LIBRARIES} DESTINATION ../Frameworks @@ -63,6 +69,4 @@ STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}") # ${PNG_LIBRARY} # DESTINATION ../Frameworks # ) - -include (CPack) - +