Often I see cmake code like this:
if(APPLE)
set(CMAKE_XCODE_GENERATE_SCHEME TRUE)
else()
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECTlab)
endif()
Is it really necessary to do the if…else clause? Isn’t it clear already by the name of the property that it belongs to XCODE or VS? I would rather write:
set(CMAKE_XCODE_GENERATE_SCHEME TRUE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECTlab)
Does it have any impact to leave out the if…else clause? What’s the best practice for code like this?