Qt image dialog
[texmacs.git] / src / cmake / CreateBundle.sh.in
blob2874f7403760a8e681ece9994544f63ee7c8646f
1 #!/bin/sh
3 # Are we using Xcode to compile. If we are then the CMake variable
4 # XCODE will be '1' otherwise it will be blank
5 Xcode="@XCODE@x"
6 InstallPrefix="@CMAKE_INSTALL_PREFIX@"
7 ProjectBinaryDir="@binary_dir@"
8 OSX_App_Name="@target@"
10 # Check for a Debug build. Note that the EXE_DEBUG_EXTENSION was set
11 # in the CMakeLists.txt file
12 if [[ $Xcode == "1x" ]]; then
13 if [[ $BUILD_STYLE == "Debug" ]]; then
14 OSX_App_Name="@target@@EXE_DEBUG_EXTENSION@"
16 OSX_App="@EXECUTABLE_OUTPUT_PATH@/$BUILD_STYLE/$OSX_App_Name.app"
17 else
18 OSX_App="@EXECUTABLE_OUTPUT_PATH@/$OSX_App_Name.app"
22 # Remove the previous @target@ app package so we start with a clean bundle
23 echo "Removing Previous $OSX_App_Name.app bundle at $InstallPrefix/"
24 rm -rf "$InstallPrefix/$OSX_App_Name.app"
26 # copy the @target@.app bundle to the installation location
27 echo "Copying $OSX_App_Name.app from the build tree to $InstallPrefix/"
28 cp -Rp "$OSX_App" "$InstallPrefix/"
30 OSX_App="@CMAKE_INSTALL_PREFIX@/$OSX_App_Name.app"
31 ContentsDir="$OSX_App/Contents"
32 SupportDir="$OSX_App/Contents/Support"
33 LibrariesDir="$OSX_App/Contents/Libraries"
34 FrameworksDir="$OSX_App/Contents/Frameworks"
35 PluginsDir="$OSX_App/Contents/Plugins"
38 # create directories in the @target@.app bundle
39 mkdir -p "$SupportDir"
40 if [ ! -e $LibrariesDir ]
41 then
42 mkdir -p "$LibrariesDir"