{"id":16162467,"url":"https://github.com/sunsided/opencv-cmake","last_synced_at":"2025-04-07T03:48:09.720Z","repository":{"id":141992970,"uuid":"67942506","full_name":"sunsided/opencv-cmake","owner":"sunsided","description":"CMake Project for building OpenCV with Contributions","archived":false,"fork":false,"pushed_at":"2017-08-12T14:24:52.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-13T08:27:53.705Z","etag":null,"topics":["cmake","opencv"],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-11T16:59:05.000Z","updated_at":"2022-09-22T02:23:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a4c2015-b885-4f9e-ba3a-88f4bae0b58e","html_url":"https://github.com/sunsided/opencv-cmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fopencv-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/opencv-cmake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589835,"owners_count":20963022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","opencv"],"created_at":"2024-10-10T02:30:14.421Z","updated_at":"2025-04-07T03:48:09.702Z","avatar_url":"https://github.com/sunsided.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCV with Contributions for CMake\n\n## Cloning and initialization\n\nClone the repository in `--recursive` mode to fetch the submodules\n\n```bash\ngit clone --recursive https://github.com/sunsided/opencv-cmake.git\n```\n\nIf you didn't, pull the submodules using\n\n```bash\ngit submodule update --init --recursive\n```\n\n## Custom builds\n\nBuild from the `build` subdirectory. Note that the paths specified are\nconsidered to be examples taken from my setup. Adjust them accordingly to fit your system.\n\nFor Anaconda builds, in order to obtain the correct Python paths, [this page](https://www.scivision.co/anaconda-python-opencv3/) has some nice tricks:\n\n* `CMAKE_INSTALL_PREFIX`: `python3 -c \"import sys; print(sys.prefix)\"`\n* `PYTHON3_EXECUTABLE`: `which python3`\n* `PYTHON3_INCLUDE_DIR`: `python3 -c \"from distutils.sysconfig import get_python_inc; print(get_python_inc())\"`\n* `PYTHON3_PACKAGES_PATH`: `python3 -c \"from distutils.sysconfig import get_python_lib; print(get_python_lib())\"`\n\n### Ubuntu 17.04 + CUDA 8 (GTX 980 Ti)\n\nTargeting Anaconda 4's Python 3.6. For some reason, CMake doesn't detect\nthe include path unless the `PYTHON3_INCLUDE_PATH` variable (note it's `_PATH`,\nnot `_DIR`) is set.\nIt then also seems to expect `PYTHON3_LIBRARIES` (rather than `PYTHON3_LIBRARY`).\n\n```bash\ncmake \\\n    -DCMAKE_BUILD_TYPE=RELEASE \\\n    -DCMAKE_INSTALL_PREFIX=\"/home/markus/anaconda3\" \\\n    -DOPENCV_EXTRA_MODULES_PATH=\"../opencv_contrib/modules\" \\\n    -DBUILD_DOCS=OFF \\\n    -DBUILD_TESTS=OFF \\\n    -DBUILD_EXAMPLES=OFF \\\n    -DBUILD_PERF_TESTS=OFF \\\n    -DBUILD_opencv_dnn=ON \\\n    -DTINYDNN_USE_NNPACK=OFF \\\n    -DTINYDNN_USE_TBB=ON \\\n    -DTINYDNN_USE_OMP=ON \\\n    -DENABLE_FAST_MATH=ON \\\n    -DWITH_OPENMP=ON \\\n    -DWITH_TBB=ON \\\n    -DMKL_WITH_TBB=ON \\\n    -DMKL_WITH_OPENMP=ON \\\n    -DCMAKE_CXX_COMPILER=\"/usr/bin/g++-5\" \\\n    -DCMAKE_C_COMPILER=\"/usr/bin/gcc-5\" \\\n    -DCUDA_HOST_COMPILER=\"/usr/bin/gcc-5\" \\\n    -DCUDA_FAST_MATH=ON \\\n    -DCUDA_ARCH_BIN=\"5.2\" \\\n    -DWITH_CUBLAS=ON \\\n    -DBUILD_opencv_python2=OFF \\\n    -DPYTHON_EXECUTABLE=\"/home/markus/anaconda3/bin/python3\" \\\n    -DPYTHON_LIBRARY=\"/home/markus/anaconda3/lib/libpython3.6m.so\" \\\n    -DPYTHON3_LIBRARY=\"/home/markus/anaconda3/lib/libpython3.6m.so\" \\\n    -DPYTHON3_EXECUTABLE=\"/home/markus/anaconda3/bin/python3\" \\\n    -DPYTHON3_INCLUDE_DIR=\"/home/markus/anaconda3/include/python3.6m\" \\\n    -DPYTHON3_INCLUDE_DIR2=\"/home/markus/anaconda3/include\" \\\n    -DPYTHON3_NUMPY_INCLUDE_DIRS=\"/home/markus/anaconda3/lib/python3.6/site-packages/numpy/core/include\" \\\n    -DPYTHON3_INCLUDE_PATH=\"/home/markus/anaconda3/include/python3.6m\" \\\n    -DPYTHON3_LIBRARIES=\"/home/markus/anaconda3/lib/libpython3.6m.so\" \\\n    -DHDF5_C_LIBRARY_z=\"/home/markus/anaconda3/lib/libz.so\" \\\n    ..\n```\n\nand then \n\n```bash\nmake -j10\nmake install\n```\n\nTargeting system Python version 2.7 and 3.5:\n\n```bash\ncmake \\\n    -DCMAKE_INSTALL_PREFIX=\"/usr/local\" \\\n    -DOPENCV_EXTRA_MODULES_PATH=\"../opencv_contrib/modules\" \\\n    -DBUILD_DOCS=OFF \\\n    -DBUILD_TESTS=OFF \\\n    -DBUILD_EXAMPLES=OFF \\\n    -DBUILD_PERF_TESTS=OFF \\\n    -DBUILD_opencv_dnn=OFF \\\n    -DENABLE_FAST_MATH=ON \\\n    -DWITH_OPENMP=ON \\\n    -DWITH_TBB=ON \\\n    -DMKL_WITH_TBB=ON \\\n    -DMKL_WITH_OPENMP=ON \\\n    -DCMAKE_CXX_COMPILER=\"/usr/bin/g++-5\" \\\n    -DCMAKE_C_COMPILER=\"/usr/bin/gcc-5\" \\\n    -DCUDA_HOST_COMPILER=\"/usr/bin/gcc-5\" \\\n    -DCUDA_FAST_MATH=ON \\\n    -DCUDA_ARCH_BIN=\"5.2\" \\\n    -DWITH_CUBLAS=ON \\\n    ..\n```\n\nand then \n\n```bash\nmake -j10\n(sudo) make install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fopencv-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fopencv-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fopencv-cmake/lists"}