tools/CreateMacBundle.cmake.in
author Wuzzy <Wuzzy2@mail.ru>
Thu, 15 Mar 2018 21:15:16 +0100
changeset 13221 02bf6902eeb0
parent 12888 41d147eb26ea
permissions -rw-r--r--
Remove Qt SVG and Qt OpenGL as hard dependencies Qt SVG is not used in the frontend (no SVGs are rendered). Neither is Qt OpenGL used. Qt OpenGL is discouraged anyway.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11611
b53c3134d55a Fix bundle already present check
koda
parents: 11609
diff changeset
     1
# check for a well known-framework
b53c3134d55a Fix bundle already present check
koda
parents: 11609
diff changeset
     2
execute_process(COMMAND stat ${frameworks_dir}/QtCore.framework RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
b53c3134d55a Fix bundle already present check
koda
parents: 11609
diff changeset
     3
# prepare Frameworks directory
8317
ec9f94ab2737 remove the CROSSAPPLE option until a better solution is found
koda
parents: 8316
diff changeset
     4
execute_process(COMMAND mkdir -p ${frameworks_dir})
7816
a25e943dd4b0 finally videorec on osx
koda
parents: 7112
diff changeset
     5
# macdeployqt will convert safely any absolute path library for 'hedgewars'
8316
89232b2fa1d6 cmake rework, cleanup a lot of redundant sections, separate library and binary install location, unify osx and win handling of the data directory (tested on win, lin and mac)
koda
parents: 7817
diff changeset
     6
execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
7817
6cc558a69b58 countless small optimisation for cmake, output messages are now coherent (mostly) and the options get fully respected (eg. skipping library search if not activated)
koda
parents: 7816
diff changeset
     7
12888
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
     8
# but macdeployqt will not work for a second executable, so employ this series of ridiculous commands to work around it
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
     9
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp)
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
    10
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
    11
execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/Hedgewars.app OUTPUT_QUIET ERROR_QUIET)
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
    12
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hwengine)
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
    13
execute_process(COMMAND mv ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/tmp ${CMAKE_BINARY_DIR}/Hedgewars.app/Contents/MacOS/hedgewars)
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4335
diff changeset
    14
12888
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12887
diff changeset
    15
if(doBundle EQUAL 1)
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4335
diff changeset
    16
    if(${SPARKLE_FOUND})
9851
b1e4f0dddfb5 skip writing the full destination name
koda
parents: 9849
diff changeset
    17
        execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY} ${frameworks_dir})
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4335
diff changeset
    18
    endif()
9345
bb9bf1efd0d2 use the modern install(SCRIPT ...) command instead of legacy POST_BUILD_SCRIPT
koda
parents: 9050
diff changeset
    19
    message(STATUS "Frameworks and libraries successfully copied...")
5053
a767954cfa03 this should help people hacking the cmake files
koda
parents: 4335
diff changeset
    20
else()
9345
bb9bf1efd0d2 use the modern install(SCRIPT ...) command instead of legacy POST_BUILD_SCRIPT
koda
parents: 9050
diff changeset
    21
    message(STATUS "Frameworks already present, skipping...")
2401
2a694ea2a437 fixes & co.
koda
parents: 2261
diff changeset
    22
endif()