Created
December 21, 2020 13:59
-
-
Save olshevski/58ec208f2d4bc47275d6b22570373bc9 to your computer and use it in GitHub Desktop.
add OpenCV to a project using CMake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.6) | |
# opencv | |
set(OpenCV_DIR ${CMAKE_CURRENT_SOURCE_DIR}/opencv-4.5.0/sdk/native/jni) | |
find_package(OpenCV REQUIRED core imgproc) # specify desired OpenCV modules here | |
# mylibname | |
add_library(mylibname SHARED nativeutils.cpp) | |
target_include_directories(mylibname PRIVATE | |
${OpenCV_INCLUDE_DIRS}) | |
target_link_libraries(mylibname android log jnigraphics ${OpenCV_LIBS}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment