```cmake
MACRO(SIGN_TARGET target)
  IF(WITH_SIGNCODE)
    IF(WIN32)
      SET(target_file $<TARGET_FILE:${target}>)
      IF(EXISTS "C:\tools\sign.bat")
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND c:\tools\sign.bat ${target_file})
      ELSEIF()
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND signtool ARGS sign ${SIGN_OPTIONS} ${target_file})
      ENDIF()
    ENDIF()
  ENDIF()
ENDMACRO()
```

Fix for windows build: cmake doesn't like backslashes :-(
user
```cmake
MACRO(SIGN_TARGET target)
  IF(WITH_SIGNCODE)
    IF(WIN32)
      SET(target_file $<TARGET_FILE:${target}>)
      IF(EXISTS "/tools/sign.bat")
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND /tools/sign.bat ARGS ${target_file})
      ELSEIF()
        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND signtool ARGS sign ${SIGN_OPTIONS} ${target_file})
      ENDIF()
    ENDIF()
  ENDIF()
ENDMACRO()
```
assistant