2010-05-11 19:44:00 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for highgui. See root CMakeLists.txt
|
|
|
|
# Some parts taken from version of Hartmut Seichter, HIT Lab NZ.
|
|
|
|
# Jose Luis Blanco, 2008
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
project(opencv_highgui)
|
|
|
|
|
2011-04-26 17:46:15 +02:00
|
|
|
set(GRFMT_LIBS)
|
|
|
|
|
|
|
|
if(WITH_PNG OR WITH_TIFF OR WITH_OPENEXR)
|
|
|
|
if(ZLIB_FOUND)
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIR})
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${ZLIB_LIBRARIES})
|
|
|
|
else()
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/zlib")
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} zlib)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
if(WITH_JPEG)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_definitions(-DHAVE_JPEG)
|
|
|
|
if(JPEG_FOUND)
|
2011-04-26 17:46:15 +02:00
|
|
|
include_directories(${JPEG_INCLUDE_DIR})
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${JPEG_LIBRARIES})
|
|
|
|
else()
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libjpeg")
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} libjpeg)
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_PNG)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_definitions(-DHAVE_PNG)
|
|
|
|
if(PNG_FOUND)
|
2011-04-26 17:46:15 +02:00
|
|
|
add_definitions(${PNG_DEFINITIONS})
|
|
|
|
include_directories(${PNG_INCLUDE_DIR})
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${PNG_LIBRARIES})
|
|
|
|
else()
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libpng")
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} libpng)
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_TIFF)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_definitions(-DHAVE_TIFF)
|
|
|
|
if(TIFF_FOUND)
|
2011-04-26 17:46:15 +02:00
|
|
|
include_directories(${TIFF_INCLUDE_DIR})
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${TIFF_LIBRARIES})
|
|
|
|
else()
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libtiff")
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} libtiff)
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_JASPER)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_definitions(-DHAVE_JASPER)
|
|
|
|
if(JASPER_FOUND)
|
2011-04-26 17:46:15 +02:00
|
|
|
include_directories(${JASPER_INCLUDE_DIR})
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${JASPER_LIBRARIES})
|
|
|
|
else()
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libjasper")
|
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} libjasper)
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
2010-07-04 14:32:31 +02:00
|
|
|
if(WITH_OPENEXR AND OPENEXR_FOUND)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_definitions(-DHAVE_OPENEXR)
|
|
|
|
include_directories(${OPENEXR_INCLUDE_PATHS})
|
2011-04-26 17:46:15 +02:00
|
|
|
set(GRFMT_LIBS ${GRFMT_LIBS} ${OPENEXR_LIBRARIES})
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:libcmt.lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB grfmt_hdrs src/grfmt*.hpp)
|
|
|
|
file(GLOB grfmt_srcs src/grfmt*.cpp)
|
|
|
|
set(grfmt_hdrs src/bitstrm.hpp ${grfmt_hdrs})
|
|
|
|
set(grfmt_srcs src/bitstrm.cpp ${grfmt_srcs})
|
|
|
|
|
|
|
|
source_group("Src\\grfmts" FILES ${grfmt_hdrs} ${grfmt_srcs})
|
|
|
|
|
|
|
|
set(highgui_srcs
|
|
|
|
src/cap.cpp
|
|
|
|
src/cap_images.cpp
|
2011-07-04 18:18:12 +02:00
|
|
|
src/cap_ffmpeg.cpp
|
2010-05-11 19:44:00 +02:00
|
|
|
src/loadsave.cpp
|
|
|
|
src/precomp.cpp
|
|
|
|
src/utils.cpp
|
|
|
|
src/window.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(highgui_hdrs src/precomp.hpp src/utils.hpp)
|
|
|
|
|
2010-06-12 18:36:46 +02:00
|
|
|
#YV
|
2010-05-11 19:44:00 +02:00
|
|
|
set(lib_hdr_names highgui_c.h highgui.hpp)
|
|
|
|
set(highgui_ext_hdrs)
|
|
|
|
foreach(h ${lib_hdr_names})
|
|
|
|
list(APPEND highgui_ext_hdrs "${CMAKE_CURRENT_SOURCE_DIR}/include/opencv2/highgui/${h}")
|
|
|
|
endforeach()
|
|
|
|
|
2010-06-07 10:29:10 +02:00
|
|
|
#YV
|
2010-07-12 17:29:31 +02:00
|
|
|
if (HAVE_QT)
|
|
|
|
if (HAVE_QT_OPENGL)
|
|
|
|
set(QT_USE_QTOPENGL TRUE)
|
|
|
|
endif()
|
|
|
|
INCLUDE(${QT_USE_FILE})
|
2010-07-16 11:12:15 +02:00
|
|
|
|
|
|
|
SET(_RCCS_FILES src/window_QT.qrc)
|
2011-05-27 15:47:18 +02:00
|
|
|
QT4_ADD_RESOURCES(_RCC_OUTFILES ${_RCCS_FILES})
|
2010-07-16 11:12:15 +02:00
|
|
|
|
2010-07-12 17:29:31 +02:00
|
|
|
SET(_MOC_HEADERS src/window_QT.h )
|
|
|
|
QT4_WRAP_CPP(_MOC_OUTFILES ${_MOC_HEADERS})
|
|
|
|
|
2011-06-17 11:26:53 +02:00
|
|
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY})
|
2010-07-16 11:12:15 +02:00
|
|
|
set(highgui_srcs ${highgui_srcs} src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES} )
|
2010-07-12 17:29:31 +02:00
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
if(WIN32)
|
2010-07-12 17:29:31 +02:00
|
|
|
if(NOT HAVE_QT)
|
2010-06-07 10:29:10 +02:00
|
|
|
set(highgui_srcs ${highgui_srcs} src/window_w32.cpp)
|
|
|
|
endif()
|
2011-07-04 18:18:12 +02:00
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp)
|
2010-05-11 19:44:00 +02:00
|
|
|
if(HAVE_MIL)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_mil.cpp)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(UNIX)
|
2010-07-12 17:29:31 +02:00
|
|
|
if(NOT HAVE_QT)
|
2011-05-27 15:47:18 +02:00
|
|
|
if(HAVE_GTK)
|
2010-06-07 10:29:10 +02:00
|
|
|
set(highgui_srcs ${highgui_srcs} src/window_gtk.cpp)
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_XINE)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_xine.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_DC1394_2)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_dc1394_v2.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_DC1394)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_dc1394.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_FFMPEG)
|
|
|
|
if(BZIP2_LIBRARIES)
|
|
|
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${BZIP2_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_PVAPI)
|
|
|
|
add_definitions(-DHAVE_PVAPI)
|
|
|
|
set(highgui_srcs src/cap_pvapi.cpp ${highgui_srcs})
|
|
|
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} PvAPI)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_GSTREAMER)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_gstreamer.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_UNICAP)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_unicap.cpp)
|
|
|
|
endif()
|
|
|
|
|
2011-05-27 15:47:18 +02:00
|
|
|
if(HAVE_LIBV4L)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_libv4l.cpp)
|
|
|
|
else()
|
|
|
|
if(HAVE_CAMV4L OR HAVE_CAMV4L2)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_v4l.cpp)
|
|
|
|
endif()
|
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
foreach(P ${HIGHGUI_INCLUDE_DIRS})
|
|
|
|
include_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(P ${HIGHGUI_LIBRARY_DIRS})
|
|
|
|
link_directories(${P})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2011-01-21 18:00:08 +01:00
|
|
|
#OpenNI
|
|
|
|
if(WITH_OPENNI AND HAVE_OPENNI)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_openni.cpp)
|
|
|
|
include_directories(${OPENNI_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2010-06-07 10:29:10 +02:00
|
|
|
#YV
|
2010-05-11 19:44:00 +02:00
|
|
|
if(APPLE)
|
|
|
|
add_definitions(-DHAVE_QUICKTIME=1)
|
|
|
|
if(NOT OPENCV_BUILD_3RDPARTY_LIBS)
|
|
|
|
add_definitions(-DHAVE_IMAGEIO=1)
|
|
|
|
endif()
|
2010-06-07 10:29:10 +02:00
|
|
|
|
2010-07-12 17:29:31 +02:00
|
|
|
if (NOT HAVE_QT)
|
2010-06-07 10:29:10 +02:00
|
|
|
if(WITH_CARBON)
|
|
|
|
add_definitions(-DHAVE_CARBON=1)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/window_carbon.cpp)
|
|
|
|
else()
|
|
|
|
add_definitions(-DHAVE_COCOA=1)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/window_cocoa.mm)
|
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
2010-06-07 10:29:10 +02:00
|
|
|
|
2011-05-27 15:47:18 +02:00
|
|
|
if(WITH_QUICKTIME)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_qt.cpp)
|
|
|
|
else()
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_qtkit.mm)
|
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif(APPLE)
|
|
|
|
|
2011-07-04 13:41:39 +02:00
|
|
|
if(WITH_ANDROID_CAMERA)
|
2011-06-16 20:00:41 +02:00
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../androidcamera/include")
|
2011-04-06 16:31:03 +02:00
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_android.cpp)
|
|
|
|
add_definitions(-DHAVE_ANDROID_NATIVE_CAMERA)
|
2011-06-16 20:00:41 +02:00
|
|
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} opencv_androidcamera)
|
2011-04-06 16:31:03 +02:00
|
|
|
endif()
|
|
|
|
|
2011-08-11 20:06:09 +02:00
|
|
|
#XIMEA API
|
|
|
|
if(HAVE_XIMEA AND XIMEA_FOUND)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp)
|
|
|
|
include_directories(${XIMEA_PATH})
|
|
|
|
link_directories(${XIMEA_LIBRARY_DIR})
|
|
|
|
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} m3api)
|
|
|
|
set(highgui_srcs ${highgui_srcs} src/cap_ximea.cpp)
|
|
|
|
endif()
|
|
|
|
|
2011-05-03 10:13:50 +02:00
|
|
|
if(COMMAND get_module_external_sources)
|
|
|
|
set( lib_srcs "${highgui_srcs}" )
|
|
|
|
set( lib_int_hdrs "${highgui_hdrs}" )
|
|
|
|
get_module_external_sources(highgui)
|
|
|
|
set( highgui_srcs "${lib_srcs}" )
|
|
|
|
set( highgui_hdrs "${lib_int_hdrs}" )
|
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs})
|
|
|
|
source_group("Include" FILES ${highgui_ext_hdrs})
|
|
|
|
|
|
|
|
if(OPENCV_BUILD_3RDPARTY_LIBS)
|
|
|
|
if(WIN32)
|
|
|
|
link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/lib")
|
|
|
|
endif()
|
|
|
|
link_directories(
|
|
|
|
"${CMAKE_BINARY_DIR}/3rdparty/lib"
|
|
|
|
"${CMAKE_BINARY_DIR}/3rdparty/lib/${ConfigurationName}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(lib_srcs ${highgui_srcs} ${grfmt_srcs})
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
2011-05-27 15:47:18 +02:00
|
|
|
# Define the library target:
|
2010-05-11 19:44:00 +02:00
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
set(the_target "opencv_highgui")
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include"
|
2011-05-27 15:47:18 +02:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../core/include"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../imgproc/include"
|
2010-05-11 19:44:00 +02:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
2011-04-26 18:10:26 +02:00
|
|
|
if(WIN32)
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include")
|
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
add_library(${the_target} ${lib_srcs} ${highgui_hdrs} ${grfmt_hdrs} ${highgui_ext_hdrs})
|
|
|
|
|
2011-06-11 19:24:09 +02:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DHIGHGUI_EXPORTS)
|
|
|
|
if(MSVC)
|
|
|
|
set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
|
|
|
|
else()
|
2011-07-24 21:22:58 +02:00
|
|
|
add_definitions(-DCVAPI_EXPORTS)
|
2011-06-11 19:24:09 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2011-07-24 21:22:58 +02:00
|
|
|
add_opencv_precompiled_headers(${the_target})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# For dynamic link numbering convenions
|
2011-06-03 14:01:55 +02:00
|
|
|
if(NOT ANDROID)
|
|
|
|
# Android SDK build scripts can include only .so files into final .apk
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
|
|
|
VERSION ${OPENCV_VERSION}
|
|
|
|
SOVERSION ${OPENCV_SOVERSION}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2011-07-24 21:22:58 +02:00
|
|
|
set_target_properties(${the_target} PROPERTIES OUTPUT_NAME "${the_target}${OPENCV_DLLVERSION}" )
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
# Additional target properties
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
2011-05-27 15:47:18 +02:00
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
2011-05-31 00:13:32 +02:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
|
|
|
|
INSTALL_NAME_DIR lib
|
2011-05-27 15:47:18 +02:00
|
|
|
LINK_INTERFACE_LIBRARIES ""
|
|
|
|
)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2011-05-17 11:40:06 +02:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2011-05-27 15:47:18 +02:00
|
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "modules")
|
|
|
|
endif()
|
2011-05-11 15:37:20 +02:00
|
|
|
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
if(MSVC)
|
2011-05-27 15:47:18 +02:00
|
|
|
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
|
2010-05-11 19:44:00 +02:00
|
|
|
endif(MSVC)
|
|
|
|
|
|
|
|
# Dependencies of this target:
|
|
|
|
add_dependencies(${the_target} opencv_core opencv_imgproc)
|
|
|
|
|
|
|
|
# Add the required libraries for linking:
|
|
|
|
|
|
|
|
if(WITH_JASPER AND NOT JASPER_FOUND)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_dependencies(${the_target} libjasper)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_JPEG AND NOT JPEG_FOUND)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_dependencies(${the_target} libjpeg)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_PNG AND NOT PNG_FOUND)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_dependencies(${the_target} libpng)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_TIFF AND NOT TIFF_FOUND)
|
2011-05-27 15:47:18 +02:00
|
|
|
add_dependencies(${the_target} libtiff)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
2011-04-26 17:46:15 +02:00
|
|
|
if(NOT ZLIB_FOUND)
|
|
|
|
add_dependencies(${the_target} zlib)
|
|
|
|
endif()
|
|
|
|
|
2011-07-04 13:41:39 +02:00
|
|
|
if(WITH_ANDROID_CAMERA)
|
2011-06-16 20:00:41 +02:00
|
|
|
add_dependencies(${the_target} opencv_androidcamera)
|
|
|
|
endif()
|
|
|
|
|
2011-04-26 17:46:15 +02:00
|
|
|
#message(STATUS "GRFMT: ${GRFMT_LIBS}")
|
|
|
|
#message(STATUS "HIGHGUI_LIBS: ${HIGHGUI_LIBRARIES}")
|
|
|
|
#message(STATUS "OPENCV_LIBS: ${OPENCV_LINKER_LIBS}")
|
|
|
|
|
|
|
|
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} opencv_core
|
|
|
|
opencv_imgproc ${GRFMT_LIBS} ${HIGHGUI_LIBRARIES})
|
2011-01-21 18:00:08 +01:00
|
|
|
if( OPENNI_LIBRARY )
|
|
|
|
target_link_libraries(${the_target} ${OPENNI_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
2010-05-11 19:44:00 +02:00
|
|
|
if(APPLE)
|
2011-05-27 15:47:18 +02:00
|
|
|
target_link_libraries(${the_target} "-lbz2 -framework Cocoa -framework QuartzCore")
|
|
|
|
if(WITH_CARBON)
|
|
|
|
target_link_libraries(${the_target} "-framework Carbon")
|
|
|
|
endif()
|
|
|
|
if(NOT WITH_QUICKTIME)
|
|
|
|
target_link_libraries(${the_target} "-framework QTKit")
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
2011-05-27 15:47:18 +02:00
|
|
|
if(WITH_CARBON OR WITH_QUICKTIME)
|
2010-05-11 19:44:00 +02:00
|
|
|
target_link_libraries(${the_target} "-framework QuickTime -framework CoreFoundation")
|
2011-05-27 15:47:18 +02:00
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
install(TARGETS ${the_target}
|
2011-05-27 15:47:18 +02:00
|
|
|
RUNTIME DESTINATION bin COMPONENT main
|
2011-07-01 08:58:53 +02:00
|
|
|
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
|
|
|
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
install(FILES ${highgui_ext_hdrs}
|
2011-06-28 18:02:09 +02:00
|
|
|
DESTINATION ${OPENCV_INCLUDE_PREFIX}/opencv2/highgui
|
2011-04-26 17:46:15 +02:00
|
|
|
COMPONENT main)
|
2011-06-01 16:23:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
############################# highgui tests ################################
|
2011-06-01 20:04:46 +02:00
|
|
|
if(BUILD_TESTS)
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:28:20 +02:00
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/test"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}")
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:28:20 +02:00
|
|
|
set(test_deps opencv_ts opencv_highgui opencv_imgproc)
|
2011-07-04 13:41:39 +02:00
|
|
|
if(WITH_ANDROID_CAMERA)
|
2011-06-16 20:00:41 +02:00
|
|
|
set(test_deps ${test_deps} opencv_androidcamera)
|
|
|
|
endif()
|
2011-06-01 20:28:20 +02:00
|
|
|
|
|
|
|
foreach(d ${test_deps})
|
|
|
|
if(${d} MATCHES "opencv_")
|
|
|
|
string(REPLACE "opencv_" "${CMAKE_CURRENT_SOURCE_DIR}/../" d_dir ${d})
|
|
|
|
include_directories("${d_dir}/include")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(GLOB test_srcs "test/*.cpp")
|
|
|
|
file(GLOB test_hdrs "test/*.h*")
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:28:20 +02:00
|
|
|
source_group("Src" FILES ${test_srcs})
|
|
|
|
source_group("Include" FILES ${test_hdrs})
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:28:20 +02:00
|
|
|
set(the_target "opencv_test_highgui")
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:28:20 +02:00
|
|
|
add_executable(${the_target} ${test_srcs} ${test_hdrs})
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-07-24 21:22:58 +02:00
|
|
|
add_opencv_precompiled_headers(${the_target})
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
# Additional target properties
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}"
|
|
|
|
)
|
2011-07-24 21:22:58 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2011-07-24 21:22:58 +02:00
|
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "tests")
|
|
|
|
endif()
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
add_dependencies(${the_target} ${test_deps})
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
# Add the required libraries for linking:
|
|
|
|
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${test_deps})
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
enable_testing()
|
|
|
|
get_target_property(LOC ${the_target} LOCATION)
|
|
|
|
add_test(${the_target} "${LOC}")
|
2011-06-01 16:23:55 +02:00
|
|
|
|
2011-06-01 20:54:34 +02:00
|
|
|
if(WIN32)
|
2011-06-02 12:02:08 +02:00
|
|
|
if (MSVC AND NOT BUILD_SHARED_LIBS)
|
|
|
|
set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG")
|
|
|
|
endif()
|
2011-06-23 14:00:09 +02:00
|
|
|
#install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
|
2011-06-01 20:54:34 +02:00
|
|
|
endif()
|
|
|
|
endif(BUILD_TESTS)
|