Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An CMakeLists template of opencv+mingw project = =
cmake_minimum_required(VERSION 2.6)
PROJECT("project_name")
INCLUDE_DIRECTORIES("$ENV{opencv}/build/include" "$ENV{opencv}/build/include/opencv")
LINK_DIRECTORIES("$ENV{opencv}/build/mingw/lib")
ADD_DEFINITIONS(-DHAVE_LRINT -DHAVE_LRINTF)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
SET(CMAKE_BUILD_TYPE Debug)
SET(SOURCES your_source.cpp)
ADD_EXECUTABLE (${PROJECT_NAME} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} opencv_highgui242 opencv_objdetect242 opencv_imgproc242 opencv_core242)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.