Skip to content

Instantly share code, notes, and snippets.

@zolunx10
Created December 2, 2012 02:47
Show Gist options
  • Save zolunx10/4186692 to your computer and use it in GitHub Desktop.
Save zolunx10/4186692 to your computer and use it in GitHub Desktop.
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