Refactored detecting several Apple-related technologies.
Now the HAVE_* macros are set using cvconfig.h. Previously most of them already were there, but were always undefined. One, HAVE_COCOA, I had to add. This also makes the CMake code more consistent; now, WITH_* variables are always checked in cmake/*, while HAVE_* variables are checked in modules/highgui/CMakeLists.txt.
This commit is contained in:
parent
4f9554eead
commit
ca8b621b4f
@ -65,3 +65,12 @@ if(WITH_OPENGL)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif(WITH_OPENGL)
|
endif(WITH_OPENGL)
|
||||||
|
|
||||||
|
# --- Carbon & Cocoa ---
|
||||||
|
if(APPLE)
|
||||||
|
if(WITH_CARBON)
|
||||||
|
set(HAVE_CARBON YES)
|
||||||
|
elif(NOT IOS)
|
||||||
|
set(HAVE_COCOA YES)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -162,3 +162,8 @@ endif()
|
|||||||
if(ZLIB_FOUND)
|
if(ZLIB_FOUND)
|
||||||
ocv_parse_header2(ZLIB "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_VERSION)
|
ocv_parse_header2(ZLIB "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# --- Apple ImageIO ---
|
||||||
|
if(WITH_IMAGEIO)
|
||||||
|
set(HAVE_IMAGEIO YES)
|
||||||
|
endif()
|
||||||
|
@ -228,3 +228,13 @@ if(WIN32)
|
|||||||
list(APPEND HIGHGUI_LIBRARIES winmm)
|
list(APPEND HIGHGUI_LIBRARIES winmm)
|
||||||
endif()
|
endif()
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
# --- Apple AV Foundation ---
|
||||||
|
if(WITH_AVFOUNDATION)
|
||||||
|
set(HAVE_AVFOUNDATION YES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# --- QuickTime ---
|
||||||
|
if(WITH_QUICKTIME)
|
||||||
|
set(HAVE_QUICKTIME YES)
|
||||||
|
endif()
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
/* Carbon windowing environment */
|
/* Carbon windowing environment */
|
||||||
#cmakedefine HAVE_CARBON
|
#cmakedefine HAVE_CARBON
|
||||||
|
|
||||||
|
/* Cocoa API */
|
||||||
|
#cmakedefine HAVE_COCOA
|
||||||
|
|
||||||
/* IEEE1394 capturing support */
|
/* IEEE1394 capturing support */
|
||||||
#cmakedefine HAVE_DC1394
|
#cmakedefine HAVE_DC1394
|
||||||
|
|
||||||
|
@ -108,16 +108,12 @@ elseif(HAVE_WIN32UI)
|
|||||||
list(APPEND highgui_srcs src/window_w32.cpp)
|
list(APPEND highgui_srcs src/window_w32.cpp)
|
||||||
elseif(HAVE_GTK)
|
elseif(HAVE_GTK)
|
||||||
list(APPEND highgui_srcs src/window_gtk.cpp)
|
list(APPEND highgui_srcs src/window_gtk.cpp)
|
||||||
elseif(APPLE)
|
elseif(HAVE_CARBON)
|
||||||
if(WITH_CARBON)
|
|
||||||
add_definitions(-DHAVE_CARBON=1)
|
|
||||||
list(APPEND highgui_srcs src/window_carbon.cpp)
|
list(APPEND highgui_srcs src/window_carbon.cpp)
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime")
|
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime")
|
||||||
elseif(NOT IOS)
|
elseif(HAVE_COCOA)
|
||||||
add_definitions(-DHAVE_COCOA=1)
|
|
||||||
list(APPEND highgui_srcs src/window_cocoa.mm)
|
list(APPEND highgui_srcs src/window_cocoa.mm)
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework Cocoa")
|
list(APPEND HIGHGUI_LIBRARIES "-framework Cocoa")
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 AND NOT ARM)
|
if(WIN32 AND NOT ARM)
|
||||||
@ -210,26 +206,21 @@ if(HAVE_GIGE_API)
|
|||||||
list(APPEND highgui_srcs src/cap_giganetix.cpp)
|
list(APPEND highgui_srcs src/cap_giganetix.cpp)
|
||||||
endif(HAVE_GIGE_API)
|
endif(HAVE_GIGE_API)
|
||||||
|
|
||||||
if(WITH_IMAGEIO)
|
if(HAVE_IMAGEIO AND IOS)
|
||||||
add_definitions(-DHAVE_IMAGEIO=1)
|
|
||||||
if(IOS)
|
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework ImageIO")
|
list(APPEND HIGHGUI_LIBRARIES "-framework ImageIO")
|
||||||
endif()
|
endif()
|
||||||
endif(WITH_IMAGEIO)
|
|
||||||
|
|
||||||
if(WITH_AVFOUNDATION)
|
if(HAVE_AVFOUNDATION)
|
||||||
add_definitions(-DHAVE_AVFOUNDATION=1)
|
|
||||||
list(APPEND highgui_srcs src/cap_avfoundation.mm)
|
list(APPEND highgui_srcs src/cap_avfoundation.mm)
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
|
list(APPEND HIGHGUI_LIBRARIES "-framework AVFoundation" "-framework QuartzCore")
|
||||||
elseif(APPLE)
|
endif()
|
||||||
add_definitions(-DHAVE_QUICKTIME=1)
|
|
||||||
if(WITH_QUICKTIME)
|
if(HAVE_QUICKTIME)
|
||||||
list(APPEND highgui_srcs src/cap_qt.cpp)
|
list(APPEND highgui_srcs src/cap_qt.cpp)
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime" "-framework CoreFoundation" "-framework QuartzCore")
|
list(APPEND HIGHGUI_LIBRARIES "-framework Carbon" "-framework QuickTime" "-framework CoreFoundation" "-framework QuartzCore")
|
||||||
else()
|
elseif(APPLE)
|
||||||
list(APPEND highgui_srcs src/cap_qtkit.mm)
|
list(APPEND highgui_srcs src/cap_qtkit.mm)
|
||||||
list(APPEND HIGHGUI_LIBRARIES "-framework QTKit" "-framework QuartzCore" "-framework AppKit")
|
list(APPEND HIGHGUI_LIBRARIES "-framework QTKit" "-framework QuartzCore" "-framework AppKit")
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(IOS)
|
if(IOS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user