This commit is contained in:
cxh 2025-11-20 09:23:51 +08:00
parent 89aef13800
commit 5c6c91308c

View File

@ -50,10 +50,7 @@ target_link_libraries(camera_to_rtsp
# config.json bin/
add_custom_command(TARGET camera_to_rtsp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Checking config.json..."
COMMAND ${CMAKE_COMMAND} -E test -e $<TARGET_FILE_DIR:camera_to_rtsp>/config.json
|| ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/config.json
$<TARGET_FILE_DIR:camera_to_rtsp>/config.json
COMMAND /bin/bash -c "if [ ! -f '$<TARGET_FILE_DIR:camera_to_rtsp>/config.json' ]; then cp '${CMAKE_SOURCE_DIR}/config.json' '$<TARGET_FILE_DIR:camera_to_rtsp>/config.json'; else echo 'config.json exists, skip copy'; fi"
)