3 ms·
Wouldn't it be preferable to set the C++ standard with: set_property(TARGET tgt PROPERTY CXX_STANDARD 11) That way if you have multiple targets you're not
by eslaught 8y ago
Wouldn't it be preferable to set the C++ standard with:
set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
That way if you have multiple targets you're not setting it everywhere?
- cypher543 8y agoThe target property overrides the global setting, so you can set CMAKE_CXX_STANDARD as the default and then set the target property if you really need a different standard for some reason. And if you have a whole sub-project that needs a specific version, you can set CMAKE_CXX_STANDARD before calling add_subdirectory to have it apply to only the targets in that directory.