Drop {INCLUDE,LIBRARY,RUNTIME}_INSTALL_DIR variables in CMakeLists.txt (#4979)
authorFabianWolff <fabi.wolff@arcor.de>
Thu, 3 Sep 2020 01:48:36 +0000 (03:48 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 01:48:36 +0000 (18:48 -0700)
commitedd69cb2570692f36bf26b658e967c317ebc048e
tree0ec9063e7008788ce684b93c02252490cb90688f
parent8b4444dad1647c89b313deedd22129252078fe1b
Drop {INCLUDE,LIBRARY,RUNTIME}_INSTALL_DIR variables in CMakeLists.txt (#4979)

On Debian (for instance), libraries aren't installed into `/usr/lib/`, but into something like `/usr/lib/x86_64-linux-gnu/`. In particular, this means that setting the `LIBRARY_INSTALL_DIR` to `lib` in the top-level `CMakeLists.txt` file is wrong.

Luckily, there is a simple solution: CMake provides [`CMAKE_INSTALL_LIBDIR`](https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html) for this very purpose, which has sensible defaults and can be set by the user. In particular, since `CMAKE_INSTALL_LIBDIR` is a standardized variable, tools like the ones used for building Debian packages can set it to what they want it to be, whereas using a custom variable like `LIBRARY_INSTALL_DIR` wouldn't work in this setting.

Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
CMakeLists.txt
src/CMakeLists.txt
src/main/CMakeLists.txt
src/parser/CMakeLists.txt