]> sigrok.org Git - pulseview.git/blame_incremental - CMakeLists.txt
Added a copyright header to CMakeLists.txt
[pulseview.git] / CMakeLists.txt
... / ...
CommitLineData
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
20cmake_minimum_required(VERSION 2.6)
21include(FindPkgConfig)
22
23project(pulseview)
24
25find_package(PkgConfig)
26pkg_check_modules(PKGDEPS REQUIRED
27 libsigrokdecode>=0.1.0
28 libsigrok>=0.2.0
29)
30
31# On Windows/MinGW we explicitly point cmake to the Boost directory.
32if(WIN32)
33set(BOOST_ROOT /usr/local)
34endif(WIN32)
35
36find_package(Qt4 REQUIRED)
37find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED)
38
39set(VERSION 0.1.0)
40
41set(pulseview_SOURCES
42 about.cpp
43 datasnapshot.cpp
44 logicdata.cpp
45 logicdatasnapshot.cpp
46 logicsignal.cpp
47 main.cpp
48 mainwindow.cpp
49 samplingbar.cpp
50 signaldata.cpp
51 sigsession.cpp
52 signal.cpp
53 pv/view/header.cpp
54 pv/view/ruler.cpp
55 pv/view/view.cpp
56 pv/view/viewport.cpp
57)
58
59set(pulseview_HEADERS
60 about.h
61 mainwindow.h
62 samplingbar.h
63 sigsession.h
64 pv/view/header.h
65 pv/view/ruler.h
66 pv/view/view.h
67 pv/view/viewport.h
68)
69
70set(pulseview_FORMS
71 about.ui
72)
73
74set(pulseview_RESOURCES
75 pulseview.qrc
76)
77
78set(pulseview_TEST_SOURCES
79 test/logicdatasnapshot.cpp
80 test/test.cpp
81 datasnapshot.cpp
82 logicdatasnapshot.cpp
83)
84
85qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
86qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
87qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
88
89include(${QT_USE_FILE})
90
91add_definitions(${QT_DEFINITIONS})
92add_definitions(-DAPP_VERSION="${VERSION}")
93
94# On Windows/MinGW we need PKGDEPS_STATIC_INCLUDE_DIRS.
95if(WIN32)
96include_directories(
97 ${include_directories}
98 ${Boost_INCLUDE_DIRS}
99 ${PKGDEPS_STATIC_INCLUDE_DIRS}
100)
101else(WIN32)
102include_directories(
103 ${include_directories}
104 ${Boost_INCLUDE_DIRS}
105 ${PKGDEPS_INCLUDE_DIRS}
106)
107endif(WIN32)
108
109# On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS.
110if(WIN32)
111link_directories(
112 ${Boost_LIBRARY_DIRS}
113 ${PKGDEPS_STATIC_LIBRARY_DIRS}
114)
115else(WIN32)
116link_directories(
117 ${Boost_LIBRARY_DIRS}
118 ${PKGDEPS_LIBRARY_DIRS}
119)
120endif(WIN32)
121
122add_executable(pulseview
123 ${pulseview_SOURCES}
124 ${pulseview_HEADERS_MOC}
125 ${pulseview_FORMS_HEADERS}
126 ${pulseview_RESOURCES_RCC}
127)
128
129# On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
130if(WIN32)
131target_link_libraries(pulseview
132 ${Boost_LIBRARIES}
133 ${PKGDEPS_STATIC_LIBRARIES}
134 ${QT_LIBRARIES}
135)
136else(WIN32)
137target_link_libraries(pulseview
138 ${Boost_LIBRARIES}
139 ${PKGDEPS_LIBRARIES}
140 ${QT_LIBRARIES}
141)
142endif(WIN32)
143
144if(ENABLE_TESTS)
145
146add_definitions(-DBOOST_TEST_DYN_LINK)
147
148add_executable(pulseview-test
149 ${pulseview_TEST_SOURCES}
150)
151
152# On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
153if(WIN32)
154target_link_libraries(pulseview-test
155 ${Boost_LIBRARIES}
156 ${PKGDEPS_STATIC_LIBRARIES}
157 ${QT_LIBRARIES}
158)
159else(WIN32)
160target_link_libraries(pulseview-test
161 ${Boost_LIBRARIES}
162 ${PKGDEPS_LIBRARIES}
163 ${QT_LIBRARIES}
164)
165endif(WIN32)
166
167enable_testing()
168add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test)
169
170install(PROGRAMS pulseview DESTINATION bin/)
171
172endif(ENABLE_TESTS)