September 2018
Intermediate to advanced
606 pages
14h 32m
English
Let us have a look at our static/shared library example from the previous recipe. Instead of hardcoding USE_LIBRARY to ON or OFF, we will now prefer to expose it as an option with a default value that can be changed from the outside:
option(USE_LIBRARY "Compile sources into a library" OFF)
$ mkdir -p build$ cd build$ cmake -D USE_LIBRARY=ON ..-- ...-- Compile sources into a library? ON-- ...$ cmake --build .Scanning dependencies of target message[ 25%] Building CXX object ...
Read now
Unlock full access