I have 2 .props files, one is for Debug, and the other one is for Release. I’ve tried 2 ways below using generator expressions, but none of them works, no file is added/shown in the Property Manager window in Visual Studio:
set_property(TARGET MyTarget PROPERTY VS_USER_PROPS
$<$<CONFIG:Debug>:${PROJECT_SOURCE_DIR}/../Include/prop_sheet_Debug.props>
$<$<CONFIG:Release>:${PROJECT_SOURCE_DIR}/../Include/prop_sheet_Release.props>
)
set_property(TARGET MyTarget PROPERTY VS_USER_PROPS "${PROJECT_SOURCE_DIR}/../Include/prop_sheet_$<CONFIG>.props")
This works, but it’ll add the prop_sheet_Debug.props
file to both Debug and Release configurations of the target (shown in the Property Manager window), which is undesirable:
set_property(TARGET MyTarget PROPERTY VS_USER_PROPS "${PROJECT_SOURCE_DIR}/../Include/prop_sheet_Debug.props")
Is it possible at all to add prop_sheet_Debug.props
for the Debug config and prop_sheet_Release.props
for the Release config using CMake?
2