首页 > 解决方案 > 构建openpose库时Cmake在生成期间抛出错误

问题描述

我对 cmake 很陌生,我正在使用 Cmake Gui 来编译 openpose 库https://github.com/CMU-Perceptual-Computing-Lab/openpose。当我配置它时,它配置成功,但是当我单击生成时,它会抛出错误但仍然会生成编译文件。我正在关注https://www.youtube.com/watch?v=QC9GTb6Wsb4本教程,但是当我尝试使用 Visual Studio 构建程序时,出现错误。

我已经在带有 Nvidia Geforce 940M 的 Windows 10 中安装了 Visual Studio 2017。构建后的 Visual Studio 屏幕截图

  Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
CMAKE_VERSION = 3.17.0-rc1
Building with CUDA.
Downloading windows dependencies...
opencv_411_v14_15_2019_09_24.zip already exists.
caffe3rdparty_15_2019_03_14.zip already exists.
caffe_15_2019_05_16.zip already exists.
Windows dependencies downloaded.
Adding Example Calibration
Adding Example OpenPoseDemo
Adding Example 1_custom_post_processing
Adding Example 01_body_from_image_default
Adding Example 02_whole_body_from_image_default
Adding Example 03_keypoints_from_image
Adding Example 04_keypoints_from_images
Adding Example 05_keypoints_from_images_multi_gpu
Adding Example 06_face_from_image
Adding Example 07_hand_from_image
Adding Example 08_heatmaps_from_image
Adding Example 09_keypoints_from_heatmaps
Adding Example 10_asynchronous_custom_input
Adding Example 11_asynchronous_custom_output
Adding Example 12_asynchronous_custom_input_output_and_datum
Adding Example 13_synchronous_custom_input
Adding Example 14_synchronous_custom_preprocessing
Adding Example 15_synchronous_custom_postprocessing
Adding Example 16_synchronous_custom_output
Adding Example 17_synchronous_custom_all_and_datum
Adding Example 1_thread_user_processing_function
Adding Example 2_thread_user_input_processing_output_and_datum
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
fatal: not a git repository (or any of the parent directories): .git

pybind11 v2.4.dev4
Configuring done
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindCUDA.cmake:1833 (add_library):
  Target "openpose" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  src/openpose/CMakeLists.txt:21 (cuda_add_library)


CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindCUDA.cmake:1833 (add_library):
  Target "openpose" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  src/openpose/CMakeLists.txt:21 (cuda_add_library)


CMake Error at examples/calibration/CMakeLists.txt:15 (add_executable):
  Target "Calibration" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/calibration/CMakeLists.txt:15 (add_executable):
  Target "Calibration" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/openpose/CMakeLists.txt:15 (add_executable):
  Target "OpenPoseDemo" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/openpose/CMakeLists.txt:15 (add_executable):
  Target "OpenPoseDemo" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/tutorial_add_module/CMakeLists.txt:17 (add_executable):
  Target "1_custom_post_processing" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_add_module/CMakeLists.txt:17 (add_executable):
  Target "1_custom_post_processing" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "01_body_from_image_default" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "01_body_from_image_default" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "02_whole_body_from_image_default" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "02_whole_body_from_image_default" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "08_heatmaps_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "08_heatmaps_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "03_keypoints_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "03_keypoints_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "12_asynchronous_custom_input_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "12_asynchronous_custom_input_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "05_keypoints_from_images_multi_gpu" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "05_keypoints_from_images_multi_gpu" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "04_keypoints_from_images" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "04_keypoints_from_images" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "06_face_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "06_face_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "07_hand_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "07_hand_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "09_keypoints_from_heatmaps" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "09_keypoints_from_heatmaps" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "10_asynchronous_custom_input" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "10_asynchronous_custom_input" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "11_asynchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "11_asynchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "13_synchronous_custom_input" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "13_synchronous_custom_input" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "17_synchronous_custom_all_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "17_synchronous_custom_all_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "14_synchronous_custom_preprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "14_synchronous_custom_preprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "15_synchronous_custom_postprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "15_synchronous_custom_postprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "16_synchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "16_synchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "1_thread_user_processing_function" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "1_thread_user_processing_function" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "2_thread_user_input_processing_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "2_thread_user_input_processing_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at 3rdparty/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "pyopenpose" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  python/openpose/CMakeLists.txt:6 (pybind11_add_module)


CMake Error at 3rdparty/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "pyopenpose" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  python/openpose/CMakeLists.txt:6 (pybind11_add_module)


CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindCUDA.cmake:1833 (add_library):
  Target "openpose" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  src/openpose/CMakeLists.txt:21 (cuda_add_library)


CMake Error at examples/calibration/CMakeLists.txt:15 (add_executable):
  Target "Calibration" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/openpose/CMakeLists.txt:15 (add_executable):
  Target "OpenPoseDemo" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at examples/tutorial_add_module/CMakeLists.txt:17 (add_executable):
  Target "1_custom_post_processing" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "01_body_from_image_default" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "02_whole_body_from_image_default" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "08_heatmaps_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "03_keypoints_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "12_asynchronous_custom_input_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "05_keypoints_from_images_multi_gpu" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "04_keypoints_from_images" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "06_face_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "07_hand_from_image" links to target "Threads::Threads" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "09_keypoints_from_heatmaps" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "10_asynchronous_custom_input" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "11_asynchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "13_synchronous_custom_input" links to target "Threads::Threads" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "17_synchronous_custom_all_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "14_synchronous_custom_preprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "15_synchronous_custom_postprocessing" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_cpp/CMakeLists.txt:33 (add_executable):
  Target "16_synchronous_custom_output" links to target "Threads::Threads"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "1_thread_user_processing_function" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at examples/tutorial_api_thread/CMakeLists.txt:16 (add_executable):
  Target "2_thread_user_input_processing_output_and_datum" links to target
  "Threads::Threads" but the target was not found.  Perhaps a find_package()
  call is missing for an IMPORTED target, or an ALIAS target is missing?


CMake Error at 3rdparty/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Target "pyopenpose" links to target "Threads::Threads" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  python/openpose/CMakeLists.txt:6 (pybind11_add_module)


Generating done

这是我配置生成时cmake的日志。

将不胜感激一些帮助。

标签: cmake

解决方案


CMake的v3.17.0-rc1~455^2版本介绍了 Threads::Threadstarget的使用,但并不是find_package(Threads)在所有平台上都使用。要更正此问题,请对位于 C:\Program Files\CMake\share\cmake-3.17\Modules 中的 FindCUDA.cmake 文件进行以下更改

或者,您可以将文件替换为https://github.com/Kitware/CMake/blob/master/Modules/FindCUDA.cmake


推荐阅读