

We just need to provide the my_library-config.cmake file. Set(MY_LIBRARY_VERSION $ - matches this expression. Set(MY_LIBRARY_VERSION_MINOR 0 CACHE STRING "minor version" FORCE)
#INSTALLING CMAKE LINUX TUTORIAL INSTALL#
Note: The same version of the software canbe installed through the command line using the following command: sudo snap install cmake. From search bar type cmake as follow and run cmake. cd into the glfw-3.X.X directory and run cmake -G 'Unix Makefiles' you may need elevated privileges, and you may also need to install. The next step is to extract the archive, and open a terminal. After that, the installation process will begin. The first step is to download the latest version (assuming versions in the future work in a similar way) from probably using this link.

Set(MY_LIBRARY_VERSION_MAJOR 1 CACHE STRING "major version" FORCE) Enter your password and click the Authenticate button. # define library version (update: apparently you can also do it in project()!) Installation of CMake (pre-compiled binary of Linux) cmake command usable in your command-line, you need to modify the environment variable PATH so that the. The root CMakeLists.txt can look as follows: cmake_minimum_required(VERSION 3.0)

This allows a seperation of CMake’s config files and other, unrelated configuration macros etc. The configurations will be set in the file which will be preprocessed to config_impl.hpp and included by config.hpp. The root CMakeLists.txt defines configuration options and adds the subdirectories. The library, the examples and the tool each has their own CMakeLists.txt defining the target and related code in their subdirectory. It also comes with some examples, a tool and unit tests. So we have a library consisting of various header and source files. The setupįor the scope of the tutorial, let’s say we have a library that has the following CMake structure: - include/ Throughout this post, I’ll be assuming a 3.x CMake version and an already existing CMake project. In particular, the system will be able to handle multiple installed versions and multiple configurations.
#INSTALLING CMAKE LINUX TUTORIAL HOW TO#
In this post, I will show you how to install your library so that it can be used easily by other projects. As of version 0.5 my memory library now provides support for system-wide installation and CMake’s find_package().īecause I’ve spent hours of trial and error to come up with it, I’ll document it here. Build versus source directory src ) must remain pristine, so it is not allowed to install packages using the traditional make process and after an.
