Attempt to clean up the path mess in cmake and improve scalability.
Previously, paths such as action search path and config file path had to
be given manually and were likely to be wrong if running make install or
if running the program from the build directory directly.
This commit introduces set_switchable(), along with the
DINDEXER_INST_MODE. Whenever relevant, paths come with a regular and an
INST variant (eg: DINDEXER_QML_PATH and DINDEXER_INST_QML_PATH), which
are CACHE variables so users can customize them and expect their setting
to be persistent.
set_switchable() then sets a CURR variant of the same variable (eg:
DINDEXER_CURR_QML_PATH), which is set to either of the above two values
depending on if DINDEXER_INST_MODE is on or off. This way the rest of
the cmake code can just use the CURR variable and expect it to be set to
the right value.
Sprout is needed because pow, log2 and log10 are constexpr on gcc,
but that's nonstandard. Sprout provides the constexpr version of
those functions.
Also fix warnings. I still get plenty of warnings about some suggested
paretheses, but it seems to be a bug from clang. See
https://llvm.org/bugs/show_bug.cgi?id=21629 for the bug report.
This also adds a public dependency to machinery in the header-only
backend project. This is because the backend does need functionality
from machinery, such as FileRecordData and TigerHash.
It's still missing ast optimization and some code cleanup is also
needed, but it should be working in the general case.
Also write a small unit test for it.
Allows to pass -march=native to dindxer projects and to libpqtypes.
CMake min version raised to 3.3 since externalproject_add didn't
support generator expressions prior to that version.
I'm not sure this is something that should be in the code, since
compgen -W "delete locate navigate query scan" loc
would do just the same as
dindexer --printactions=loc
so this is a duplicated functionality. However this commit is
self-contained, so it should be easy to revert it, if needed.