Skip to content

Commit 958c40e

Browse files
authored
Fix missing Silero VAD model file on Windows (#247)
Revert changes to Windows CMake helpers from #231 I missed that I'd broken the copying of data files to the correct dir for Windows when trying to fix the builds for OBS v32
1 parent 5c212e8 commit 958c40e

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

cmake/windows/helpers.cmake

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,6 @@ function(set_target_properties_plugin target)
5252
target_link_libraries(${target} PRIVATE plugin-support)
5353
endif()
5454

55-
add_custom_command(
56-
TARGET ${target}
57-
POST_BUILD
58-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
59-
COMMAND
60-
"${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${target}>"
61-
"$<$<CONFIG:Debug,RelWithDebInfo,Release>:$<TARGET_PDB_FILE:${target}>>"
62-
"${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
63-
COMMENT "Copy ${target} to rundir"
64-
VERBATIM)
65-
6655
target_install_resources(${target})
6756

6857
get_target_property(target_sources ${target} SOURCES)
@@ -103,17 +92,19 @@ function(target_install_resources target)
10392

10493
install(
10594
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
106-
DESTINATION "${target}/data"
95+
DESTINATION "data/obs-plugins/${target}"
10796
USE_SOURCE_PERMISSIONS)
10897

109-
add_custom_command(
110-
TARGET ${target}
111-
POST_BUILD
112-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
113-
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
114-
"${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
115-
COMMENT "Copy ${target} resources to rundir"
116-
VERBATIM)
98+
if(OBS_BUILD_DIR)
99+
add_custom_command(
100+
TARGET ${target}
101+
POST_BUILD
102+
COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
103+
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
104+
"${OBS_BUILD_DIR}/data/obs-plugins/${target}"
105+
COMMENT "Copy ${target} resources to data directory"
106+
VERBATIM)
107+
endif()
117108
endif()
118109
endfunction()
119110

0 commit comments

Comments
 (0)