\subsection*{Issue}


\begin{DoxyItemize}
\item Plugin names and plugin folders must exactly match (resolver\+\_\+$\ast$, crypto\+\_\+$\ast$)
\item Non-\/existing plugin variants are not checked
\item Default plugin collection is too small
\item Duplicate of all plugin names in different folder
\item Only one category per plugin
\item On some O\+S some plugins won't work (simpleini)
\end{DoxyItemize}

\subsection*{Constraints}

\subsection*{Assumptions}


\begin{DoxyItemize}
\item Many plugins work without dependencies and variants, this should be simple
\end{DoxyItemize}

\subsection*{Considered Alternatives}


\begin{DoxyItemize}
\item have one more mapping that describes folder $<$-\/$>$ plugins (bad coherence)
\item directly use R\+E\+A\+D\+M\+E.\+md to also describe cmake deps (too limited in expression)
\item split up Add\+Plugin.\+cmake and C\+Make\+Lists.\+txt (does not work well with variants)
\item simply adding all directories in src/plugins and decide within the {\ttfamily add\+\_\+plugin} if we should drop the plugin (see below in Argument)
\end{DoxyItemize}

Names for flag\+:


\begin{DoxyItemize}
\item {\ttfamily D\+E\+P\+E\+N\+D\+E\+N\+C\+I\+E\+S} -\/$>$ might be used for {\ttfamily add\+\_\+plugin}
\item {\ttfamily A\+S\+S\+E\+M\+B\+L\+E\+\_\+\+D\+E\+P\+S}
\item {\ttfamily F\+I\+N\+D\+\_\+\+D\+E\+P\+S} -\/$>$ not only finding happens
\item {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+D\+E\+P\+S}
\item {\ttfamily H\+A\+N\+D\+L\+E\+\_\+\+D\+E\+P\+S}
\item {\ttfamily D\+E\+P\+S\+\_\+\+M\+O\+D\+E} -\/$>$ too generic, new terminology
\item {\ttfamily C\+H\+E\+C\+K\+\_\+\+D\+E\+P\+S} -\/$>$ not only checking happens
\item {\ttfamily D\+O\+\_\+\+D\+E\+P\+S} -\/$>$ sounds funny
\item {\ttfamily F\+I\+N\+D\+\_\+\+P\+A\+C\+K\+A\+G\+E\+S} -\/$>$ not only packages are subject to this phase
\item {\ttfamily C\+O\+L\+L\+E\+C\+T} -\/$>$ needs N\+O\+T
\item {\ttfamily F\+I\+N\+D\+\_\+\+P\+H\+A\+S\+E} -\/$>$ needs N\+O\+T
\item {\ttfamily D\+E\+P\+E\+N\+D\+E\+N\+C\+Y} -\/$>$ ambiguous
\end{DoxyItemize}

\subsection*{Decision}

Introduce a cmake process where all plugins are processed two times\+:

1.) collection phase ({\ttfamily D\+E\+P\+E\+N\+D\+E\+N\+C\+Y\+\_\+\+P\+H\+A\+S\+E} is {\ttfamily O\+F\+F}), with\+:
\begin{DoxyItemize}
\item {\ttfamily A\+D\+D\+E\+D\+\_\+\+P\+L\+U\+G\+I\+N\+S}
\item {\ttfamily R\+E\+M\+O\+V\+E\+D\+\_\+\+P\+L\+U\+G\+I\+N\+S}
\item {\ttfamily A\+D\+D\+E\+D\+\_\+\+D\+I\+R\+E\+C\+T\+O\+R\+I\+E\+S}
\item add\+\_\+plugin, but without actually adding internally 2.) assemble dependency phase ({\ttfamily D\+E\+P\+E\+N\+D\+E\+N\+C\+Y\+\_\+\+P\+H\+A\+S\+E} is {\ttfamily O\+N}, only considering {\ttfamily A\+D\+D\+E\+D\+\_\+\+D\+I\+R\+E\+C\+T\+O\+R\+I\+E\+S}), with\+:
\item add\+\_\+libraries, actually search for libraries on the system
\item add\+\_\+plugin, with {\itshape actually adding} the plugins
\end{DoxyItemize}

Use following cmake variables for the phases\+:


\begin{DoxyItemize}
\item {\ttfamily C\+O\+L\+L\+E\+C\+T\+I\+O\+N\+\_\+\+P\+H\+A\+S\+E} .. collect all {\ttfamily add\+\_\+plugins}
\item {\ttfamily D\+E\+P\+E\+N\+D\+E\+N\+C\+Y\+\_\+\+P\+H\+A\+S\+E} .. resolve all dependencies, do {\ttfamily add\+\_\+plugins} again
\item {\ttfamily A\+D\+D\+T\+E\+S\+T\+I\+N\+G\+\_\+\+P\+H\+A\+S\+E} .. (reserve for potential 3rd phase)
\end{DoxyItemize}

\subsection*{Argument}

Solves all the issues without adding too much complexity. Can be extended to three phases if we need that for tests (they need knowledge about which plugins actually were added)

Maintaining additional mappings is very time-\/consuming. Simply adding all plugins directories is problematic. It would\+:


\begin{DoxyItemize}
\item clutter the cmake output (especially in the case of errors)
\item introduce more variables into the C\+Make\+Cache which are irrelevant for the user
\item maybe even find libraries in wrong versions which are incompatible to what other plugins need
\end{DoxyItemize}

\subsection*{Implications}


\begin{DoxyItemize}
\item need to adopt all C\+Make\+Lists.\+txt to use {\ttfamily find\+\_\+package} only in the second phase
\end{DoxyItemize}

\subsection*{Related decisions}

\subsection*{Notes}