ZERO_CHECK messes up build events

Visual Studio 16 on PC:

As soon as you run ZERO_CHECK all scrips from the build events get overwritten/erased.

Example:

I added this as a script to my post build events:

@echo Postbuild script — copy VST3 files —
copy /Y “D:\VST_SDK_3.7\build\VST3\Release\Warlock.vst3” “C:\Program Files\Common Files\VST3\Warlock.vst3”
copy /Y “D:\VST_SDK_3.7\build\VST3\Release\Warlock.vst3” “C:\Program Files\Steinberg\Vstplugins\Warlock.dll”
@echo — copy finished —
@echo PostBuild script: — Running Validator.exe start —
“D:\VST_SDK_3.7\build\bin\Release\validator.exe” “D:\VST_SDK_3.7\build\VST3\Release\Warlock.vst3”
@echo PostBuild script: — Running Validator.exe finished —

After running the ZERO_CHECK my script has been removed

Yeah, this is expected. If you use cmake then you cannot do changes to generated projects you have to do this in the CMakeLists.txt.
The stuff you do in the script you added is already supported by the SDK’s cmake modules.

In SDK 3.7 on Windows the validator was not running by default, although i had selected this SMTG_RUN_VST_VALIDATOR in CMakeGUI.

I was able to fix the problem. At the end of the CMakeLists.txt i added these lines:

#Trägt in visual studio das pre- und postbuild skript ein, das sonst blank überschrieben wird nach ZERO_CHECK
if(SMTG_WIN)
add_custom_command (
TARGET ${target}
PRE_BUILD
COMMAND cmd /c D:/VST_SDK_3.7/my_plugins/Warlock/prebuild.bat
COMMENT “executing prebuild.bat”
)
if(CMAKE_BUILD_TYPE STREQUAL “Debug”)
add_custom_command (
TARGET ${target}
POST_BUILD
COMMAND cmd /c D:/VST_SDK_3.7/my_plugins/Warlock/postbuild_debug.bat
COMMENT “executing postbuild_debug.bat”
)
endif()
if(CMAKE_BUILD_TYPE STREQUAL “Release”)
add_custom_command (
TARGET ${target}
POST_BUILD
COMMAND cmd /c D:/VST_SDK_3.7/my_plugins/Warlock/postbuild_release.bat
COMMENT “executing postbuild_release.bat”
)
endif()
endif()

if(CMAKE_BUILD_TYPE STREQUAL “Debug”) is always true. No matter if i select ‘Release’ or ‘Debug’ as build type in Visual Studio. :cry:
This SDK is driving me nuts

There’s a copy/paste typo in the script, in the release path you’re calling the debug.bat

I fixed the typo.

However the main problem remains:
if(CMAKE_BUILD_TYPE STREQUAL “Debug”)
always returns a true.

By further checking out the Linker settings of the ‘release build’ i noticed that /DEBUG is also always active. I am not sure if this is intended

You have to use cmake’s generator expressions for multi config projects. See cmake-generator-expressions(7) — CMake 3.25.1 Documentation