-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Minimal CMake
By :
Rounding out this chapter, we’re going to look at one final addition, and that’s how to add install support to our application. This is to help prepare for packaging and ensure that our application is portable.
The first change we’ll make is to add a CMAKE_INSTALL_PREFIX variable to our app’s CMakePresets.json file to ensure that our application is installed in a location relative to our project:
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install" The following changes are then reserved exclusively for ch8/part-5/app/CMakeLists.txt. We first need to include GNUInstallDirs as we did for our libraries to gain access to standard CMake install locations (in this example, we only really care about CMAKE_INSTALL_BINDIR).
The high-level goal we want to achieve is to have a relocatable folder containing the executable of our application, shared libraries that need to be loaded by the app, and resources needed at...