Created
May 21, 2015 15:36
-
-
Save optimalistel/f4de869ec59764bd65be to your computer and use it in GitHub Desktop.
CMake Include OpenCV - Win32
This file contains hidden or 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
#-------------------------------------------------------------------- | |
# Include OpenCV library and copy the dlls on Windows | |
#-------------------------------------------------------------------- | |
set(OpenCV_STATIC OFF) | |
find_package( OpenCV REQUIRED ) | |
include_directories( ${OpenCV_INCLUDE_DIRS} ) | |
target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS} ) | |
if(NOT OpenCV_STATIC) | |
if(WIN32) | |
if(MSVC AND OpenCV_RUNTIME AND OpenCV_ARCH) | |
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/bin") | |
file(GLOB OPENCV_DLL_FILES ${OpenCV_LIB_PATH}/*.*dll) | |
file(COPY ${OPENCV_DLL_FILES} DESTINATION ${CMAKE_BINARY_DIR}) | |
else() | |
message(STATUS "Failed to find OpenCV binary folder. Please copy the dll files manually!") | |
endif() | |
endif() | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment