File: xcode.sh

package info (click to toggle)
freerdp3 3.20.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 68,492 kB
  • sloc: ansic: 410,926; cpp: 16,869; xml: 1,721; python: 1,155; sh: 783; lisp: 408; perl: 231; cs: 191; makefile: 111
file content (74 lines) | stat: -rwxr-xr-x 1,820 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# may now be legacy; 2 stage cmake no longer needed

# Xcode generated files directory
XCODE_PROJ_DIR=xcode
# MacFreeRDP client directory
CLIENT_MAC_DIR=./client/Mac/
pushd .

GEN='Xcode'

# Build settings
ARCH=-DCMAKE_OSX_ARCHITECTURES="${CMAKE_OSX_ARCHITECTURES:-i386;x86_64}"
BUILDTYPE=-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:Debug}"
MANPAGES=-DWITH_MANPAGES="${WITHMANPAGES:NO}"

# Run cmake for FreeRDP and MacFreeRDP
mkdir ${XCODE_PROJ_DIR} >/dev/null 2>&1
pushd ${XCODE_PROJ_DIR}
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
popd
mkdir ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR} >/dev/null 2>&1
pushd ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
popd

# Check for errors; otherwise, ask for compile.
if [ "$?" -ne 0 ]; then
  echo "CMake failed. Please check error messages"
  popd >/dev/null
  exit
else
  popd
  while true; do
    echo -n "Compile FreeRDP? (y or n) - (y recommended for MacFreeRDP compilation):"
    read CONFIRM
    case $CONFIRM in
    y | Y | YES | yes | Yes)
      pushd ./${XCODE_PROJ_DIR}
      xcodebuild
      popd
      break
      ;;
    n | N | no | NO | No)
      echo OK - you entered $CONFIRM
      break
      ;;
    *) echo Please enter only y or n ;;
    esac
  done

  echo "SUCCESS!"
  while true; do
    echo -n "Open Xcode projects now? (y or n):"
    read CONFIRM
    case $CONFIRM in
    y | Y | YES | yes | Yes)
      open ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}/MacFreeRDP.xcodeproj
      open ./${XCODE_PROJ_DIR}/FreeRDP.xcodeproj
      break
      ;;
    n | N | no | NO | No)
      echo OK - $CONFIRM
      break
      ;;
    *) echo Please enter only y or n ;;
    esac
  done

  echo -n "NOTE: Dragging FreeRDP project from finder onto the MacFreeRDP project in Xcode
      will enable code stepping from MacFreeRDP into FreeRDP.
"
fi