加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
zksite 提交于 2024-07-03 15:17 . 添加
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 ()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化