Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 4833) +++ CMakeLists.txt (working copy) @@ -11,7 +11,6 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) - # Add these standard paths to the search paths for FIND_LIBRARY # to find libraries from these locations first if(UNIX) @@ -54,6 +53,7 @@ cmake_minimum_required(VERSION 2.4) +include (CMakeStaticRuntimeOption.cmake REQUIRED) if(MSVC) set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE) Index: modules/haartraining/CMakeLists.txt =================================================================== --- modules/haartraining/CMakeLists.txt (revision 4833) +++ modules/haartraining/CMakeLists.txt (working copy) @@ -15,7 +15,7 @@ ) if(WIN32) - link_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/bin ${CMAKE_CURRENT_BINARY_DIR}) + link_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/bin ${CMAKE_SOURCE_DIR}/3rdparty/lib ${CMAKE_CURRENT_BINARY_DIR}) endif() set(haartraining_libs opencv_core opencv_imgproc opencv_highgui opencv_objdetect opencv_calib3d opencv_haartraining_engine) Index: modules/traincascade/CMakeLists.txt =================================================================== --- modules/traincascade/CMakeLists.txt (revision 4833) +++ modules/traincascade/CMakeLists.txt (working copy) @@ -14,6 +14,10 @@ "${CMAKE_SOURCE_DIR}/modules/legacy/include" ) +if(WIN32) + link_directories(${CMAKE_SOURCE_DIR}/3rdparty/lib) +endif() + set(traincascade_libs opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_haartraining_engine)