Note that you also have respective set_*_properties
functions for some of the other types of properties: set_source_files_properties
, set_directory_properties
and set_tests_properties
. Notably absent are setters for install and global properties.
The reason for that is that these functions predate the general set_property
call, which was only introduced with CMake 2.6, together with a general overhaul of the property system to what it is today.
These days, people tend to prefer the generic set_property
, as it is the more modern function and provides a few additional features. It also offers a more consistent syntax than the old functions (eg. set_directory_properties
not allowing to specify the directory as a parameter, set_source_files vs set_directory, etc.).
There is not a strong technical reason for preferring set_property
, but I would consider it slightly better style than using the old, specific functions.