代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.16)
project(test_wav2lip_cpp)
#set(CMAKE_CXX_STANDARD 17)
if (WIN32)
#libtorch
set(Torch_DIR ${CMAKE_SOURCE_DIR}/libs/win-x86_64/libtorch/share/cmake/Torch)
find_package(Torch REQUIRED)
message(STATUS "TORCH_LIBRARIES: ${TORCH_LIBRARIES}")
#opencv
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/libs/win-x86_64/opencv-mobile-4.10.0-windows-vs2022/x64/x64/vc17/staticlib)
find_package(OpenCV REQUIRED)
option(USE_OPENCV "shared library support" TRUE)
message(STATUS "OpenCV_LIBS: ${OpenCV_LIBS}")
elseif (UNIX)
#libtorch
set(Torch_DIR ${CMAKE_SOURCE_DIR}/libs/linux-x86_64/libtorch/share/cmake/Torch)
find_package(Torch REQUIRED)
message(STATUS "TORCH_LIBRARIES: ${TORCH_LIBRARIES}")
#opencv
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/libs/linux-x86_64/opencv-mobile/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)
option(USE_OPENCV "shared library support" TRUE)
message(STATUS "OpenCV_LIBS: ${OpenCV_LIBS}")
endif ()
# 添加这行以处理CMAKE_BUILD_TYPE变量
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
set(INCLUDE_DIRS
face_detection
)
set(GLOBAL_SRC
main.cpp
# face_detection/ConvBlock.cpp
# face_detection/HourGlass.cpp
# face_detection/HourGlass.h
# face_detection/Fan.cpp
# face_detection/Fan.h
# face_detection/BaseModule.h
)
add_executable(test_wav2lip_cpp ${GLOBAL_SRC})
include_directories(${TORCH_INCLUDE_DIRS} ${INCLUDE_DIRS})
target_link_libraries(test_wav2lip_cpp ${TORCH_LIBRARIES} ${OpenCV_LIBS})
set_property(TARGET test_wav2lip_cpp PROPERTY CXX_STANDARD 14)
if (WIN32)
add_custom_command(TARGET test_wav2lip_cpp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/libs/win-x86_64/libtorch/lib
$<TARGET_FILE_DIR:test_wav2lip_cpp>)
endif ()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。