1# Webcamoid, webcam capture application.
2# Copyright (C) 2016  Gonzalo Exequiel Pedone
3#
4# Webcamoid is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# Webcamoid is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
16#
17# Web-Site: http://webcamoid.github.io/
18
19exists(akcommons.pri) {
20    include(akcommons.pri)
21} else {
22    error("akcommons.pri file not found.")
23}
24
25!isEmpty(BUILDDOCS):!isEqual(BUILDDOCS, 0) {
26    DOCSOURCES += $${COMMONS_APPNAME}.qdocconf
27
28    builddocs.input = DOCSOURCES
29    builddocs.output = share/docs_auto/html/$${COMMONS_APPNAME}.index
30    builddocs.commands = $${QDOCTOOL} ${QMAKE_FILE_IN}
31    builddocs.variable_out = DOCSOUTPUT
32    builddocs.name = Docs ${QMAKE_FILE_IN}
33    builddocs.CONFIG += target_predeps
34
35    QMAKE_EXTRA_COMPILERS += builddocs
36    PRE_TARGETDEPS += compiler_builddocs_make_all
37}
38
39# Check what libraries and frameworks are available
40load(configure)
41QMAKE_CONFIG_TESTS_DIR=$$PWD/Tests
42isEmpty(NOALSA): qtCompileTest(alsa)
43isEmpty(NOAVFOUNDATION): qtCompileTest(avfoundation)
44isEmpty(NOCOREMEDIAIO): qtCompileTest(cmio)
45isEmpty(NOCOREAUDIO): qtCompileTest(coreaudio)
46isEmpty(NODSHOW): qtCompileTest(dshow)
47
48# Test FFmpeg
49isEmpty(NOFFMPEG) {
50    !isEmpty(FFMPEGINCLUDES): cache(FFMPEGINCLUDES)
51    !isEmpty(FFMPEGLIBS): cache(FFMPEGLIBS)
52    qtCompileTest(ffmpeg)
53    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avcodec_sendrecv)
54    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avcodec_subtitledata)
55    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avformat_codecpar)
56    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avutil_extraoptions)
57    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avutil_sampleformat64)
58    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_avresample)
59    CONFIG(config_ffmpeg): qtCompileTest(ffmpeg_swresample)
60}
61
62isEmpty(NOGSTREAMER) {
63    !isEmpty(GSTREAMERINCLUDES): cache(GSTREAMERINCLUDES)
64    !isEmpty(GSTREAMERLIBS): cache(GSTREAMERLIBS)
65    qtCompileTest(gstreamer)
66}
67
68isEmpty(NOJACK): qtCompileTest(jack)
69
70isEmpty(NOLIBUVC) {
71    !isEmpty(LIBUSBINCLUDES): cache(LIBUSBINCLUDES)
72    !isEmpty(LIBUSBLIBS): cache(LIBUSBLIBS)
73    !isEmpty(LIBUVCINCLUDES): cache(LIBUVCINCLUDES)
74    !isEmpty(LIBUVCLIBS): cache(LIBUVCLIBS)
75    qtCompileTest(libuvc)
76    CONFIG(config_libuvc): qtCompileTest(libusb_has_hotplug)
77}
78
79isEmpty(NOMEDIAFOUNDATION): qtCompileTest(mediafoundation)
80isEmpty(NONDKAUDIO): qtCompileTest(ndk_audio)
81isEmpty(NONDKCAMERA): qtCompileTest(ndk_camera)
82isEmpty(NONDKMEDIA): qtCompileTest(ndk_media)
83isEmpty(NOOPENSL): qtCompileTest(opensl)
84isEmpty(NOPULSEAUDIO): qtCompileTest(pulseaudio)
85
86isEmpty(NOV4L2): !android {
87    qtCompileTest(v4l2)
88    CONFIG(config_v4l2): qtCompileTest(v4l2_extendedcontrols)
89    CONFIG(config_v4l2): qtCompileTest(v4l2_extraformats)
90    isEmpty(NOV4LUTILS): CONFIG(config_v4l2): qtCompileTest(v4lutils)
91}
92
93isEmpty(NOWASAPI): qtCompileTest(wasapi)
94
95TEMPLATE = subdirs
96
97CONFIG += ordered
98
99SUBDIRS += \
100    Lib \
101    AkQml \
102    Plugins
103
104# Install rules
105
106!android {
107    !macx | !isEmpty(NOAPPBUNDLE) {
108        INSTALLS += license
109        license.files = ../COPYING
110        license.path = $${LICENSEDIR}
111    }
112}
113
114!isEmpty(BUILDDOCS): !isEqual(BUILDDOCS, 0) {
115    INSTALLS += docs
116    docs.files = share/docs_auto/html
117    docs.path = $${HTMLDIR}
118    docs.CONFIG += no_check_exist
119}
120