Introduction to cmake
raphaelmeyer
27.1K views
You did it!
Some Final Words
Does:
- Use the commands
target_include_directories
target_link_libraries
target_compile_definitions
target_compile_features
target_compile_options
- Always set
cmake_minimum_required
- Use
PRIVATE
,INTERFACE
andPUBLIC
- Use namespaced alias targets
Don'ts:
- Do NOT use
add_compile_optionsadd_definitionsinclude_directorieslink_directorieslink_libraries
- Never ever use
set(CMAKE_...)
Resources
Effective CMake by Daniel Pfeifer at C++Now 2017
Using Modern CMakePatterns to Enforce a Good Modular Design by Mathieu Ropert
Embracing Modern CMake by Stephen Kelly
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.