forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindQtAV.cmake
56 lines (49 loc) · 1.91 KB
/
FindQtAV.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# - Try to find the QtAV library
#
# Once done this will define
#
# QTAV_FOUND - system has libqtav
# QTAV_INCLUDE_DIRS - the libqtav include directory
# QTAV_LIBRARIES - Link these to use libqtav
find_package(Qt5 QUIET REQUIRED NO_MODULE COMPONENTS Core)
get_target_property(qmake Qt5::qmake LOCATION)
execute_process(
COMMAND ${qmake} -query QT_INSTALL_HEADERS
OUTPUT_VARIABLE QT_INSTALL_HEADERS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${qmake} -query QT_INSTALL_LIBS
OUTPUT_VARIABLE QT_INSTALL_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_path(QTAV_INCLUDE_DIR NAMES QtAV.h
HINTS ${QT_INSTALL_HEADERS}
PATH_SUFFIXES QtAV
)
find_library(QTAV_LIBRARY NAMES QtAV QtAV1
HINTS ${QT_INSTALL_LIBS}
)
find_path(QTAVWIDGETS_INCLUDE_DIR NAMES QtAVWidgets.h
HINTS ${QT_INSTALL_HEADERS}
PATH_SUFFIXES QtAVWidgets
)
find_library(QTAVWIDGETS_LIBRARY NAMES QtAVWidgets QtAVWidgets1
HINTS ${QT_INSTALL_LIBS}
)
set(QTAV_INCLUDE_DIRS ${QTAV_INCLUDE_DIR} ${QTAV_INCLUDE_DIR}/..)
set(QTAV_LIBRARIES ${QTAV_LIBRARY})
if(NOT QTAVWIDGETS_INCLUDE_DIR MATCHES "QTAVWIDGETS_INCLUDE_DIR-NOTFOUND")
set(QTAVWIDGETS_INCLUDE_DIRS ${QTAVWIDGETS_INCLUDE_DIR} ${QTAVWIDGETS_INCLUDE_DIR}/.. ${QTAV_INCLUDE_DIRS})
endif()
if(NOT QTAV_LIBRARIES MATCHES "QTAV_LIBRARIES-NOTFOUND")
set(QTAVWIDGETS_LIBRARIES ${QTAVWIDGETS_LIBRARY} ${QTAV_LIBRARY})
endif()
find_package(PackageHandleStandardArgs REQUIRED)
find_package_handle_standard_args(QtAV REQUIRED_VARS QTAV_LIBRARIES QTAV_INCLUDE_DIRS)
mark_as_advanced(QTAV_INCLUDE_DIRS QTAV_LIBRARIES QTAVWIDGETS_INCLUDE_DIRS QTAVWIDGETS_LIBRARIES)
message("QtAV_FOUND = ${QTAV_FOUND}")
message("QTAV_INCLUDE_DIRS = ${QTAV_INCLUDE_DIRS}")
message("QTAV_LIBRARIES = ${QTAV_LIBRARIES}")
message("QTAVWIDGETS_INCLUDE_DIRS = ${QTAVWIDGETS_INCLUDE_DIRS}")
message("QTAVWIDGETS_LIBRARIES = ${QTAVWIDGETS_LIBRARIES}")