CMake: Remove usage of global directory functions such as `add_compile_definitions`
Global functions such as add_compile_definitions()
, add_definitions()
, include_directories()
, etc. set properties for a directory and all its children. Since this may lead to properties being invisibly set where they shouldn't, target-specific functions such as target_compile_definitions()
should be preferred instead.