Код: Выделить всё
include(FetchContent)
# Fetch OpenCV
FetchContent_Declare(
opencv
GIT_REPOSITORY https://gitee.com/aiproach/opencv.git
GIT_TAG 4.4.0
)
FetchContent_MakeAvailable(opencv)
set(OpenCV_DIR ${CMAKE_CURRENT_BINARY_DIR})
find_package(OpenCV REQUIRED)
Код: Выделить всё
# Fetch Eigen
FetchContent_Declare(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.3.9
)
FetchContent_MakeAvailable(eigen)
find_package(eigen3 REQUIRED)
Код: Выделить всё
CMake Error at build/_deps/eigen-src/CMakeLists.txt:620 (add_custom_target):
add_custom_target cannot create target "uninstall" because another target
with the same name already exists. The existing target is a custom target
created in source directory
"...../build/_deps/opencv-src".
See documentation for policy CMP0002 for more details.
CMake Error at build/_deps/eigen-build/eigen3Config.cmake:20 (include):
The file
....../build/_deps/eigen-build/Eigen3Targets.cmake
was generated by the export() command. It may not be used as the argument
to the include() command. Use ALIAS targets instead to refer to targets by
alternative names.
Call Stack (most recent call first):
CMakeLists.txt:30 (find_package)
Подробнее здесь: https://stackoverflow.com/questions/703 ... dd-subdire