]> sigrok.org Git - pulseview.git/blame - test/CMakeLists.txt
Fix two errors with clang 3.6.
[pulseview.git] / test / CMakeLists.txt
CommitLineData
fb746bcc
AG
1##
2## This file is part of the PulseView project.
3##
4## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
6##
7## This program is free software: you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation, either version 2 of the License, or
10## (at your option) any later version.
11##
12## This program is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with this program. If not, see <http://www.gnu.org/licenses/>.
19##
20
269528f5
JH
21option(ENABLE_DECODE "Build with libsigrokdecode" FALSE)
22
ab186d22 23list(APPEND PKGDEPS libsigrok>=0.3.0)
269528f5
JH
24
25if(ENABLE_DECODE)
ab186d22 26 list(APPEND PKGDEPS libsigrokdecode>=0.3.0)
269528f5 27endif()
3b3a445c
JH
28
29find_package(PkgConfig)
30pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
31
496b7205 32find_package(Boost 1.42 COMPONENTS filesystem system unit_test_framework REQUIRED)
a322807e 33
61e1e13e 34find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac)
3b3a445c
JH
35find_package(Qt4 REQUIRED)
36
fb746bcc 37set(pulseview_TEST_SOURCES
3b3a445c
JH
38 ${PROJECT_SOURCE_DIR}/pv/devicemanager.cpp
39 ${PROJECT_SOURCE_DIR}/pv/sigsession.cpp
3fe44dc6 40 ${PROJECT_SOURCE_DIR}/pv/util.cpp
3b3a445c
JH
41 ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp
42 ${PROJECT_SOURCE_DIR}/pv/data/analog.cpp
340bc0a4 43 ${PROJECT_SOURCE_DIR}/pv/data/analogsnapshot.cpp
3b3a445c 44 ${PROJECT_SOURCE_DIR}/pv/data/logic.cpp
1b1ec774 45 ${PROJECT_SOURCE_DIR}/pv/data/logicsnapshot.cpp
3b3a445c
JH
46 ${PROJECT_SOURCE_DIR}/pv/data/snapshot.cpp
47 ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp
921b90c0 48 ${PROJECT_SOURCE_DIR}/pv/device/device.cpp
94574501 49 ${PROJECT_SOURCE_DIR}/pv/device/devinst.cpp
ae2d1bc5
JH
50 ${PROJECT_SOURCE_DIR}/pv/device/file.cpp
51 ${PROJECT_SOURCE_DIR}/pv/device/inputfile.cpp
52 ${PROJECT_SOURCE_DIR}/pv/device/sessionfile.cpp
a28c3025 53 ${PROJECT_SOURCE_DIR}/pv/prop/double.cpp
182d2f5d 54 ${PROJECT_SOURCE_DIR}/pv/prop/enum.cpp
4e5a4405
JH
55 ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp
56 ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp
57 ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp
58 ${PROJECT_SOURCE_DIR}/pv/prop/binding/binding.cpp
3b3a445c
JH
59 ${PROJECT_SOURCE_DIR}/pv/view/analogsignal.cpp
60 ${PROJECT_SOURCE_DIR}/pv/view/cursor.cpp
3fe44dc6 61 ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.cpp
3b3a445c 62 ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp
3b3a445c
JH
63 ${PROJECT_SOURCE_DIR}/pv/view/header.cpp
64 ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.cpp
65 ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.cpp
66 ${PROJECT_SOURCE_DIR}/pv/view/ruler.cpp
67 ${PROJECT_SOURCE_DIR}/pv/view/selectableitem.cpp
68 ${PROJECT_SOURCE_DIR}/pv/view/signal.cpp
69 ${PROJECT_SOURCE_DIR}/pv/view/timemarker.cpp
70 ${PROJECT_SOURCE_DIR}/pv/view/trace.cpp
71 ${PROJECT_SOURCE_DIR}/pv/view/tracepalette.cpp
72 ${PROJECT_SOURCE_DIR}/pv/view/view.cpp
73 ${PROJECT_SOURCE_DIR}/pv/view/viewport.cpp
3b3a445c
JH
74 ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp
75 ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp
76 ${PROJECT_SOURCE_DIR}/pv/widgets/popup.cpp
77 ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.cpp
340bc0a4 78 data/analogsnapshot.cpp
1b1ec774 79 data/logicsnapshot.cpp
fb746bcc
AG
80 test.cpp
81)
82
0aad432c 83# This list includes only QObject derived class headers.
3b3a445c
JH
84set(pulseview_TEST_HEADERS
85 ${PROJECT_SOURCE_DIR}/pv/sigsession.h
94574501 86 ${PROJECT_SOURCE_DIR}/pv/device/devinst.h
a28c3025 87 ${PROJECT_SOURCE_DIR}/pv/prop/double.h
182d2f5d 88 ${PROJECT_SOURCE_DIR}/pv/prop/enum.h
4e5a4405
JH
89 ${PROJECT_SOURCE_DIR}/pv/prop/int.h
90 ${PROJECT_SOURCE_DIR}/pv/prop/property.h
91 ${PROJECT_SOURCE_DIR}/pv/prop/string.h
3b3a445c 92 ${PROJECT_SOURCE_DIR}/pv/view/cursor.h
3fe44dc6 93 ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.h
3b3a445c
JH
94 ${PROJECT_SOURCE_DIR}/pv/view/header.h
95 ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.h
96 ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.h
97 ${PROJECT_SOURCE_DIR}/pv/view/ruler.h
98 ${PROJECT_SOURCE_DIR}/pv/view/selectableitem.h
99 ${PROJECT_SOURCE_DIR}/pv/view/signal.h
100 ${PROJECT_SOURCE_DIR}/pv/view/timemarker.h
101 ${PROJECT_SOURCE_DIR}/pv/view/trace.h
102 ${PROJECT_SOURCE_DIR}/pv/view/view.h
103 ${PROJECT_SOURCE_DIR}/pv/view/viewport.h
104 ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.h
105 ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.h
0bce8609 106 ${PROJECT_SOURCE_DIR}/pv/widgets/popup.h
3b3a445c
JH
107 ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.h
108)
109
269528f5
JH
110if(ENABLE_DECODE)
111 list(APPEND pulseview_TEST_SOURCES
112 ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.cpp
269528f5 113 ${PROJECT_SOURCE_DIR}/pv/data/decode/annotation.cpp
d0710d1e
JH
114 ${PROJECT_SOURCE_DIR}/pv/data/decode/decoder.cpp
115 ${PROJECT_SOURCE_DIR}/pv/data/decode/row.cpp
116 ${PROJECT_SOURCE_DIR}/pv/data/decode/rowdata.cpp
269528f5
JH
117 ${PROJECT_SOURCE_DIR}/pv/prop/binding/decoderoptions.cpp
118 ${PROJECT_SOURCE_DIR}/pv/view/decodetrace.cpp
119 ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.cpp
120 ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.cpp
121 data/decoderstack.cpp
122 )
123
124 list(APPEND pulseview_TEST_HEADERS
125 ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.h
126 ${PROJECT_SOURCE_DIR}/pv/view/decodetrace.h
127 ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.h
128 ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.h
129 )
130endif()
131
3b3a445c
JH
132qt4_wrap_cpp(pulseview_TEST_HEADERS_MOC ${pulseview_TEST_HEADERS})
133
269528f5
JH
134if(ENABLE_DECODE)
135 add_definitions(-DENABLE_DECODE)
136endif()
137
a9a88468
UH
138# On MinGW we need to use static linking.
139if(NOT WIN32)
fb746bcc 140add_definitions(-DBOOST_TEST_DYN_LINK)
a9a88468
UH
141endif()
142
3b3a445c 143add_definitions(${QT_DEFINITIONS})
fb746bcc 144
a322807e
JH
145include_directories(
146 ${Boost_INCLUDE_DIRS}
3b3a445c 147 ${PKGDEPS_INCLUDE_DIRS}
a322807e
JH
148)
149
150set(PULSEVIEW_LINK_LIBS
151 ${Boost_LIBRARIES}
3b3a445c
JH
152 ${PKGDEPS_LIBRARIES}
153 ${QT_LIBRARIES}
a322807e
JH
154)
155
7cfb538d
UH
156if(WIN32)
157 # Workaround for a MinGW linking issue.
158 list(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2")
159endif()
160
fb746bcc
AG
161add_executable(pulseview-test
162 ${pulseview_TEST_SOURCES}
3b3a445c 163 ${pulseview_TEST_HEADERS_MOC}
fb746bcc
AG
164)
165
166target_link_libraries(pulseview-test ${PULSEVIEW_LINK_LIBS})
167