Commit 33e71127 authored by Alexander Shishkov's avatar Alexander Shishkov

fixed problem with VideoInput on Windows when OpenCV compiled statically (ticket #573)

parent dce5bf49
...@@ -139,6 +139,12 @@ else() ...@@ -139,6 +139,12 @@ else()
set(OPENCV_SVNVERSION "") set(OPENCV_SVNVERSION "")
endif() endif()
# ----------------------------------------------------------------------------
# Detect Microsoft compiler:
# ----------------------------------------------------------------------------
if(CMAKE_CL_64)
set(MSVC64 1)
endif()
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Detect GNU version: # Detect GNU version:
...@@ -805,6 +811,17 @@ if(WIN32) ...@@ -805,6 +811,17 @@ if(WIN32)
if (MSVC) if (MSVC)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} vfw32) set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} vfw32)
if (NOT BUILD_SHARED_LIBS)
if (MSVC64)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${CMAKE_SOURCE_DIR}/3rdparty/lib/videoInput64.lib strmiids)
endif()
elseif (MSVC)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${CMAKE_SOURCE_DIR}/3rdparty/lib/videoInput.lib strmiids)
endif()
endif()
endif()
endif() endif()
if(MINGW) if(MINGW)
......
...@@ -60,6 +60,10 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; pri ...@@ -60,6 +60,10 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; pri
set_target_properties(${cv_target} PROPERTIES SUFFIX ${CVPY_SUFFIX}) set_target_properties(${cv_target} PROPERTIES SUFFIX ${CVPY_SUFFIX})
if (MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${cv_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
set(cvpymodules ${cv_target}) set(cvpymodules ${cv_target})
if(PYTHON_USE_NUMPY) if(PYTHON_USE_NUMPY)
......
...@@ -43,8 +43,10 @@ if (BUILD_EXAMPLES) ...@@ -43,8 +43,10 @@ if (BUILD_EXAMPLES)
if(ENABLE_SOLUTION_FOLDERS) if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "samples//c") set_target_properties(${the_target} PROPERTIES FOLDER "samples//c")
endif() endif()
if(WIN32) if(WIN32)
if (MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
install(TARGETS ${the_target} install(TARGETS ${the_target}
RUNTIME DESTINATION "samples/c" COMPONENT main) RUNTIME DESTINATION "samples/c" COMPONENT main)
endif() endif()
......
...@@ -45,6 +45,9 @@ if (BUILD_EXAMPLES) ...@@ -45,6 +45,9 @@ if (BUILD_EXAMPLES)
endif() endif()
if(WIN32) if(WIN32)
if (MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
install(TARGETS ${the_target} install(TARGETS ${the_target}
RUNTIME DESTINATION "samples/cpp" COMPONENT main) RUNTIME DESTINATION "samples/cpp" COMPONENT main)
endif() endif()
......
...@@ -47,6 +47,9 @@ if (BUILD_EXAMPLES) ...@@ -47,6 +47,9 @@ if (BUILD_EXAMPLES)
endif() endif()
if(WIN32) if(WIN32)
if (MSVC AND NOT BUILD_SHARED_LIBS)
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
endif()
install(TARGETS ${the_target} install(TARGETS ${the_target}
RUNTIME DESTINATION "samples/gpu" COMPONENT main) RUNTIME DESTINATION "samples/gpu" COMPONENT main)
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment