tools/CreateMacBundle.cmake.in
author sheepluva
Mon, 05 Aug 2019 00:20:45 +0200
changeset 15300 f382ec6dba11
parent 12893 41d147eb26ea
permissions -rw-r--r--
In hindsight my emscripten-ifdef (70d416a8f63f) is nonsense. As fpcrtl_glShaderSource() would not be defined and lead to compiling issues. So either it's 3 ifdefs (in pas2cRedo, pas2cSystem and misc.c), in order to toggle between fpcrtl_ and the native function, or alternatively have no ifdef for it at all. I'm going with none at all, which means emscripten will compile with the original (const) function prototype, being wrapped by the fpcrtl_ function, same as non-emscripten builds.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11616
b53c3134d55a Fix bundle already present check
koda
parents: 11614
diff changeset
     1
# check for a well known-framework
b53c3134d55a Fix bundle already present check
koda
parents: 11614
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: 11614
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
12893
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12892
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: 12892
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: 12892
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: 12892
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: 12892
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: 12892
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
12893
41d147eb26ea Apply horrible workaround to build relocatable executables
koda
parents: 12892
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()