summaryrefslogtreecommitdiff
path: root/XMPFilesPlugins/PluginTemplate/build/GeneratePluginTemplate_mac.sh
blob: ad44fc404d30bbf49b940a7b918a2d4a80645449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash 
# =================================================================================================
# ADOBE SYSTEMS INCORPORATED
# Copyright 2020 Adobe Systems Incorporated
# All Rights Reserved
#
# NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
# of the Adobe license agreement accompanying it.
# =================================================================================================
clear
# Get the absolute path of the script
abspath=$(cd ${0%/*} && echo $PWD/${0##*/})
scriptFolder=$(dirname "$abspath" | tr -s "\n" "/")
cmake_buildbitdepth='On'
clean()
{
echo "Cleaning..."
if [ -e xcode ] 
then
rm -rf xcode
fi	

echo "Done"
exit 0;
}
Generate()
{
cd  "$scriptFolder" >/dev/null
if [ ! -e "$cmakedir" ]; then
mkdir -p "$cmakedir"
fi 
cd "$cmakedir"
CMAKE="$scriptFolder/../../../tools/cmake/bin/CMake.app/Contents/bin/cmake"
echo "$CMAKE  ../../ -G Xcode -DCMAKE_CL_64=$cmake_buildbitdepth -DXMP_CMAKEFOLDER_NAME=$cmakedir -DXMP_BUILD_STATIC=Off -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN -DCMAKE_LIBCPP=On "
"$CMAKE"  ../../ -G"Xcode" -DCMAKE_CL_64="$cmake_buildbitdepth" -DXMP_CMAKEFOLDER_NAME="$cmakedir" -DXMP_BUILD_STATIC="Off" -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" -DCMAKE_LIBCPP="On"
if [  $? -ne 0 ]
then
echo "ERROR: CMAKE tool failed"
exit 1
else
echo "Xcode project created successfully"
fi
}

PLuginTemplate32()
{
#create 32bit Xcode Project
cmake_buildbitdepth='Off'
cmakedir="xcode/intel_libcpp"
BITS="32"
TOOLCHAIN="$scriptFolder/../../../build/shared/ToolchainLLVM.cmake"
Generate
}
PLuginTemplate64()
{
#create 64bit Xcode Project
cmake_buildbitdepth='On'
cmakedir="xcode/intel_64_libcpp"
BITS="64"
TOOLCHAIN="$scriptFolder/../../../build/shared/ToolchainLLVM.cmake"
Generate
}

echo "Enter your choice:"
echo "1. Clean"
echo "2. Generate PluginTemplate 64"



read choice

case $choice in
1) clean; break;;
2) PLuginTemplate64;;
*) echo "ERROR: Invalid Choice, Exiting"; exit 1;;
esac

exit 0