1. Why
CMake is indeed not a modern design for package management
1 | find_package(Boost 1.55 COMPONENTS asio) |
- lack of structure
- the order of linking is missing
2. Target
Modern CMake is about targets
- executable is target
- library is target
Properties is the
- source file
- compiler option
- Link against
Properties have two domain
- PRIVATE: for internal use
- INTERFACE: for usage of this lib
3. Import
When we call find_package()
, the CMake would execute FindBoost.cmake
and import the Boost::boost
, so that we can link them target_link_libraries()
The PAIN: 3rd party dependencies,