
Modern CMake for C++
By :

We have used find_package()
extensively in previous chapters. We saw how convenient it is and how it simplifies the whole process. To make our project accessible through this command, we need to complete a few steps so that CMake can treat our project as a coherent package:
Let's start from the beginning: why do targets need to be relocatable and how can we do this?
Installation solves many problems but unfortunately, it also introduces some complexity: not only is CMAKE_INSTALL_PREFIX
platform-specific but it can also be set by the user at the installation stage with the --prefix
option. However, target export files are generated before the installation, during the build stage, at which point we don't know where the installed...