Introduction to cmake
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
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
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content