Cmake throws error during generation when building openpose library - cmake

I am very new to cmake and I am using Cmake Gui for compiling the openpose library https://github.com/CMU-Perceptual-Computing-Lab/openpose. When I configure it, it configures successfully but when I click generate, it throws error but still generates compiled files. I am following https://www.youtube.com/watch?v=QC9GTb6Wsb4 this tutorial, but when I try to build the program using visual studio, I get error.
I have installed Visual studio 2017 in windows 10 with Nvidia Geforce 940M.Visual Studio screenshot after build
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
This is the log of cmake when I configure and generate.
Would appreciate some help.

Version v3.17.0-rc1~455^2 of CMake introduced the use of the
Threads::Threads target, but it does not use find_package(Threads) on all
platforms. To correct for this, make the following changes to your FindCUDA.cmake file, located in C:\Program Files\CMake\share\cmake-3.17\Modules
Alternatively, you can replace the file with the one found at https://github.com/Kitware/CMake/blob/master/Modules/FindCUDA.cmake

Related

CMake targets file adds weird suffix to linked libraries

I have a project Foo that links libraries curl, threads and jsoncpp. I build Foo and it generates a FooTargets.cmake targets file, that I can use in my project Bar to link it (with something like find_package(Foo REQUIRED) and then Foo::Foo).
Now this FooTargets.cmake somehow links curl and threads in a weird way:
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:CURL::libcurl::#<0x56344f65d140>>;
\$<LINK_ONLY:Threads::Threads::#<0x56344f65d140>>;\$<LINK_ONLY:JsonCpp::JsonCpp>;
i.e. it adds this weird #<0x56344f65d140>, for some reason.
But then, when configuring project Bar, I get the following errors:
CMake Error at bar/CMakeLists.txt:13 (add_executable):
Target "bar" links to target "CURL::libcurl::#<0x55c57ad49530>"
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 bar/CMakeLists.txt:13 (add_executable):
Target "bar" links to target "Threads::Threads::#<0x55c57ad49530>"
but the target was not found. Perhaps a find_package() call is missing for
an IMPORTED target, or an ALIAS target is missing?
Note that when running the same steps on my CI, it seems to just work. Also if I manually edit FooTargets.cmake and remove the #<0x55c57ad49530>, it works just fine.
Why do they have this #<0x55c57ad49530> appended, where e.g. JsonCpp does not?
This was happening with CMake version 3.16.3. Newer versions of CMake don't seem to have that problem, which explains why the CI was fine.
Ran into the same issue. alternatively I was able to solve it by only having one target_link_libraries (on cmake 3.13). If you ran into the same issue and you are unable to upgrade, try to call target_link_libraries only once for the target.

Error during Relion Installation, Cmake complains about shared library

I am trying to Install relion following the directions at https://github.com/3dem/relion.
I am getting the following error since some of the libraries will be shared. I am not sure how to address this issue.
WARNING: Target "particle_FCC" requests linking to directory "/home/../eman2-sphire-sparx/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "particle_FCC" requests linking to directory "/home/../eman2-sphire-sparx/lib". Targets may link only to libraries. CMake is dropping the item.
CMake Warning at src/apps/CMakeLists.txt:208 (add_executable):
Cannot generate a safe runtime search path for target particle_FCC because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libfftw3f.so.3] in /usr/lib64 may be hidden by files in:
/home/../eman2-sphire-sparx/lib
runtime library [libfftw3.so.3] in /usr/lib64 may be hidden by files in:
/home/../eman2-sphire-sparx/lib
runtime library [libpng16.so.16] in /usr/lib64 may be hidden by files in:
/home/../eman2-sphire-sparx/lib

Targets conflict when using CMake FetchContent

On a CMake project, I am using FetchContent to get two dependencies. Both of them define the same target (in this case doc), resulting in an error at configuration step:
CMake Error at thirdparty/penf/doc/CMakeLists.txt:7 (add_custom_target):
add_custom_target cannot create target "doc" because another target with
the same name already exists. The existing target is a custom target
created in source directory
"/home/me/project/thirdparty/flogging/doc". See
documentation for policy CMP0002 for more details.
How can I avoid this targets conflict?

Cannot generate a safe runtime search path for target caffe because files in some directories may conflict with libraries in implicit directories

I am trying to install this code https://github.com/NVlabs/ssn_superpixels but get an error at the cmake .. step
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_LIBRARY (ADVANCED)
linked by target "caffe" in directory /home/haziq/ASTAR/scripts/ssn_superpixels/lib/video_prop_networks/lib/caffe/src/caffe
So I deleted the build folder, recreated it and cd into it and ran cmake .. -DCUDA_cublas_LIBRARY=/usr/lib/x86_64-linux-gnu/libcublas.so.9.1 but now get the following messages.
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe runtime search path for target caffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at src/caffe/test/CMakeLists.txt:29 (add_executable):
Cannot generate a safe runtime search path for target test.testbin because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target extract_features
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target device_query because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target convert_imageset
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target test_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target net_speed_benchmark
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target compute_image_mean
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target train_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target finetune_net because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_net_proto_binary because files in some directories may conflict
with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_net_proto_text because files in some directories may conflict with
libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target
upgrade_solver_proto_text because files in some directories may conflict
with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at tools/CMakeLists.txt:14 (add_executable):
Cannot generate a safe runtime search path for target caffe.bin because
files in some directories may conflict with libraries in implicit
directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
CMake Warning at python/CMakeLists.txt:9 (add_library):
Cannot generate a safe runtime search path for target pycaffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
I found a post here CMake cannot resolve runtime directory path that provides a solution for find_library and find_package but mine is add_library. Anyway I tried fixing the first CMake warning
CMake Warning at src/caffe/CMakeLists.txt:20 (add_library):
Cannot generate a safe runtime search path for target caffe because files
in some directories may conflict with libraries in implicit directories:
runtime library [libsnappy.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/home/haziq/anaconda3/envs/ssn/lib
Some of these libraries may not be found correctly.
by editing line 20 of src/caffe/CMakeLists.txt by replacing add_library(caffe ${srcs}) with add_library(caffe ${srcs} NO_DEFAULT_PATH) but now get this message.
CMake Error at src/caffe/CMakeLists.txt:20 (add_library):
Cannot find source file:
NO_DEFAULT_PATH
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
What can I try next?
install libcublas 10 then run again

CONAN_PKG::<PKG-NAME> not found when using cmake to generate build target

CONAN_PKG::spdlog is not found when using CMake to generate build configurations.
The conan package I use is spdlog/1.3.1#bincrafters/stable.
I have a CMake executable target which references a conan package spdlog. I am getting this error message:
[build] CMake Error at src/apps/ResultObserver/CMakeLists.txt:10 (ADD_EXECUTABLE):
[build] Target "ResultObserver" links to target "CONAN_PKG::spdlog" but the target
[build] was not found. Perhaps a find_package() call is missing for an IMPORTED
[build] target, or an ALIAS target is missing?
I have these lines in my CMakeLists.txt.
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
ADD_EXECUTABLE(ResultObserver src/ResultObserver.cpp)
TARGET_LINK_LIBRARIES(ResultObserver CONAN_PKG::spdlog)
Also, after installing the conan package, the conanbuildinfo.cmake file is generated in the build directory.
I checked inside the file. It contains these lines.
add_library(CONAN_PKG::spdlog INTERFACE IMPORTED)
# Property INTERFACE_LINK_FLAGS do not work, necessary to add to INTERFACE_LINK_LIBRARIES
set_property(TARGET CONAN_PKG::spdlog PROPERTY INTERFACE_LINK_LIBRARIES .........
Anyone know the reason?
You are looking for the TARGETS approach. You need to pass TARGETS to conan_basic_setup() to generate CONAN_PKG::. Otherwise, only ${CONAN_LIBS} will be available.
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
ADD_EXECUTABLE(ResultObserver src/ResultObserver.cpp)
TARGET_LINK_LIBRARIES(ResultObserver CONAN_PKG::spdlog)
More info about the CMake target generator is here:
https://docs.conan.io/en/latest/integrations/build_system/cmake/cmake_generator.html#targets-approach