\hypertarget{buildingOpenFlipper_dependencies}{}\section{Dependencies}\label{buildingOpenFlipper_dependencies}
Open\+Flipper is developed on top of the Qt framework. This framework provides easy cross platform development. Therefore an installed version of QT with at least version 5.\+9 is required. We use the cmake Make\+File generator to build Open\+Flipper.\hypertarget{buildingOpenFlipper_reqlibs}{}\section{Required libraries}\label{buildingOpenFlipper_reqlibs}

\begin{DoxyItemize}
\item 5.\+9 $<$= Qt $<$= 5.\+13 ( \href{http://www.qt.io/download/}{\tt http\+://www.\+qt.\+io/download/} ) Use the Open\+GL version. If you install Qt, please make sure that Qt\+Script is also installed. 
\end{DoxyItemize}\hypertarget{buildingOpenFlipper_optlibs}{}\section{Optional libraries ( Without these libraries some functionality might not be available)}\label{buildingOpenFlipper_optlibs}

\begin{DoxyItemize}
\item Q\+WT ($>$=6.\+0) ( optional, used for histogram plottings, \href{http://qwt.sourceforge.net/}{\tt http\+://qwt.\+sourceforge.\+net/}) 
\end{DoxyItemize}

On Debian, you can install the prerequisites this way (tested on Debian buster)\+:

{\ttfamily  apt install cmake make g++ libeigen3-\/dev python3-\/dev qt5-\/default libqt5script5 libqt5scripttools5 libqt5svg5-\/dev libqt5quick5 libqt5x11extras5-\/dev libqt5help5 qtscript5-\/dev libqt5xmlpatterns5-\/dev libqwt-\/qt5-\/dev qttools5-\/dev qtdeclarative5-\/dev libqt5opengl5-\/dev libglew-\/dev }\hypertarget{buildingOpenFlipper_bs}{}\section{Build System}\label{buildingOpenFlipper_bs}
The build system uses cmake to generate all makefiles.\hypertarget{buildingOpenFlipper_build_cmake}{}\section{Building Open\+Flipper using Cmake}\label{buildingOpenFlipper_build_cmake}
For the following section C\+Make $>$= 3.\+12 has to be installed. In the toplevel directory of Open\+Flipper is a C\+Make\+Lists.\+txt file that specifies the build configuration and targets. See the following subsections for information on how to build Open\+Flipper for your specific operating system.\hypertarget{buildingOpenFlipper_cmake_blinux}{}\subsection{Building Open\+Flipper under Linux}\label{buildingOpenFlipper_cmake_blinux}

\begin{DoxyItemize}
\item First install the required libraries via your linux distributions package management e.\+g. apt or rpm (for the list of packages see above)~\newline
 
\item Extract the source code or get it via git\+:~\newline
 {\ttfamily {\bfseries  git clone --recursive \href{https://graphics.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper-Free.git}{\tt https\+://graphics.\+rwth-\/aachen.\+de\+:9000/\+Open\+Flipper-\/\+Free/\+Open\+Flipper-\/\+Free.\+git} Open\+Flipper-\/\+Free}} 
\item Create a build directory (e.\+g. {\bfseries build}) next to the Open\+Flipper source directory {\ttfamily {\bfseries mkdir build}} 
\item Change to the newly created directory {\ttfamily {\bfseries cd build}} and type {\ttfamily {\bfseries cmake ../\+Open\+Flipper-\/\+Free}} 
\item Now call {\bfseries make} to build Open\+Flipper  
\end{DoxyItemize}

To switch between debug and release build, use ~\newline
 {\bfseries cmake -\/\+D\+C\+M\+A\+K\+E\+\_\+\+B\+U\+I\+L\+D\+\_\+\+T\+Y\+PE=Release ../\+Open\+Flipper-\/\+Free}~\newline
 ~\newline
 To change the install path use~\newline
 {\bfseries -\/\+D\+C\+M\+A\+K\+E\+\_\+\+I\+N\+S\+T\+A\+L\+L\+\_\+\+P\+R\+E\+F\+IX=\mbox{[}path\mbox{]}}~\newline


The created application (binaries, libs and shared files) are located in the {\bfseries Build} directory.\hypertarget{buildingOpenFlipper_cmake_bwin}{}\subsection{Building Open\+Flipper under Windows}\label{buildingOpenFlipper_cmake_bwin}

\begin{DoxyItemize}
\item Get Visual Studio 2015 or higher (We recommend 2017)  
\item Get cmake for windows from \href{http://www.cmake.org/cmake/resources/software.html}{\tt http\+://www.\+cmake.\+org/cmake/resources/software.\+html}  
\item Get and Install Qt ( $>$= 5.\+9) , Visual Studio Version matching your installation )  
\item Download and install git (\href{https://git-scm.com/downloads}{\tt https\+://git-\/scm.\+com/downloads}) 
\item Start git gui 
\item Choose \char`\"{}\+Clone Existing Repository\char`\"{}  
\item Enter the source location\+: \char`\"{}https\+://www.\+graphics.\+rwth-\/aachen.\+de\+:9000/\+Open\+Flipper-\/\+Free/\+Open\+Flipper-\/\+Free\char`\"{} and a target directory (We assume \char`\"{}\+C\+:\textbackslash{}\+Development\textbackslash{}\+Open\+Flipper\char`\"{} as the target directory).  
\item Git Gui will now download the source code  
\item After download you can close the following window  
\item Now start cmake-\/gui and enter the location of the source code (\char`\"{}\+C\+:\textbackslash{}\+Development\textbackslash{}\+Open\+Flipper\char`\"{} in our case).  
\item Enter the target build directory (\char`\"{}\+C\+:\textbackslash{}\+Development\textbackslash{}\+Build\char`\"{} in our case).  
\item Click configure.  
\item C\+Make now asks what generator we want to use.  
\item We will use Visual Studio 2017 64-\/bit mode.  
\item After selection, the window should look like this.  
\item Afterwards, cmake will ask if we want to create the build directory, if it did not exist before. Choose yes here.  
\item Now cmake will configure the project. Depending on install locations, it might not find your Qt installation automatically. Then you will get the error shown in the image.  
\item To fix this, search for Q\+T5 in the search box. If nothing shows up, you have to enable the checkbox called \char`\"{}\+Advanced\char`\"{}. You should find a variable called Q\+T5\+\_\+\+I\+N\+S\+T\+A\+L\+L\+\_\+\+P\+A\+TH. Click on the three dots on the right of the input box.  
\item Navigate to your Qt installation directory. Choose the qt version folder matching your generator (In our case, Visual Studio 2017 64-\/bit and therefore msvc2017\+\_\+64) and click \char`\"{}\+Select folder\char`\"{}.  
\item The path should now be set correctly.  
\item Run configure again.  
\item After configuring, you should see \char`\"{}\+Configuring done\char`\"{} in the output. Now click on \char`\"{}\+Generate\char`\"{}.  
\item If everything went fine, you should also have a \char`\"{}\+Generating done\char`\"{} in the log.  
\item Now you can open the generated Visual Studio project. Either by pressing the \char`\"{}\+Open Project\char`\"{} Button"  
\item Or by navigating with the explorer to the build folder and opening the \char`\"{}\+Open\+Flipper.\+sln\char`\"{} file.  
\item Make sure that Open\+Flipper is the startup project.  
\item At the top, you can choose the build type for your project.  
\item Now you can build the solution. This will compile Open\+Flipper and all plugins.   
\item If everything has been compiled, you can start Open\+Flipper by clicking on the run button at the top.   
\end{DoxyItemize}

\begin{DoxyNote}{Note}
If you want to build Open\+Flipper as release on windows, you don\textquotesingle{}t have to set the C\+M\+A\+K\+E\+\_\+\+B\+U\+I\+L\+D\+\_\+\+T\+Y\+PE variable to \char`\"{}\+Release\char`\"{} before configuring generating the Visual Studio solution file. Instead, choose the build type \char`\"{}\+Release\char`\"{} in Visual Studio and build the solution. Console outputs are only available in Visual Studio, when the \char`\"{}\+Debug\char`\"{} configuration is selected, or the -\/c option is passed as command line option.
\end{DoxyNote}
\hypertarget{buildingOpenFlipper_cmake_bmacos}{}\subsection{Building Open\+Flipper under Mac\+O\+S X}\label{buildingOpenFlipper_cmake_bmacos}

\begin{DoxyItemize}
\item First install the required libraries~\newline
 To get all required libraries you should use the macports project\+: \href{http://www.macports.org/}{\tt http\+://www.\+macports.\+org/} ~\newline
 ~\newline
 Install at least the following ports\+: ~\newline
 qt4-\/mac +debug~\newline
 cmake~\newline
 br /$>$ As additional ports we recommend the following~\newline
 fftw-\/3~\newline
 qwt-\/60 +debug +qt4~\newline
 subversion~\newline
 doxygen~\newline
 
\item Extract the source code or get it via svn\+:~\newline
 {\ttfamily {\bfseries  git clone --recursive \href{https://graphics.rwth-aachen.de:9000/OpenFlipper-Free/OpenFlipper-Free.git}{\tt https\+://graphics.\+rwth-\/aachen.\+de\+:9000/\+Open\+Flipper-\/\+Free/\+Open\+Flipper-\/\+Free.\+git} Open\+Flipper-\/\+Free}} 
\item Create a build directory (e.\+g. {\bfseries build}) next to the Open\+Flipper-\/\+Free directory\+: {\ttfamily {\bfseries mkdir build}} 
\item Change to the newly created directory ( {\ttfamily {\bfseries cd build}} ) and type {\ttfamily {\bfseries cmake ../\+Open\+Flipper-\/\+Free}} or if you want to build in release mode type {\ttfamily {\bfseries  cmake -\/\+D\+C\+M\+A\+K\+E\+\_\+\+B\+U\+I\+L\+D\+\_\+\+T\+Y\+PE=Release ../\+Open\+Flipper-\/\+Free}} ~\newline
 You can also enable bundle creation by adding {\ttfamily {\bfseries -\/\+D\+O\+P\+E\+N\+F\+L\+I\+P\+P\+E\+R\+\_\+\+C\+A\+L\+L\+\_\+\+F\+I\+X\+\_\+\+B\+U\+N\+D\+LE=true}} to the cmake command line (If you want a bundle containing all required libraries. Otherwise, the libraries will be used at their original locations.)  
\item Now call {\bfseries make} to build Open\+Flipper  
\end{DoxyItemize}

The created application bundle can be found in the {\bfseries Build} directory. If you build with {\ttfamily {\bfseries -\/\+D\+O\+P\+E\+N\+F\+L\+I\+P\+P\+E\+R\+\_\+\+C\+A\+L\+L\+\_\+\+F\+I\+X\+\_\+\+B\+U\+N\+D\+LE=true}}, the bundle will contain all required libraries.

You can also create a drag and drop installer for mac by calling {\ttfamily {\bfseries make Open\+Flipper\+\_\+package}}. This will also call fixbundle on your Bundle. {\bfseries Note\+: When fixbundle has been called, the rpaths will be switched to local libraries. Concurrent builds, will still reference the global ones, which will cause inconsistencies and crashes! You have to call fixbundle after each build if it has been called once.}\hypertarget{buildingOpenFlipper_cmake_plugin}{}\section{Building Open\+Flipper Plugins with C\+Make}\label{buildingOpenFlipper_cmake_plugin}
Building plugins with C\+Make is very simple. The Open\+Flipper C\+Make build system expects a C\+Make\+Lists.\+txt file in each of the plugin\textquotesingle{}s directories. So when developing a plugin, just make sure there is a C\+Make\+Lists.\+txt in your plugin\textquotesingle{}s directory. In this file include the global file plugin.\+cmake which specifies the openflipper\+\_\+plugin() function\+:

{\ttfamily include(plugin)}

You then have to add the following line which configures the build parameters of your plugin\+:

{\ttfamily openflipper\+\_\+plugin()}

Note\+: There are several parameters that one can pass to this function. Usage\+:


\begin{DoxyCodeInclude}
openflipper\_plugin ( [DIRS dir1 dir2 ...]
                     [TYPES type1 type2 ...] 
                     [OPT\_TYPES type1 type2 ...] 
                     [DEPS dep1 dep2 ...]
                     [OPTDEPS dep1 dep2 ...]
                     [LDFLAGSADD flag1 flag2 ...]
                     [CFLAGSADD flag1 flag2 ...]
                     [CDEFINITIONSADD definition1 definition2 ...]
                     [LIBRARIES lib1 lib2 ...]
                     [ADD\_CORE\_APP\_LIBRARIES lib1 lib2 ...]
                     [LIBDIRS dir1 dir2 ...]
                     [INCDIRS dir1 dir2 ...]
                     [ADDSRC file1 file2 ...]
                     [INSTALLDATA dir1 dir2 ...]
                     [TRANSLATION\_LANGUAGES lang1 lang2 ...]
                     [TRANSLATION\_ADDFILES file1 file2 ...]
                     [LICENSEMANAGER]
                     [PYTHONINTERFACE] )


DIRS                   = additional directories with source files
TYPES                  = List of datatypes required by \textcolor{keyword}{this} plugin (uppercase)
OPT\_TYPES              = List of optional datatypes \textcolor{keywordflow}{for} \textcolor{keyword}{this} plugin (uppercase)
DEPS                   = required dependencies \textcolor{keywordflow}{for} find\_package macro
OPTDEPS                = optional dependencies \textcolor{keywordflow}{for} find\_package macro, \textcolor{keywordflow}{if} found, a define ENABLE\_<Depname> 
      will be added automatically
LDFLAGSADD             = flags added to the link command
CFLAGSADD              = flags added to the compile command
CDEFINITIONSADD        = definitions added to the compile command
LIBRARIES              = libraries added to link command
ADD\_CORE\_APP\_LIBRARIES = libraries added to be linked to the core app
LIBDIRS                = additional link directories
INCDIRS                = additional include directories
ADDSRC                 = additional source files
INSTALLDATA            = directories that will be installed into the openflipper data directory
GLEWDEFINITIONS        = Checks glew \textcolor{keywordflow}{if} it defines the given definitions

TRANSLATION\_LANGUAGES = language codes \textcolor{keywordflow}{for} translation
TRANSLATION\_ADDFILES  = additional files that should be included into the translation files

LICENSEMANAGER   = Compile plugin with license management
PYTHONINTERFACE  = \textcolor{keywordflow}{if} defined, the plugin will \textcolor{keywordflow}{try} to build a python \textcolor{keyword}{interface }which has to be in a 
      subdirectory called \hyperlink{classPythonInterface}{PythonInterface}

Plugins can implement a acg\_list\_filter ("listname") macro to filter out
unneeded headers, sources and ui files from the autogenerated
build sources lists (see common.\hyperlink{namespacecmake}{cmake} drop\_templates macro)

Translations
Create a subdirectory called translations in your Plugin directory
The *.ts files there will be used \textcolor{keywordflow}{for} the translations

Special DEPS:
CUDA:
If your plugin requires cuda, add \textcolor{stringliteral}{"CUDA"} to the list of dependencies
and create a subdir called Cuda in your plugin directory
The files in \textcolor{keyword}{this} directory will be compiled by nvcc and linked
into the plugin

The variables PLUGIN\_$\{plugin\}\_MISSING\_DEPS indicate whether any mandatory
dep

\end{DoxyCodeInclude}


For a detailed description of the parameters see the C\+Make documentation. For an example of how to build a simple plugin see \hyperlink{ex1}{A simple plugin}. 