はじめに
エラーへの対処なのですが,エラー文に出力されたコマンドを実行しただけなので,役に立たないかもしれませんが,書いておきます.
cmakeのエラー内容
cmake
実行時のエラー部抜粋が以下.
error
CMake Error at CMakeLists.txt:8 (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.
とりあえず$ brew install opencv
とすると良いでしょう(OpenCVのバージョンを気にする方は気をつけてください).
すでにインストールされている場合は,
error
pass/to/build $ brew install opencv
Warning: opencv 4.1.0_2 is already installed, it's just not linked
You can use `brew link opencv` to link this version.
と出力されます.言われた通りに$ brew link opencv
と実行します.
error
pass/to/build $ brew link opencv
Linking /usr/local/Cellar/opencv/4.1.0_2...
Error: Could not symlink lib/python3.7/site-packages/cv2/__init__.py
Target /usr/local/lib/python3.7/site-packages/cv2/__init__.py
already exists. You may want to remove it:
rm '/usr/local/lib/python3.7/site-packages/cv2/__init__.py'
To force the link and overwrite all conflicting files:
brew link --overwrite opencv
To list all files that would be deleted:
brew link --overwrite --dry-run opencv
失敗しました.言われるがままに,
succes
pass/to/build $ brew link --overwrite opencv
Linking /usr/local/Cellar/opencv/4.1.0_2... 227 symlinks created
以上で,cmake
ができるようになりました.
おわりに
エラーで言われた通りにしたので微妙な情報ですが,誰かの役に立てばと思います.