2012-02-03 19:26:49 +08:00
|
|
|
set(the_description "High-level GUI and Media I/O")
|
|
|
|
ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_androidcamera)
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for highgui. See root CMakeLists.txt
|
|
|
|
# Some parts taken from version of Hartmut Seichter, HIT Lab NZ.
|
|
|
|
# Jose Luis Blanco, 2008
|
|
|
|
# ----------------------------------------------------------------------------
|
2012-01-25 00:55:47 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
ocv_clear_vars(GRFMT_LIBS)
|
2011-04-26 23:46:15 +08:00
|
|
|
|
Update cap_msmf.cpp
Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.
Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.
My discussion and proposal to finish this change:
Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.
ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.
The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.
It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.
Update cap_msmf.cpp
Fixed bugs and completed the change. I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction). Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it). Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled). After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft. This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration. Better to document that it is not supported.
Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.
The remaining changes are not difficult and will be complete soon along with debug tracing messages.
Update cap_msmf.cpp
Create cap_msmf.h
Update cap_msmf.cpp
Update cap_msmf.h
Update cap_msmf.cpp
Update cap_msmf.h
Update and rename cap_msmf.h to cap_msmf.hpp
Update cap_msmf.cpp
Update CMakeLists.txt
Update cap_msmf.hpp
Update cap_msmf.cpp
Update cap_msmf.cpp
Update cap_msmf.cpp
Update cap_msmf.hpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Successful test - samples are grabbed
Update cap_msmf.cpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Update cap_msmf.hpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Update cap_msmf.hpp
Create ppltasks_winrt.h
Update cap_msmf.hpp
Update cap_msmf.hpp
Update cap_msmf.cpp
Update ppltasks_winrt.h
Library updated and cleaned up with comments, marshaling, exceptions and linker settings
Update ppltasks_winrt.h
Fixed trailing whitespace
2013-12-14 16:53:30 +08:00
|
|
|
if(HAVE_WINRT_CX)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
|
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR)
|
2013-08-22 22:04:50 +08:00
|
|
|
ocv_include_directories(${ZLIB_INCLUDE_DIRS})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${ZLIB_LIBRARIES})
|
2011-04-26 23:46:15 +08:00
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_JPEG)
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories(${JPEG_INCLUDE_DIR})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${JPEG_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2013-03-07 23:29:19 +08:00
|
|
|
if(WITH_WEBP)
|
|
|
|
add_definitions(-DHAVE_WEBP)
|
|
|
|
ocv_include_directories(${WEBP_INCLUDE_DIR})
|
|
|
|
list(APPEND GRFMT_LIBS ${WEBP_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_PNG)
|
2012-02-24 21:53:22 +08:00
|
|
|
add_definitions(${PNG_DEFINITIONS})
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories(${PNG_INCLUDE_DIR})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${PNG_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_TIFF)
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories(${TIFF_INCLUDE_DIR})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${TIFF_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_JASPER)
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories(${JASPER_INCLUDE_DIR})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${JASPER_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2013-07-11 16:40:16 +08:00
|
|
|
if(HAVE_OPENEXR)
|
2012-08-25 04:31:49 +08:00
|
|
|
include_directories(SYSTEM ${OPENEXR_INCLUDE_PATHS})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND GRFMT_LIBS ${OPENEXR_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB grfmt_hdrs src/grfmt*.hpp)
|
|
|
|
file(GLOB grfmt_srcs src/grfmt*.cpp)
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND grfmt_hdrs src/bitstrm.hpp)
|
|
|
|
list(APPEND grfmt_srcs src/bitstrm.cpp)
|
2013-06-23 18:19:09 +08:00
|
|
|
list(APPEND grfmt_hdrs src/rgbe.hpp)
|
|
|
|
list(APPEND grfmt_srcs src/rgbe.cpp)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
|
|
|
source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs})
|
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
set(highgui_hdrs
|
|
|
|
src/precomp.hpp
|
|
|
|
src/utils.hpp
|
|
|
|
src/cap_ffmpeg_impl.hpp
|
|
|
|
)
|
2012-04-14 05:50:59 +08:00
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
set(highgui_srcs
|
|
|
|
src/cap.cpp
|
|
|
|
src/cap_images.cpp
|
2011-07-05 00:18:12 +08:00
|
|
|
src/cap_ffmpeg.cpp
|
2010-05-12 01:44:00 +08:00
|
|
|
src/loadsave.cpp
|
|
|
|
src/utils.cpp
|
|
|
|
src/window.cpp
|
|
|
|
)
|
2012-03-13 01:07:54 +08:00
|
|
|
|
2013-03-13 20:22:44 +08:00
|
|
|
file(GLOB highgui_ext_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2013-04-18 02:02:01 +08:00
|
|
|
if(HAVE_QT5)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
QT5_ADD_RESOURCES(_RCC_OUTFILES src/window_QT.qrc)
|
|
|
|
list(APPEND highgui_srcs src/window_QT.cpp src/window_QT.h ${_RCC_OUTFILES})
|
|
|
|
|
|
|
|
foreach(dt5_dep Core Gui Widgets Test Concurrent)
|
|
|
|
add_definitions(${Qt5${dt5_dep}_DEFINITIONS})
|
|
|
|
include_directories(${Qt5${dt5_dep}_INCLUDE_DIRS})
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${Qt5${dt5_dep}_LIBRARIES})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(HAVE_QT_OPENGL)
|
|
|
|
add_definitions(${Qt5OpenGL_DEFINITIONS})
|
|
|
|
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${Qt5OpenGL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
elseif(HAVE_QT)
|
2012-04-14 05:50:59 +08:00
|
|
|
if (HAVE_QT_OPENGL)
|
|
|
|
set(QT_USE_QTOPENGL TRUE)
|
|
|
|
endif()
|
2012-05-21 02:49:57 +08:00
|
|
|
include(${QT_USE_FILE})
|
2012-04-14 05:50:59 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
QT4_ADD_RESOURCES(_RCC_OUTFILES src/window_QT.qrc)
|
|
|
|
QT4_WRAP_CPP(_MOC_OUTFILES src/window_QT.h)
|
2012-04-14 05:50:59 +08:00
|
|
|
|
2013-06-06 18:09:33 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${QT_LIBRARIES})
|
2012-06-27 05:05:15 +08:00
|
|
|
list(APPEND highgui_srcs src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES})
|
|
|
|
ocv_check_flag_support(CXX -Wno-missing-declarations _have_flag)
|
|
|
|
if(${_have_flag})
|
2012-06-13 19:49:27 +08:00
|
|
|
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
|
2012-06-08 01:21:29 +08:00
|
|
|
endif()
|
2013-03-27 23:03:51 +08:00
|
|
|
elseif(HAVE_WIN32UI)
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND highgui_srcs src/window_w32.cpp)
|
|
|
|
elseif(HAVE_GTK)
|
|
|
|
list(APPEND highgui_srcs src/window_gtk.cpp)
|
2013-07-10 22:20:34 +08:00
|
|
|
elseif(HAVE_CARBON)
|
|
|
|
list(APPEND highgui_srcs src/window_carbon.cpp)
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime")
|
|
|
|
elseif(HAVE_COCOA)
|
|
|
|
list(APPEND highgui_srcs src/window_cocoa.mm)
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework Cocoa")
|
2010-07-12 23:29:31 +08:00
|
|
|
endif()
|
2012-05-25 04:10:13 +08:00
|
|
|
|
2013-03-27 08:19:52 +08:00
|
|
|
if(WIN32 AND NOT ARM)
|
2013-04-03 09:01:20 +08:00
|
|
|
list(APPEND highgui_srcs src/cap_cmu.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_DSHOW)
|
|
|
|
list(APPEND highgui_srcs src/cap_dshow.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_MSMF)
|
|
|
|
list(APPEND highgui_srcs src/cap_msmf.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32 AND HAVE_VFW)
|
|
|
|
list(APPEND highgui_srcs src/cap_vfw.cpp)
|
2013-03-27 08:19:52 +08:00
|
|
|
endif()
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_XINE)
|
|
|
|
list(APPEND highgui_srcs src/cap_xine.cpp)
|
|
|
|
endif(HAVE_XINE)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_DC1394_2)
|
|
|
|
list(APPEND highgui_srcs src/cap_dc1394_v2.cpp)
|
|
|
|
endif(HAVE_DC1394_2)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_DC1394)
|
|
|
|
list(APPEND highgui_srcs src/cap_dc1394.cpp)
|
|
|
|
endif(HAVE_DC1394)
|
2012-04-14 05:50:59 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_GSTREAMER)
|
|
|
|
list(APPEND highgui_srcs src/cap_gstreamer.cpp)
|
|
|
|
endif(HAVE_GSTREAMER)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_UNICAP)
|
|
|
|
list(APPEND highgui_srcs src/cap_unicap.cpp)
|
|
|
|
endif(HAVE_UNICAP)
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_LIBV4L)
|
|
|
|
list(APPEND highgui_srcs src/cap_libv4l.cpp)
|
2012-09-17 17:08:37 +08:00
|
|
|
elseif(HAVE_CAMV4L OR HAVE_CAMV4L2 OR HAVE_VIDEOIO)
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND highgui_srcs src/cap_v4l.cpp)
|
2010-05-12 01:44:00 +08:00
|
|
|
endif()
|
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_OPENNI)
|
|
|
|
list(APPEND highgui_srcs src/cap_openni.cpp)
|
2012-06-09 23:00:04 +08:00
|
|
|
ocv_include_directories(${OPENNI_INCLUDE_DIR})
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${OPENNI_LIBRARY})
|
|
|
|
endif(HAVE_OPENNI)
|
2011-08-23 19:19:58 +08:00
|
|
|
|
2012-02-10 04:22:36 +08:00
|
|
|
if(HAVE_opencv_androidcamera)
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND highgui_srcs src/cap_android.cpp)
|
2012-02-03 19:26:49 +08:00
|
|
|
add_definitions(-DHAVE_ANDROID_NATIVE_CAMERA)#TODO: remove this line
|
2012-05-21 02:49:57 +08:00
|
|
|
endif(HAVE_opencv_androidcamera)
|
2011-04-06 22:31:03 +08:00
|
|
|
|
2012-05-21 02:49:57 +08:00
|
|
|
if(HAVE_XIMEA)
|
|
|
|
list(APPEND highgui_srcs src/cap_ximea.cpp)
|
2012-03-03 23:49:23 +08:00
|
|
|
ocv_include_directories(${XIMEA_PATH})
|
2012-06-26 19:48:58 +08:00
|
|
|
if(XIMEA_LIBRARY_DIR)
|
2013-11-11 00:46:59 +08:00
|
|
|
link_directories("${XIMEA_LIBRARY_DIR}")
|
2012-06-26 19:48:58 +08:00
|
|
|
endif()
|
2013-11-11 00:46:59 +08:00
|
|
|
if(X86_64)
|
2013-06-12 01:17:31 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES m3apiX64)
|
|
|
|
else()
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES m3api)
|
|
|
|
endif()
|
2012-05-21 02:49:57 +08:00
|
|
|
endif(HAVE_XIMEA)
|
|
|
|
|
|
|
|
if(HAVE_FFMPEG)
|
|
|
|
if(UNIX AND BZIP2_LIBRARIES)
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${BZIP2_LIBRARIES})
|
2012-05-21 22:56:07 +08:00
|
|
|
endif()
|
|
|
|
if(APPLE)
|
2012-06-29 03:45:13 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework VideoDecodeAcceleration" bz2)
|
2012-05-21 02:49:57 +08:00
|
|
|
endif()
|
|
|
|
endif(HAVE_FFMPEG)
|
|
|
|
|
|
|
|
if(HAVE_PVAPI)
|
|
|
|
add_definitions(-DHAVE_PVAPI)
|
2013-07-20 21:03:30 +08:00
|
|
|
add_definitions(${PVAPI_DEFINITIONS})
|
2012-05-21 02:49:57 +08:00
|
|
|
ocv_include_directories(${PVAPI_INCLUDE_PATH})
|
|
|
|
set(highgui_srcs src/cap_pvapi.cpp ${highgui_srcs})
|
2012-05-25 04:10:13 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${PVAPI_LIBRARY})
|
2012-05-21 02:49:57 +08:00
|
|
|
endif()
|
|
|
|
|
2013-02-01 20:40:02 +08:00
|
|
|
if(HAVE_GIGE_API)
|
|
|
|
add_definitions(-DHAVE_GIGE_API)
|
|
|
|
ocv_include_directories(${GIGEAPI_INCLUDE_PATH})
|
|
|
|
set(highgui_srcs src/cap_giganetix.cpp ${highgui_srcs})
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${GIGEAPI_LIBRARIES})
|
|
|
|
list(APPEND highgui_srcs src/cap_giganetix.cpp)
|
|
|
|
endif(HAVE_GIGE_API)
|
|
|
|
|
2013-07-10 22:20:34 +08:00
|
|
|
if(HAVE_AVFOUNDATION)
|
2012-05-21 02:49:57 +08:00
|
|
|
list(APPEND highgui_srcs src/cap_avfoundation.mm)
|
2012-05-21 03:05:36 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
|
2013-07-10 22:20:34 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_QUICKTIME)
|
|
|
|
list(APPEND highgui_srcs src/cap_qt.cpp)
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime" "-framework CoreFoundation" "-framework QuartzCore")
|
2013-08-14 19:33:47 +08:00
|
|
|
elseif(HAVE_QTKIT)
|
2013-07-10 22:20:34 +08:00
|
|
|
list(APPEND highgui_srcs src/cap_qtkit.mm)
|
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework QTKit" "-framework QuartzCore" "-framework AppKit")
|
2012-01-25 17:04:49 +08:00
|
|
|
endif()
|
|
|
|
|
2013-12-13 21:25:16 +08:00
|
|
|
if(HAVE_INTELPERC)
|
|
|
|
list(APPEND highgui_srcs src/cap_intelperc.cpp)
|
|
|
|
ocv_include_directories(${INTELPERC_INCLUDE_DIR})
|
2013-12-17 20:13:55 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES ${INTELPERC_LIBRARIES})
|
2013-12-13 21:25:16 +08:00
|
|
|
endif(HAVE_INTELPERC)
|
|
|
|
|
2012-08-20 23:36:36 +08:00
|
|
|
if(IOS)
|
|
|
|
add_definitions(-DHAVE_IOS=1)
|
2013-06-28 17:26:54 +08:00
|
|
|
list(APPEND highgui_srcs src/ios_conversions.mm src/cap_ios_abstract_camera.mm src/cap_ios_photo_camera.mm src/cap_ios_video_camera.mm)
|
2012-08-20 23:36:36 +08:00
|
|
|
list(APPEND HIGHGUI_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary")
|
|
|
|
endif()
|
|
|
|
|
2012-02-17 04:29:35 +08:00
|
|
|
if(WIN32)
|
2012-05-21 02:49:57 +08:00
|
|
|
link_directories("${OpenCV_SOURCE_DIR}/3rdparty/lib") # for ffmpeg wrapper only
|
2012-06-08 11:15:08 +08:00
|
|
|
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include") # for directshow in VS2005 and multi-monitor support on MinGW
|
2013-04-08 02:45:38 +08:00
|
|
|
include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include/ffmpeg_") # for tests
|
2012-01-25 17:04:49 +08:00
|
|
|
endif()
|
|
|
|
|
2012-05-21 16:53:38 +08:00
|
|
|
if(UNIX)
|
|
|
|
#these variables are set by CHECK_MODULE macro
|
|
|
|
foreach(P ${HIGHGUI_INCLUDE_DIRS})
|
|
|
|
ocv_include_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(P ${HIGHGUI_LIBRARY_DIRS})
|
|
|
|
link_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs})
|
|
|
|
source_group("Include" FILES ${highgui_ext_hdrs})
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_set_module_sources(HEADERS ${highgui_ext_hdrs} SOURCES ${highgui_srcs} ${highgui_hdrs} ${grfmt_srcs} ${grfmt_hdrs})
|
|
|
|
ocv_module_include_directories()
|
2011-04-27 00:10:26 +08:00
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_create_module(${GRFMT_LIBS} ${HIGHGUI_LIBRARIES})
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2013-01-29 21:08:26 +08:00
|
|
|
if(APPLE)
|
|
|
|
ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS)
|
|
|
|
if(HAVE_OBJC_EXCEPTIONS)
|
|
|
|
foreach(source ${OPENCV_MODULE_${the_module}_SOURCES})
|
|
|
|
if("${source}" MATCHES "\\.mm$")
|
|
|
|
get_source_file_property(flags "${source}" COMPILE_FLAGS)
|
|
|
|
if(flags)
|
|
|
|
set(flags "${_flags} -fobjc-exceptions")
|
|
|
|
else()
|
|
|
|
set(flags "-fobjc-exceptions")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-01-25 17:04:49 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2012-02-06 21:29:48 +08:00
|
|
|
add_definitions(-DHIGHGUI_EXPORTS)
|
2011-06-03 20:01:55 +08:00
|
|
|
endif()
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
if(MSVC)
|
2012-02-06 21:29:48 +08:00
|
|
|
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG")
|
2011-06-17 02:00:41 +08:00
|
|
|
endif()
|
|
|
|
|
2012-02-05 02:57:41 +08:00
|
|
|
#stop automatic dependencies propagation for this module
|
|
|
|
set_target_properties(${the_module} PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_precompiled_headers(${the_module})
|
2012-06-08 14:19:17 +08:00
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated-declarations)
|
2012-03-19 19:21:01 +08:00
|
|
|
|
2012-04-14 05:50:59 +08:00
|
|
|
if(WIN32 AND WITH_FFMPEG)
|
2012-03-03 23:49:23 +08:00
|
|
|
#copy ffmpeg dll to the output folder
|
|
|
|
if(MSVC64 OR MINGW64)
|
|
|
|
set(FFMPEG_SUFFIX _64)
|
|
|
|
endif()
|
2012-05-25 04:10:13 +08:00
|
|
|
|
2012-03-03 23:49:23 +08:00
|
|
|
set(ffmpeg_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
|
2012-04-30 22:33:52 +08:00
|
|
|
set(ffmpeg_bare_name_ver "opencv_ffmpeg${OPENCV_DLLVERSION}${FFMPEG_SUFFIX}.dll")
|
2012-03-03 23:49:23 +08:00
|
|
|
set(ffmpeg_path "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/${ffmpeg_bare_name}")
|
2012-05-25 04:10:13 +08:00
|
|
|
|
2012-04-30 22:33:52 +08:00
|
|
|
if(MSVC_IDE)
|
2012-03-03 23:49:23 +08:00
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2012-04-30 22:33:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Release/${ffmpeg_bare_name_ver}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/Debug/${ffmpeg_bare_name_ver}"
|
2012-03-03 23:49:23 +08:00
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
2013-02-27 20:44:36 +08:00
|
|
|
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Visual"))
|
2012-03-03 23:49:23 +08:00
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2012-04-30 22:33:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${ffmpeg_bare_name_ver}"
|
2012-03-03 23:49:23 +08:00
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
|
|
|
else()
|
|
|
|
add_custom_command(TARGET ${the_module} POST_BUILD
|
2012-04-30 22:33:52 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${ffmpeg_path}" "${EXECUTABLE_OUTPUT_PATH}/${ffmpeg_bare_name_ver}"
|
2012-03-03 23:49:23 +08:00
|
|
|
COMMENT "Copying ${ffmpeg_path} to the output directory")
|
|
|
|
endif()
|
2012-05-25 04:10:13 +08:00
|
|
|
|
2014-01-17 20:30:31 +08:00
|
|
|
install(FILES "${ffmpeg_path}" DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs RENAME "${ffmpeg_bare_name_ver}")
|
2012-03-03 23:49:23 +08:00
|
|
|
endif()
|
|
|
|
|
2012-02-17 04:29:35 +08:00
|
|
|
ocv_add_accuracy_tests()
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_perf_tests()
|