一、问题描述:
joes@joes:~/Downloads/pangolin-master/build$ cmake ..
CMake Warning at CMakeLists.txt:75 (message):
Building Tests requested, but Catch2 library not found.
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- libtiff Found and Enabled
-- libopenexr Found and Enabled
-- liblz4 Found and Enabled
-- libdc1394 Found and Enabled
-- V4L Found and Enabled
-- ffmpeg Found and Enabled
-- OpenNI Found and Enabled
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args`
(WAYLAND_CLIENT) does not match the name of the calling package (Wayland).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/FindWayland.cmake:52 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
components/pango_windowing/CMakeLists.txt:35 (find_package)
CMakeLists.txt:93 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args`
(WAYLAND_SERVER) does not match the name of the calling package (Wayland).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/FindWayland.cmake:53 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
components/pango_windowing/CMakeLists.txt:35 (find_package)
CMakeLists.txt:93 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args`
(WAYLAND_EGL) does not match the name of the calling package (Wayland).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/FindWayland.cmake:54 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
components/pango_windowing/CMakeLists.txt:35 (find_package)
CMakeLists.txt:93 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args`
(WAYLAND_CURSOR) does not match the name of the calling package (Wayland).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/FindWayland.cmake:55 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
components/pango_windowing/CMakeLists.txt:35 (find_package)
CMakeLists.txt:93 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args` (WAYLAND)
does not match the name of the calling package (Wayland). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/FindWayland.cmake:56 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
components/pango_windowing/CMakeLists.txt:35 (find_package)
CMakeLists.txt:93 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
CMake Error at CMakeLists.txt:88 (add_library):
Target "pango_windowing" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_tools" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_glgeometry" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_glgeometry" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_geometry" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_display" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_opengl" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_plot" links to target "Eigen3::Eigen" 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 CMakeLists.txt:88 (add_library):
Target "pango_scene" links to target "Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_2_gl_intro_classic_triangle_vbo" links to target
"Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_1_gl_intro_pango_triangle" links to target "Eigen3::Eigen"
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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_2_gl_intro_pango_triangle_vbo" links to target
"Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_1_gl_intro_classic_triangle" links to target
"Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_3_gl_intro_classic_triangle_vbo_shader" links to target
"Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_3_gl_intro_pango_triangle_vbo_shader" links to target
"Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_4_gl_intro_viewport" links to target "Eigen3::Eigen" 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/BasicOpenGL/CMakeLists.txt:19 (add_executable):
Target "tutorial_5_gl_intro_view_transforms" links to target
"Eigen3::Eigen" 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/HelloPangolin/CMakeLists.txt:5 (add_executable):
Target "HelloPangolin" links to target "Eigen3::Eigen" 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/SimpleDisplay/CMakeLists.txt:5 (add_executable):
Target "SimpleDisplay" links to target "Eigen3::Eigen" 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/SimpleMultiDisplay/CMakeLists.txt:5 (add_executable):
Target "SimpleMultiDisplay" links to target "Eigen3::Eigen" 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/SimpleDisplayImage/CMakeLists.txt:5 (add_executable):
Target "SimpleDisplayImage" links to target "Eigen3::Eigen" 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/SimplePlot/CMakeLists.txt:5 (add_executable):
Target "SimplePlot" links to target "Eigen3::Eigen" 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/SimpleVideo/CMakeLists.txt:5 (add_executable):
Target "SimpleVideo" links to target "Eigen3::Eigen" 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/SimpleRecord/CMakeLists.txt:5 (add_executable):
Target "SimpleRecord" links to target "Eigen3::Eigen" 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/HelloPangolinOffscreen/CMakeLists.txt:5 (add_executable):
Target "HelloPangolinOffscreen" links to target "Eigen3::Eigen" 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/SimpleScene/CMakeLists.txt:5 (add_executable):
Target "SimpleScene" links to target "Eigen3::Eigen" 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 tools/VideoViewer/CMakeLists.txt:5 (add_executable):
Target "VideoViewer" links to target "Eigen3::Eigen" 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 tools/VideoViewer/CMakeLists.txt:5 (add_executable):
Target "VideoViewer" links to target "Eigen3::Eigen" 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 tools/VideoConvert/CMakeLists.txt:5 (add_executable):
Target "VideoConvert" links to target "Eigen3::Eigen" 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 tools/VideoConvert/CMakeLists.txt:5 (add_executable):
Target "VideoConvert" links to target "Eigen3::Eigen" 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 tools/VideoJson/CMakeLists.txt:5 (add_executable):
Target "VideoJsonPrint" links to target "Eigen3::Eigen" 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 tools/VideoJson/CMakeLists.txt:5 (add_executable):
Target "VideoJsonPrint" links to target "Eigen3::Eigen" 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 tools/VideoJson/CMakeLists.txt:8 (add_executable):
Target "VideoJsonTransform" links to target "Eigen3::Eigen" 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 tools/VideoJson/CMakeLists.txt:8 (add_executable):
Target "VideoJsonTransform" links to target "Eigen3::Eigen" 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 tools/Plotter/CMakeLists.txt:5 (add_executable):
Target "Plotter" links to target "Eigen3::Eigen" 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 tools/Plotter/CMakeLists.txt:5 (add_executable):
Target "Plotter" links to target "Eigen3::Eigen" 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 tools/ModelViewer/CMakeLists.txt:5 (add_executable):
Target "ModelViewer" links to target "Eigen3::Eigen" 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 tools/ModelViewer/CMakeLists.txt:5 (add_executable):
Target "ModelViewer" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
二、解决方法:
get_filename_component(COMPONENT ${CMAKE_CURRENT_LIST_DIR} NAME)
find_package (Eigen3 REQUIRED CONFIG QUIET)
target_compile_definitions(${COMPONENT} PUBLIC HAVE_EIGEN)
target_sources( ${COMPONENT}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/geometry.cpp
${CMAKE_CURRENT_LIST_DIR}/src/geometry_obj.cpp
${CMAKE_CURRENT_LIST_DIR}/src/geometry_ply.cpp
)
target_link_libraries(${COMPONENT} pango_core pango_image tinyobj ${Eigen3_LIBRARY})
target_include_directories(${COMPONENT} PUBLIC
$
$
)
install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include"
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
将
target_link_libraries(${COMPONENT} pango_core pango_image tinyobj Eigen3::Eigin)
改为:
target_link_libraries(${COMPONENT} pango_core pango_image tinyobj ${Eigen3_LIBRARY})