]>
Commit | Line | Data |
---|---|---|
68c4a3b3 | 1 | ## |
190fc91a | 2 | ## This file is part of the PulseView project. |
68c4a3b3 JH |
3 | ## |
4 | ## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk> | |
30588653 | 5 | ## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com> |
68c4a3b3 JH |
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 | ||
df944399 JH |
21 | cmake_minimum_required(VERSION 2.6) |
22 | include(FindPkgConfig) | |
23 | ||
a8d3fb2d | 24 | project(pulseview) |
df944399 | 25 | |
30588653 AG |
26 | #=============================================================================== |
27 | #= Dependencies | |
28 | #------------------------------------------------------------------------------- | |
29 | ||
df944399 JH |
30 | find_package(PkgConfig) |
31 | pkg_check_modules(PKGDEPS REQUIRED | |
32 | libsigrokdecode>=0.1.0 | |
0dfbf7ff | 33 | libsigrok>=0.2.0 |
df944399 JH |
34 | ) |
35 | ||
4cd24a75 UH |
36 | # On Windows/MinGW we explicitly point cmake to the Boost directory. |
37 | if(WIN32) | |
951c583c | 38 | set(BOOST_ROOT /usr/local) |
4cd24a75 UH |
39 | endif(WIN32) |
40 | ||
df944399 | 41 | find_package(Qt4 REQUIRED) |
f0fa92c6 | 42 | find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED) |
df944399 JH |
43 | |
44 | set(VERSION 0.1.0) | |
45 | ||
30588653 AG |
46 | #=============================================================================== |
47 | #= Sources | |
48 | #------------------------------------------------------------------------------- | |
49 | ||
a8d3fb2d | 50 | set(pulseview_SOURCES |
df944399 | 51 | main.cpp |
51e77110 JH |
52 | pv/about.cpp |
53 | pv/datasnapshot.cpp | |
54 | pv/logicdata.cpp | |
55 | pv/logicdatasnapshot.cpp | |
56 | pv/logicsignal.cpp | |
57 | pv/mainwindow.cpp | |
58 | pv/samplingbar.cpp | |
59 | pv/signaldata.cpp | |
60 | pv/sigsession.cpp | |
61 | pv/signal.cpp | |
1d8dca91 | 62 | pv/view/header.cpp |
ccdd3ef5 | 63 | pv/view/ruler.cpp |
cdf7bea7 JH |
64 | pv/view/view.cpp |
65 | pv/view/viewport.cpp | |
df944399 JH |
66 | ) |
67 | ||
a8d3fb2d | 68 | set(pulseview_HEADERS |
51e77110 JH |
69 | pv/about.h |
70 | pv/mainwindow.h | |
71 | pv/samplingbar.h | |
72 | pv/sigsession.h | |
1d8dca91 | 73 | pv/view/header.h |
ccdd3ef5 | 74 | pv/view/ruler.h |
cdf7bea7 JH |
75 | pv/view/view.h |
76 | pv/view/viewport.h | |
df944399 JH |
77 | ) |
78 | ||
a8d3fb2d | 79 | set(pulseview_FORMS |
51e77110 | 80 | pv/about.ui |
df944399 JH |
81 | ) |
82 | ||
a8d3fb2d JH |
83 | set(pulseview_RESOURCES |
84 | pulseview.qrc | |
df944399 JH |
85 | ) |
86 | ||
a8d3fb2d | 87 | set(pulseview_TEST_SOURCES |
51e77110 JH |
88 | pv/datasnapshot.cpp |
89 | pv/logicdatasnapshot.cpp | |
4ceab49a | 90 | test/logicdatasnapshot.cpp |
f0fa92c6 JH |
91 | test/test.cpp |
92 | ) | |
93 | ||
a8d3fb2d JH |
94 | qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}) |
95 | qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS}) | |
96 | qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) | |
df944399 JH |
97 | |
98 | include(${QT_USE_FILE}) | |
99 | ||
30588653 AG |
100 | #=============================================================================== |
101 | #= Global Definitions | |
102 | #------------------------------------------------------------------------------- | |
103 | ||
df944399 JH |
104 | add_definitions(${QT_DEFINITIONS}) |
105 | add_definitions(-DAPP_VERSION="${VERSION}") | |
106 | ||
30588653 AG |
107 | #=============================================================================== |
108 | #= Global Include Directories | |
109 | #------------------------------------------------------------------------------- | |
110 | ||
c0d9e65d UH |
111 | # On Windows/MinGW we need PKGDEPS_STATIC_INCLUDE_DIRS. |
112 | if(WIN32) | |
951c583c JH |
113 | include_directories( |
114 | ${include_directories} | |
115 | ${CMAKE_CURRENT_BINARY_DIR} | |
116 | ${Boost_INCLUDE_DIRS} | |
117 | ${PKGDEPS_STATIC_INCLUDE_DIRS} | |
118 | ) | |
c0d9e65d | 119 | else(WIN32) |
951c583c JH |
120 | include_directories( |
121 | ${include_directories} | |
122 | ${CMAKE_CURRENT_BINARY_DIR} | |
123 | ${Boost_INCLUDE_DIRS} | |
124 | ${PKGDEPS_INCLUDE_DIRS} | |
125 | ) | |
c0d9e65d | 126 | endif(WIN32) |
df944399 | 127 | |
30588653 AG |
128 | #=============================================================================== |
129 | #= Linker Configuration | |
130 | #------------------------------------------------------------------------------- | |
131 | ||
c0d9e65d UH |
132 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS. |
133 | if(WIN32) | |
951c583c JH |
134 | link_directories( |
135 | ${Boost_LIBRARY_DIRS} | |
136 | ${PKGDEPS_STATIC_LIBRARY_DIRS} | |
137 | ) | |
c0d9e65d | 138 | else(WIN32) |
951c583c JH |
139 | link_directories( |
140 | ${Boost_LIBRARY_DIRS} | |
141 | ${PKGDEPS_LIBRARY_DIRS} | |
142 | ) | |
c0d9e65d | 143 | endif(WIN32) |
df944399 | 144 | |
a8d3fb2d JH |
145 | add_executable(pulseview |
146 | ${pulseview_SOURCES} | |
147 | ${pulseview_HEADERS_MOC} | |
148 | ${pulseview_FORMS_HEADERS} | |
149 | ${pulseview_RESOURCES_RCC} | |
df944399 JH |
150 | ) |
151 | ||
c0d9e65d UH |
152 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES. |
153 | if(WIN32) | |
951c583c JH |
154 | target_link_libraries(pulseview |
155 | ${Boost_LIBRARIES} | |
156 | ${PKGDEPS_STATIC_LIBRARIES} | |
157 | ${QT_LIBRARIES} | |
158 | ) | |
c0d9e65d | 159 | else(WIN32) |
951c583c JH |
160 | target_link_libraries(pulseview |
161 | ${Boost_LIBRARIES} | |
162 | ${PKGDEPS_LIBRARIES} | |
163 | ${QT_LIBRARIES} | |
164 | ) | |
c0d9e65d | 165 | endif(WIN32) |
f0fa92c6 | 166 | |
30588653 AG |
167 | #=============================================================================== |
168 | #= Installation | |
169 | #------------------------------------------------------------------------------- | |
170 | ||
bc1c1462 JH |
171 | install(PROGRAMS pulseview DESTINATION bin/) |
172 | ||
30588653 AG |
173 | #=============================================================================== |
174 | #= Tests | |
175 | #------------------------------------------------------------------------------- | |
176 | ||
77e8ac52 JH |
177 | if(ENABLE_TESTS) |
178 | ||
951c583c JH |
179 | add_definitions(-DBOOST_TEST_DYN_LINK) |
180 | ||
181 | add_executable(pulseview-test | |
182 | ${pulseview_TEST_SOURCES} | |
183 | ) | |
184 | ||
185 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES. | |
186 | if(WIN32) | |
187 | target_link_libraries(pulseview-test | |
188 | ${Boost_LIBRARIES} | |
189 | ${PKGDEPS_STATIC_LIBRARIES} | |
190 | ${QT_LIBRARIES} | |
191 | ) | |
192 | else(WIN32) | |
193 | target_link_libraries(pulseview-test | |
194 | ${Boost_LIBRARIES} | |
195 | ${PKGDEPS_LIBRARIES} | |
196 | ${QT_LIBRARIES} | |
197 | ) | |
198 | endif(WIN32) | |
199 | ||
200 | enable_testing() | |
201 | add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test) | |
0615f1b6 | 202 | |
77e8ac52 | 203 | endif(ENABLE_TESTS) |