]>
Commit | Line | Data |
---|---|---|
68c4a3b3 JH |
1 | ## |
2 | ## This file is part of pulseview | |
3 | ## | |
4 | ## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk> | |
5 | ## | |
6 | ## This program is free software: you can redistribute it and/or modify | |
7 | ## it under the terms of the GNU General Public License as published by | |
8 | ## the Free Software Foundation, either version 2 of the License, or | |
9 | ## (at your option) any later version. | |
10 | ## | |
11 | ## This program is distributed in the hope that it will be useful, | |
12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ## GNU General Public License for more details. | |
15 | ## | |
16 | ## You should have received a copy of the GNU General Public License | |
17 | ## along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | ## | |
19 | ||
df944399 JH |
20 | cmake_minimum_required(VERSION 2.6) |
21 | include(FindPkgConfig) | |
22 | ||
a8d3fb2d | 23 | project(pulseview) |
df944399 JH |
24 | |
25 | find_package(PkgConfig) | |
26 | pkg_check_modules(PKGDEPS REQUIRED | |
27 | libsigrokdecode>=0.1.0 | |
0dfbf7ff | 28 | libsigrok>=0.2.0 |
df944399 JH |
29 | ) |
30 | ||
4cd24a75 UH |
31 | # On Windows/MinGW we explicitly point cmake to the Boost directory. |
32 | if(WIN32) | |
33 | set(BOOST_ROOT /usr/local) | |
34 | endif(WIN32) | |
35 | ||
df944399 | 36 | find_package(Qt4 REQUIRED) |
f0fa92c6 | 37 | find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED) |
df944399 JH |
38 | |
39 | set(VERSION 0.1.0) | |
40 | ||
a8d3fb2d | 41 | set(pulseview_SOURCES |
df944399 | 42 | about.cpp |
28a4c9c5 JH |
43 | datasnapshot.cpp |
44 | logicdata.cpp | |
45 | logicdatasnapshot.cpp | |
46 | logicsignal.cpp | |
df944399 JH |
47 | main.cpp |
48 | mainwindow.cpp | |
d4984fe7 | 49 | samplingbar.cpp |
28a4c9c5 | 50 | signaldata.cpp |
2953961c | 51 | sigsession.cpp |
28a4c9c5 | 52 | signal.cpp |
1d8dca91 | 53 | pv/view/header.cpp |
ccdd3ef5 | 54 | pv/view/ruler.cpp |
cdf7bea7 JH |
55 | pv/view/view.cpp |
56 | pv/view/viewport.cpp | |
df944399 JH |
57 | ) |
58 | ||
a8d3fb2d | 59 | set(pulseview_HEADERS |
df944399 JH |
60 | about.h |
61 | mainwindow.h | |
d4984fe7 | 62 | samplingbar.h |
2953961c | 63 | sigsession.h |
1d8dca91 | 64 | pv/view/header.h |
ccdd3ef5 | 65 | pv/view/ruler.h |
cdf7bea7 JH |
66 | pv/view/view.h |
67 | pv/view/viewport.h | |
df944399 JH |
68 | ) |
69 | ||
a8d3fb2d | 70 | set(pulseview_FORMS |
df944399 | 71 | about.ui |
df944399 JH |
72 | ) |
73 | ||
a8d3fb2d JH |
74 | set(pulseview_RESOURCES |
75 | pulseview.qrc | |
df944399 JH |
76 | ) |
77 | ||
a8d3fb2d | 78 | set(pulseview_TEST_SOURCES |
4ceab49a | 79 | test/logicdatasnapshot.cpp |
f0fa92c6 | 80 | test/test.cpp |
4780b4c8 JH |
81 | datasnapshot.cpp |
82 | logicdatasnapshot.cpp | |
f0fa92c6 JH |
83 | ) |
84 | ||
a8d3fb2d JH |
85 | qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}) |
86 | qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS}) | |
87 | qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) | |
df944399 JH |
88 | |
89 | include(${QT_USE_FILE}) | |
90 | ||
91 | add_definitions(${QT_DEFINITIONS}) | |
92 | add_definitions(-DAPP_VERSION="${VERSION}") | |
93 | ||
c0d9e65d UH |
94 | # On Windows/MinGW we need PKGDEPS_STATIC_INCLUDE_DIRS. |
95 | if(WIN32) | |
96 | include_directories( | |
97 | ${include_directories} | |
98 | ${Boost_INCLUDE_DIRS} | |
99 | ${PKGDEPS_STATIC_INCLUDE_DIRS} | |
100 | ) | |
101 | else(WIN32) | |
df944399 JH |
102 | include_directories( |
103 | ${include_directories} | |
fc645aa3 | 104 | ${Boost_INCLUDE_DIRS} |
df944399 JH |
105 | ${PKGDEPS_INCLUDE_DIRS} |
106 | ) | |
c0d9e65d | 107 | endif(WIN32) |
df944399 | 108 | |
c0d9e65d UH |
109 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS. |
110 | if(WIN32) | |
111 | link_directories( | |
112 | ${Boost_LIBRARY_DIRS} | |
113 | ${PKGDEPS_STATIC_LIBRARY_DIRS} | |
114 | ) | |
115 | else(WIN32) | |
df944399 | 116 | link_directories( |
fc645aa3 | 117 | ${Boost_LIBRARY_DIRS} |
df944399 JH |
118 | ${PKGDEPS_LIBRARY_DIRS} |
119 | ) | |
c0d9e65d | 120 | endif(WIN32) |
df944399 | 121 | |
a8d3fb2d JH |
122 | add_executable(pulseview |
123 | ${pulseview_SOURCES} | |
124 | ${pulseview_HEADERS_MOC} | |
125 | ${pulseview_FORMS_HEADERS} | |
126 | ${pulseview_RESOURCES_RCC} | |
df944399 JH |
127 | ) |
128 | ||
c0d9e65d UH |
129 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES. |
130 | if(WIN32) | |
131 | target_link_libraries(pulseview | |
132 | ${Boost_LIBRARIES} | |
133 | ${PKGDEPS_STATIC_LIBRARIES} | |
134 | ${QT_LIBRARIES} | |
135 | ) | |
136 | else(WIN32) | |
a8d3fb2d | 137 | target_link_libraries(pulseview |
fc645aa3 | 138 | ${Boost_LIBRARIES} |
df944399 JH |
139 | ${PKGDEPS_LIBRARIES} |
140 | ${QT_LIBRARIES} | |
141 | ) | |
c0d9e65d | 142 | endif(WIN32) |
f0fa92c6 | 143 | |
77e8ac52 JH |
144 | if(ENABLE_TESTS) |
145 | ||
f0fa92c6 JH |
146 | add_definitions(-DBOOST_TEST_DYN_LINK) |
147 | ||
a8d3fb2d JH |
148 | add_executable(pulseview-test |
149 | ${pulseview_TEST_SOURCES} | |
f0fa92c6 JH |
150 | ) |
151 | ||
c0d9e65d UH |
152 | # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES. |
153 | if(WIN32) | |
154 | target_link_libraries(pulseview-test | |
155 | ${Boost_LIBRARIES} | |
156 | ${PKGDEPS_STATIC_LIBRARIES} | |
157 | ${QT_LIBRARIES} | |
158 | ) | |
159 | else(WIN32) | |
a8d3fb2d | 160 | target_link_libraries(pulseview-test |
f0fa92c6 | 161 | ${Boost_LIBRARIES} |
4780b4c8 JH |
162 | ${PKGDEPS_LIBRARIES} |
163 | ${QT_LIBRARIES} | |
f0fa92c6 | 164 | ) |
c0d9e65d | 165 | endif(WIN32) |
f0fa92c6 JH |
166 | |
167 | enable_testing() | |
a8d3fb2d | 168 | add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test) |
0615f1b6 JH |
169 | |
170 | install(PROGRAMS pulseview DESTINATION bin/) | |
77e8ac52 JH |
171 | |
172 | endif(ENABLE_TESTS) |