File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Locate SDL_mixer library
1+ # Locate SDL_gfx library
22# This module defines
33# SDLGFX_LIBRARY, the name of the library to link against
44# SDLGFX_FOUND, if false, do not try to link to SDL
Original file line number Diff line number Diff line change 1- # Locate SDL_mixer library
1+ # Locate yaml-cpp library
22# This module defines
33# YAMLCPP_LIBRARY, the name of the library to link against
44# YAMLCPP_FOUND, if false, do not try to link to SDL
Original file line number Diff line number Diff line change 1+ # Adapted from the Dolphin project: https://dolphin-emu.org/
2+
3+ # This module can be used in two different ways.
4+ #
5+ # When invoked as `cmake -P PostprocessBundle.cmake`, it fixes up an
6+ # application folder to be standalone. It bundles all required libraries from
7+ # the system and fixes up library IDs. Any additional shared libraries, like
8+ # plugins, that are found under Contents/MacOS/ will be made standalone as well.
9+ #
10+ # When called with `include(PostprocessBundle)`, it defines a helper
11+ # function `postprocess_bundle` that sets up the command form of the
12+ # module as a post-build step.
13+
14+ if (CMAKE_GENERATOR )
15+ # Being called as include(PostprocessBundle), so define a helper function.
16+ function (postprocess_bundle target path )
17+ add_custom_command (TARGET ${target}
18+ POST_BUILD
19+ COMMAND ${CMAKE_COMMAND } -DBUNDLE_PATH= "${path} " -P "${CMAKE_CURRENT_LIST_FILE } "
20+ )
21+ endfunction ()
22+ return ()
23+ endif ()
24+
25+ # Make sure to fix up any additional shared libraries (like plugins) that are
26+ # needed.
27+ file (GLOB_RECURSE BUNDLE_LIBS "${BUNDLE_PATH} /Contents/MacOS/*.dylib" )
28+
29+ include (BundleUtilities )
30+ set (BU_CHMOD_BUNDLE_ITEMS ON )
31+ fixup_bundle ("${BUNDLE_PATH} " "${BUNDLE_LIBS} " "" )
Original file line number Diff line number Diff line change @@ -483,8 +483,13 @@ if ( WIN32 )
483483endif ()
484484
485485if ( APPLE AND CREATE_BUNDLE )
486- include ( BundleUtilities )
487- fixup_bundle ( ${EXECUTABLE_OUTPUT_PATH } /openxcom.app "" "" )
486+ include ( PostprocessBundle )
487+ if ( "${CMAKE_GENERATOR } " STREQUAL "Xcode" )
488+ postprocess_bundle ( openxcom ${EXECUTABLE_OUTPUT_PATH } /Debug/openxcom.app )
489+ postprocess_bundle ( openxcom ${EXECUTABLE_OUTPUT_PATH } /Release/openxcom.app )
490+ else ()
491+ postprocess_bundle ( openxcom ${EXECUTABLE_OUTPUT_PATH } /openxcom.app )
492+ endif ()
488493endif ()
489494
490495#Setup source groups for IDE
You can’t perform that action at this time.
0 commit comments