Basic CMake, part 2: libraries - The Coding Nest
https://codingnest.com/basic-cmake-part-202.06.2018 · Basic CMake, part 2: libraries By Martin Hořeňovský Jun 2nd 2018 Tags: CMake, Tutorial, C++. My previous post about CMake provided a simple CMakeLists.txt for a small, self-contained, project. In practice, very few projects are fully self-contained, as they either depend on external libraries or are themselves libraries that other projects depend on.
include_directories — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpThe include directories are added to the INCLUDE_DIRECTORIES directory property for the current CMakeLists file. They are also added to the INCLUDE_DIRECTORIES target property for each target in the current CMakeLists file. The target property values are the ones used by the generators. By default the directories specified are appended onto the ...
Step 2: Adding a Library — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpMathFunctions/CMakeLists.txt ¶ add_library (MathFunctions mysqrt.cxx) To make use of the new library we will add an add_subdirectory () call in the top-level CMakeLists.txt file so that the library will get built. We add the new library to the executable, and add MathFunctions as an include directory so that the mysqrt.h header file can be found.