/**
\page install_yarp_mac Installing YARP on macOS

\tableofcontents

\section install_mac_installation_prerequisites Prerequisites installation
This installation has been confirmed to work on macOS from 10.9 on with Homebrew.

\subsection install_mac_Xcode Installing Xcode

To compile anything on macOS (including YARP), you'll need to have <a href="http://developer.apple.com/xcode/"><b>Xcode</b></a> installed. This can be done through the <b>App Store</b>.

Once installed, you need to install the <b>Command Line Tools</b>.
To do this, open Xcode, go to Xcode->Preferences->Downloads and install Command Line Tools.

If you do not see the option install Command Line Tools, run the following on a terminal

\code
xcode-select --install
\endcode

Once this is done, you can now continue with the next installation steps.

\subsection install_mac_homebrew Installing Homebrew

Please install Homebrew using the following commands or visit and follow the official <a href="http://brew.sh"><b>installation steps</b></a>

\code
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
\endcode

After the installation, you can run the following command to check if your setup has been successful:

\code
brew doctor
\endcode

\section install_yarp Installing YARP

Once you have installed the prerequisites, you can now proceed to install YARP from source.
First install the dependencies, download the code from the repository and then proceed with the installation.

 \subsection install_mac_YARP_Dependencies Installing YARP Dependencies
 Here we provide information for installing the <b>YARP dependencies</b> via Homebrew.
 In order to install the YARP dependencies enter the following command in a terminal:

 \code
 brew install ace boost cmake eigen jpeg libedit opencv pkg-config portaudio sqlite tinyxml
 \endcode


 For compiling the required bindings (LUA, JAVA, PYTHON etc) you need <b>swig</b>

 \code
 brew install swig
 \endcode

 For compiling the Qt5 GUIS:
 \code
 brew install qt@5
 \endcode

 Now, add the <b>environmental variable</b> for Qt5

 \code
 cd ~
 open -a TextEdit .bash_profile
 \endcode

 and copy the following line

 \code
 export Qt5_DIR=/usr/local/opt/qt5/lib/cmake
 \endcode


 \subsubsection install_mac_YARP_optional_GDK [Optional]: Installing GDK PIXBUF Dependencies

 Programs that require this <b>GDK PIXBUF</b> need to set the environment variable correctly. Just to be on the safe side add this to the .bash_profile

 \code
 cd ~
 open -a TextEdit .bash_profile
 \endcode

 \code
 export GDK_PIXBUF_MODULEDIR="/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders"
 \endcode

 To refresh and load these environment settings type:

 \code
 source ~/.bash_profile
 \endcode


 \subsection install_mac_YARP Download and install

 In the directory where you would like to store your code, e.g. /Users/your_user_name/Dev/ run the following git command to clone YARP on your system

 \code
 git clone https://github.com/robotology/yarp.git
 \endcode

 Now move into the source folder and create the build directory

 \code
 cd yarp
 mkdir build
 cd build
 \endcode

 You can now compile and install YARP with (at least) two different methods: GNU Makefile and Xcode.
 The former is simpler, while the latter creates an Xcode project which can come in handy if you wish to contribute to the YARP development.

 If not stated differently (e.g. we are compiling YARP on a robot environment which can have different policies), we strongly suggest to install YARP after the compilation.
 Note that, by default, YARP is installed in /usr/local. We strongly suggest to change this folder to a non-system one.

 \subsubsection install_mac_YARP_terminal Compile YARP using GNU Makefiles

 In this case, you simply have to issue the cmake command
 \code
 ccmake ..
 \endcode

 configure it correctly by enabling the following flags (simple solution):

 \code
 YARP_COMPILE_GUIS
 YARP_COMPILE_libYARP_math
 \endcode

 and, if you want to install YARP, by changing the path pointed by the CMake variable

 \code
 CMAKE_INSTALL_PREFIX
 \endcode

 configure (press 'c' until all the * disappears) & generate ('g'), then:

 \code
 make
 \endcode

 If you want to install issue also a
 \code
 make install
 \endcode
 (Note: if the install directory is a system directory you may need administrator privileges, e.g. you have to use sudo).

After the installation, you will need to set your \subpage environment_configuration.

 \subsection install_mac_YARP_Xcode Compile YARP using Xcode

 In order to generate and Xcode project do the following:

 \code
 ccmake .. -G Xcode
 \endcode

 As before, configure the project and the install directory:
 \code
 YARP_COMPILE_GUIS=ON
 YARP_COMPILE_libYARP_math=ON
 CMAKE_INSTALL_PREFIX=/path/to/install/dir
 \endcode

 This will generate a <b>YARP.xcodeproj</b> file which can be opened with Xcode.
 Build it by clicking <b>Product -> Build</b> or <b>cmd+B</b> shortcut.
 One can also compile the Release binaries by clicking <b>Product -> Archive</b>.

 Alternatively, it is possible to directly compile the project on the command line by
 \code
 xcodebuild [-configuration Debug|Release|Other Configs] [-target ALL_BUILD|install|Other Targets]
 \endcode
 If no options are specified the ALL_BUILD target is compiled in Debug configuration.
 In general the following command will build and install YARP in release mode:
 \code
 xcodebuild -configuration Release -target install
 \endcode


 After the installation, you will need to set your \subpage environment_configuration.



\subsection environment_configuration Environment variables configuration

In order to follow the KISS principle we are using the native mac editor Textedit. Please feel free to use whichever tool/editor you prefer.

Add the YARP environment variable in

 \code
 cd ~
 open -a TextEdit .bash_profile
 \endcode

 If the following command result in an error: The file .... does not exist, do the following first:

 \code
 cd ~
 touch .bash_profile
 \endcode


<b>If you installed from Homebrew</b>:

 \code
 export YARP_DATA_DIRS=/usr/local/share/yarp
 \endcode

 To refresh and load these environment settings type:

 \code
 source ~/.bash_profile
 \endcode

 Now you can check if YARP has been properly installed by running a \subpage quick_test_yarp.

 <b>If you installed from source</b>:

 In the following we assume that YARP has been installed.
 In case you are using the build version, instead, the YARP_DIR path should point to the build directory.
 \code
 # YARP_ROOT points to the repository
 export YARP_ROOT=/Users/your_user_name/Dev/yarp
 export YARP_DIR=/path/to/install/dir
 export PATH=$PATH:$YARP_DIR/bin
 \endcode

 Notice that if you did not install AND you used the Xcode version the last line becomes

 \code
  export PATH=$PATH:$YARP_DIR/bin/Release
 \endcode

 Now setup YARP_DATA_DIRS by adding this to the .bash_profile:

 \code
 export YARP_DATA_DIRS=${YARP_DIR}/share/yarp
 \endcode

 To refresh and load these environment settings type:

 \code
 source ~/.bash_profile
 \endcode


 Check if YARP has been properly installed by running a \subpage quick_test_yarp.


 \section quick_test_yarp Quick YARP run test

 Now to quickly test the system run this in a terminal:

 \code
 yarp
 \endcode

 and you should get something like:

 \code
 This is the YARP network companion.
 Call with the argument "help" to see a list of ways to use this program.
 \endcode

 If this test run properly, you can proceed with the following link: \subpage check_your_installation.

*/
