cmake_minimum_required(VERSION 3.29)
project(opencv_app)
# Enable C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Enable vcpkg manifest mode
if(DEFINED ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
# Set a suitable triplet for Linux (adjust if using a different architecture)
set(VCPKG_TARGET_TRIPLET "x64-linux" CACHE STRING "")
endif()
message(STATUS "Using vcpkg toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
message(STATUS "Using vcpkg triplet: ${VCPKG_TARGET_TRIPLET}")
# Add executable
add_executable(opencv_app main.cpp)
# Find OpenCV package via vcpkg
find_package(OpenCV REQUIRED)
target_link_libraries(opencv_app PRIVATE ${OpenCV_LIBS})
target_include_directories(opencv_app PRIVATE ${OpenCV_INCLUDE_DIRS})
< /code>
и vcpkg.json: < /p>
{
"name": "opencv_app",
"version": "0.1.0",
"dependencies": [
{
"name": "opencv",
"default-features": false,
"features": [ "jpeg" ]
}
]
}
< /code>
И я пытаюсь построить ее, используя эту команду: < /p>
cmake -B build -S .
< /code>
Но я получаю эту ошибку: < /p>
cmake -B build -S .
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using vcpkg toolchain file: /media/r/Data/locals/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Using vcpkg triplet: x64-linux
CMake Error at CMakeLists.txt:24 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
У меня есть эти файлы, которые пытаются создать простое приложение с OpenCV в Linux: < /p> [code]cmake_minimum_required(VERSION 3.29) project(opencv_app)
# Find OpenCV package via vcpkg find_package(OpenCV REQUIRED) target_link_libraries(opencv_app PRIVATE ${OpenCV_LIBS}) target_include_directories(opencv_app PRIVATE ${OpenCV_INCLUDE_DIRS}) < /code> и vcpkg.json: < /p> { "name": "opencv_app", "version": "0.1.0", "dependencies": [ { "name": "opencv", "default-features": false, "features": [ "jpeg" ] } ] } < /code> И я пытаюсь построить ее, используя эту команду: < /p> cmake -B build -S . < /code> Но я получаю эту ошибку: < /p> cmake -B build -S . -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using vcpkg toolchain file: /media/r/Data/locals/vcpkg/scripts/buildsystems/vcpkg.cmake -- Using vcpkg triplet: x64-linux CMake Error at CMakeLists.txt:24 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any of the following names:
OpenCVConfig.cmake opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred! [/code] В чем проблема и как ее исправить?>
Мой пакет Swift имеет внешние зависимости, которые определены в файле JSON dependency.json, и он находится в том же каталоге, что и файл package.swift,
Теперь в package.swift я хочу прочитать файл, проанализировать его и добавить...