]> sigrok.org Git - pulseview.git/blob - CMakeLists.txt
885d91895413b6e6ceb13c3df442911f138ed0c5
[pulseview.git] / CMakeLists.txt
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-2013 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
21 cmake_minimum_required(VERSION 2.8.12)
22
23 include(GNUInstallDirs)
24
25 project(pulseview)
26
27 # Let AUTOMOC and AUTOUIC process GENERATED files.
28 if(POLICY CMP0071)
29         cmake_policy(SET CMP0071 NEW)
30 endif()
31
32 # Only interpret if() arguments as variables or keywords when unquoted.
33 if(POLICY CMP0054)
34         cmake_policy(SET CMP0054 NEW)
35 endif()
36
37 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
38
39 #===============================================================================
40 #= User Options
41 #-------------------------------------------------------------------------------
42
43 option(DISABLE_WERROR "Build without -Werror" TRUE)
44 option(ENABLE_SIGNALS "Build with UNIX signals" TRUE)
45 option(ENABLE_STACKTRACE "Enable stack trace when crashing" FALSE)
46 option(ENABLE_DECODE "Build with libsigrokdecode" TRUE)
47 option(ENABLE_FLOW "Build with libsigrokflow" FALSE)
48 option(ENABLE_TESTS "Enable unit tests" FALSE)
49 option(STATIC_PKGDEPS_LIBS "Statically link to (pkg-config) libraries" FALSE)
50
51 if(WIN32)
52         # On Windows/MinGW we need to statically link to libraries.
53         # This option is user configurable, but enable it by default on win32.
54         set(STATIC_PKGDEPS_LIBS TRUE)
55
56         # Windows does not support UNIX signals.
57         set(ENABLE_SIGNALS FALSE)
58 endif()
59
60 if(NOT CMAKE_BUILD_TYPE)
61         set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
62         "Choose the type of build (None, Debug, Release, RelWithDebInfo, MinSizeRel)."
63         FORCE)
64 endif()
65
66 #===============================================================================
67 #= Documentation
68 #-------------------------------------------------------------------------------
69
70 add_subdirectory(manual)
71
72 #===============================================================================
73 #= Dependencies
74 #-------------------------------------------------------------------------------
75
76 list(APPEND PKGDEPS glib-2.0>=2.28.0)
77 list(APPEND PKGDEPS glibmm-2.4>=2.28.0)
78
79 if(ENABLE_FLOW)
80         list(APPEND PKGDEPS gstreamermm-1.0>=1.8.0)
81         list(APPEND PKGDEPS libsigrokflow>=0.1.0)
82 endif()
83
84 set(LIBSR_CXX_BINDING "libsigrokcxx>=0.5.1")
85 list(APPEND PKGDEPS "${LIBSR_CXX_BINDING}")
86
87 if(ENABLE_DECODE)
88         list(APPEND PKGDEPS libsigrokdecode>=0.5.2)
89 endif()
90
91 if(ANDROID)
92         list(APPEND PKGDEPS libsigrokandroidutils>=0.1.0)
93 endif()
94
95 find_package(PkgConfig)
96 pkg_check_modules(LIBSRCXX ${LIBSR_CXX_BINDING})
97 if(NOT LIBSRCXX_FOUND OR NOT LIBSRCXX_VERSION)
98         message(FATAL_ERROR "libsigrok C++ bindings missing, check libsigrok's 'configure' output (missing dependencies?)")
99 endif()
100 pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
101
102 set(CMAKE_AUTOMOC TRUE)
103
104 find_package(Qt5 5.3 COMPONENTS Core Gui LinguistTools Widgets Svg REQUIRED)
105
106 message(STATUS "Qt version: ${Qt5_VERSION}")
107
108 if(WIN32)
109         # MXE workaround: Use pkg-config to find Qt5 libs.
110         # https://github.com/mxe/mxe/issues/1642
111         # Not required (and doesn't work) on MSYS2.
112         if(NOT DEFINED ENV{MSYSTEM})
113                 pkg_check_modules(QT5ALL REQUIRED Qt5Widgets>=5.3 Qt5Gui>=5.3 Qt5Svg>=5.3)
114         endif()
115 endif()
116
117 set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg)
118
119 set(BOOSTCOMPS filesystem serialization system)
120 if(ENABLE_TESTS)
121         list(APPEND BOOSTCOMPS unit_test_framework)
122 endif()
123
124 if(ENABLE_STACKTRACE)
125         find_package(Boost 1.65.1 COMPONENTS ${BOOSTCOMPS} REQUIRED)
126 else()
127         find_package(Boost 1.55 COMPONENTS ${BOOSTCOMPS} REQUIRED)
128 endif()
129
130 # Find the platform's thread library (needed for C++11 threads).
131 # This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value.
132 find_package(Threads REQUIRED)
133
134 # Check for explicit link against libatomic
135 #
136 # Depending on the toolchain, linking a program using atomic functions may need
137 # "-latomic" explicitly passed to the linker
138 #
139 # This check first tests if atomics are available in the C-library, if not and
140 # libatomic exists, then it runs the same test with -latomic added to the
141 # linker flags.
142
143 # Helper for checking for atomics
144 function(check_working_cxx_atomics varname additional_lib)
145   include(CheckCXXSourceCompiles)
146   include(CMakePushCheckState)
147   cmake_push_check_state()
148   set(CMAKE_REQUIRED_FLAGS "-std=c++11")
149   set(CMAKE_REQUIRED_LIBRARIES "${additional_lib}")
150   set(CMAKE_REQUIRED_QUIET 1)
151   CHECK_CXX_SOURCE_COMPILES("
152 #include <atomic>
153 std::atomic<int> x;
154 int main() {
155   return std::atomic_fetch_add_explicit(&x, 1, std::memory_order_seq_cst);
156 }
157 " ${varname})
158   cmake_pop_check_state()
159 endfunction(check_working_cxx_atomics)
160
161 # First check if atomics work without the library.
162 # If not, check if the library exists, and atomics work with it.
163 check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB "")
164 if(HAVE_CXX_ATOMICS_WITHOUT_LIB)
165   message(STATUS "Atomics provided by the C-library - yes")
166 else()
167   message(STATUS "Atomics provided by the C-library - no")
168   find_library(LIBATOMIC_LIBRARY NAMES atomic PATH_SUFFIXES lib)
169   if(LIBATOMIC_LIBRARY)
170     check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB "${LIBATOMIC_LIBRARY}")
171     if (HAVE_CXX_ATOMICS_WITH_LIB)
172       message(STATUS "Atomics provided by libatomic - yes")
173     else()
174       message(STATUS "Atomics provided by libatomic - no")
175       message(FATAL_ERROR "Compiler must support std::atomic!")
176     endif()
177   else()
178     message(FATAL_ERROR "Compiler appears to require libatomic, but cannot find it.")
179   endif()
180 endif()
181
182 #===============================================================================
183 #= System Introspection
184 #-------------------------------------------------------------------------------
185
186 include(memaccess)
187 memaccess_check_unaligned_le(HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS)
188
189 #===============================================================================
190 #= Config Header
191 #-------------------------------------------------------------------------------
192
193 set(PV_TITLE PulseView)
194 set(PV_VERSION_STRING "0.5.0")
195
196 set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION})
197
198 include(GetGitRevisionDescription)
199
200 # Append the revision hash unless we are exactly on a tagged release.
201 git_describe(PV_TAG_VERSION_STRING --match "pulseview-${PV_VERSION_STRING}" --exact-match)
202 if(NOT PV_TAG_VERSION_STRING)
203         get_git_head_revision(PV_REVSPEC PV_HASH)
204         if(PV_HASH)
205                 string(SUBSTRING "${PV_HASH}" 0 7 PV_SHORTHASH)
206                 set(PV_VERSION_STRING "${PV_VERSION_STRING}-git-${PV_SHORTHASH}")
207         endif()
208
209         # Non-tagged releases use the unstable manual
210         set(PV_MANUAL_VERSION "unstable")
211 else()
212         # Tagged releases use a fixed manual version
213         set(PV_MANUAL_VERSION ${PV_VERSION_STRING})
214 endif()
215
216 if(PV_VERSION_STRING MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[-0-9a-z]*)?$")
217         set(PV_VERSION_MAJOR ${CMAKE_MATCH_1})
218         set(PV_VERSION_MINOR ${CMAKE_MATCH_2})
219         set(PV_VERSION_MICRO ${CMAKE_MATCH_3})
220         set(PV_VERSION_SUFFIX ${CMAKE_MATCH_4})
221 endif()
222
223 message(STATUS "${PV_TITLE} version: ${PV_VERSION_STRING}")
224
225 configure_file (
226         ${PROJECT_SOURCE_DIR}/config.h.in
227         ${PROJECT_BINARY_DIR}/config.h
228 )
229
230 #===============================================================================
231 #= Sources
232 #-------------------------------------------------------------------------------
233
234 set(pulseview_SOURCES
235         main.cpp
236         pv/application.cpp
237         pv/devicemanager.cpp
238         pv/globalsettings.cpp
239         pv/logging.cpp
240         pv/mainwindow.cpp
241         pv/session.cpp
242         pv/storesession.cpp
243         pv/util.cpp
244         pv/binding/binding.cpp
245         pv/binding/inputoutput.cpp
246         pv/binding/device.cpp
247         pv/data/analog.cpp
248         pv/data/analogsegment.cpp
249         pv/data/logic.cpp
250         pv/data/logicsegment.cpp
251         pv/data/signalbase.cpp
252         pv/data/signaldata.cpp
253         pv/data/segment.cpp
254         pv/devices/device.cpp
255         pv/devices/file.cpp
256         pv/devices/hardwaredevice.cpp
257         pv/devices/inputfile.cpp
258         pv/devices/sessionfile.cpp
259         pv/dialogs/connect.cpp
260         pv/dialogs/inputoutputoptions.cpp
261         pv/dialogs/settings.cpp
262         pv/dialogs/storeprogress.cpp
263         pv/popups/deviceoptions.cpp
264         pv/popups/channels.cpp
265         pv/prop/bool.cpp
266         pv/prop/double.cpp
267         pv/prop/enum.cpp
268         pv/prop/int.cpp
269         pv/prop/property.cpp
270         pv/prop/string.cpp
271         pv/subwindows/subwindowbase.cpp
272         pv/toolbars/mainbar.cpp
273         pv/views/trace/analogsignal.cpp
274         pv/views/trace/cursor.cpp
275         pv/views/trace/cursorpair.cpp
276         pv/views/trace/flag.cpp
277         pv/views/trace/header.cpp
278         pv/views/trace/marginwidget.cpp
279         pv/views/trace/logicsignal.cpp
280         pv/views/trace/ruler.cpp
281         pv/views/trace/signal.cpp
282         pv/views/trace/timeitem.cpp
283         pv/views/trace/timemarker.cpp
284         pv/views/trace/trace.cpp
285         pv/views/trace/tracegroup.cpp
286         pv/views/trace/tracepalette.cpp
287         pv/views/trace/tracetreeitem.cpp
288         pv/views/trace/tracetreeitemowner.cpp
289         pv/views/trace/triggermarker.cpp
290         pv/views/trace/view.cpp
291         pv/views/trace/viewitem.cpp
292         pv/views/trace/viewitemowner.cpp
293         pv/views/trace/viewitempaintparams.cpp
294         pv/views/trace/viewport.cpp
295         pv/views/trace/viewwidget.cpp
296         pv/views/viewbase.cpp
297         pv/views/trace/standardbar.cpp
298         pv/widgets/colorbutton.cpp
299         pv/widgets/colorpopup.cpp
300         pv/widgets/devicetoolbutton.cpp
301         pv/widgets/exportmenu.cpp
302         pv/widgets/flowlayout.cpp
303         pv/widgets/importmenu.cpp
304         pv/widgets/popup.cpp
305         pv/widgets/popuptoolbutton.cpp
306         pv/widgets/sweeptimingwidget.cpp
307         pv/widgets/timestampspinbox.cpp
308         pv/widgets/wellarray.cpp
309 )
310
311 # This list includes only QObject derived class headers.
312 set(pulseview_HEADERS
313         pv/logging.hpp
314         pv/globalsettings.hpp
315         pv/mainwindow.hpp
316         pv/session.hpp
317         pv/storesession.hpp
318         pv/binding/device.hpp
319         pv/data/analog.hpp
320         pv/data/analogsegment.hpp
321         pv/data/logic.hpp
322         pv/data/logicsegment.hpp
323         pv/data/signalbase.hpp
324         pv/dialogs/connect.hpp
325         pv/dialogs/inputoutputoptions.hpp
326         pv/dialogs/settings.hpp
327         pv/dialogs/storeprogress.hpp
328         pv/popups/channels.hpp
329         pv/popups/deviceoptions.hpp
330         pv/prop/bool.hpp
331         pv/prop/double.hpp
332         pv/prop/enum.hpp
333         pv/prop/int.hpp
334         pv/prop/property.hpp
335         pv/prop/string.hpp
336         pv/subwindows/subwindowbase.hpp
337         pv/toolbars/mainbar.hpp
338         pv/views/trace/analogsignal.hpp
339         pv/views/trace/cursor.hpp
340         pv/views/trace/flag.hpp
341         pv/views/trace/header.hpp
342         pv/views/trace/logicsignal.hpp
343         pv/views/trace/marginwidget.hpp
344         pv/views/trace/ruler.hpp
345         pv/views/trace/signal.hpp
346         pv/views/trace/timeitem.hpp
347         pv/views/trace/timemarker.hpp
348         pv/views/trace/trace.hpp
349         pv/views/trace/tracegroup.hpp
350         pv/views/trace/tracetreeitem.hpp
351         pv/views/trace/triggermarker.hpp
352         pv/views/trace/view.hpp
353         pv/views/trace/viewitem.hpp
354         pv/views/trace/viewport.hpp
355         pv/views/trace/viewwidget.hpp
356         pv/views/viewbase.hpp
357         pv/views/trace/standardbar.hpp
358         pv/widgets/colorbutton.hpp
359         pv/widgets/colorpopup.hpp
360         pv/widgets/devicetoolbutton.hpp
361         pv/widgets/exportmenu.hpp
362         pv/widgets/flowlayout.hpp
363         pv/widgets/importmenu.hpp
364         pv/widgets/popup.hpp
365         pv/widgets/popuptoolbutton.hpp
366         pv/widgets/sweeptimingwidget.hpp
367         pv/widgets/timestampspinbox.hpp
368         pv/widgets/wellarray.hpp
369 )
370
371 set(pulseview_RESOURCES
372         pulseview.qrc
373 )
374
375 if(ENABLE_SIGNALS)
376         list(APPEND pulseview_SOURCES signalhandler.cpp)
377         list(APPEND pulseview_HEADERS signalhandler.hpp)
378 endif()
379
380 if(ENABLE_DECODE)
381         list(APPEND pulseview_SOURCES
382                 pv/binding/decoder.cpp
383                 pv/data/decodesignal.cpp
384                 pv/data/decode/annotation.cpp
385                 pv/data/decode/decoder.cpp
386                 pv/data/decode/row.cpp
387                 pv/data/decode/rowdata.cpp
388                 pv/subwindows/decoder_selector/item.cpp
389                 pv/subwindows/decoder_selector/model.cpp
390                 pv/subwindows/decoder_selector/subwindow.cpp
391                 pv/views/decoder_output/view.cpp
392                 pv/views/decoder_output/QHexView.cpp
393                 pv/views/trace/decodetrace.cpp
394                 pv/widgets/decodergroupbox.cpp
395                 pv/widgets/decodermenu.cpp
396         )
397
398         list(APPEND pulseview_HEADERS
399                 pv/data/decodesignal.hpp
400                 pv/subwindows/decoder_selector/subwindow.hpp
401                 pv/views/decoder_output/view.hpp
402                 pv/views/decoder_output/QHexView.hpp
403                 pv/views/trace/decodetrace.hpp
404                 pv/widgets/decodergroupbox.hpp
405                 pv/widgets/decodermenu.hpp
406         )
407 endif()
408
409 if(WIN32)
410         # Use the sigrok icon for the pulseview.exe executable.
411         set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} <SOURCE> <OBJECT>")
412         enable_language(RC)
413         list(APPEND pulseview_SOURCES pulseviewico.rc)
414 endif()
415
416 if(ANDROID)
417         list(APPEND pulseview_SOURCES
418                 android/assetreader.cpp
419                 android/loghandler.cpp
420         )
421 endif()
422
423 qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
424
425 #===============================================================================
426 #= Translations
427 #-------------------------------------------------------------------------------
428
429 file(GLOB TS_FILES l10n/*.ts)
430 set_property(SOURCE ${TS_FILES} PROPERTY OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/l10n)
431
432 qt5_add_translation(QM_FILES ${TS_FILES})
433 qt5_create_translation(QM_FILES ${pulseview_SOURCES} ${TS_FILES})
434
435 qt5_add_resources(pulseview_RESOURCES_RCC translations.qrc)
436
437 #===============================================================================
438 #= Global Definitions
439 #-------------------------------------------------------------------------------
440
441 add_definitions(-DQT_NO_KEYWORDS)
442 add_definitions(-D__STDC_LIMIT_MACROS)
443 add_definitions(-Wall -Wextra)
444 add_definitions(-std=c++11)
445 add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1)
446
447 if(ENABLE_FLOW)
448         add_definitions(-DENABLE_FLOW)
449 endif()
450
451 if(ENABLE_DECODE)
452         add_definitions(-DENABLE_DECODE)
453 endif()
454
455 if(NOT DISABLE_WERROR)
456         add_definitions(-Werror)
457 endif()
458
459 if(ENABLE_SIGNALS)
460         add_definitions(-DENABLE_SIGNALS)
461 endif()
462
463 if(ENABLE_STACKTRACE)
464         add_definitions(-DENABLE_STACKTRACE)
465 endif()
466
467 #===============================================================================
468 #= Global Include Directories
469 #-------------------------------------------------------------------------------
470
471 include_directories(
472         ${CMAKE_CURRENT_BINARY_DIR}
473         ${CMAKE_CURRENT_SOURCE_DIR}
474         ${Boost_INCLUDE_DIRS}
475 )
476
477 if(STATIC_PKGDEPS_LIBS)
478         include_directories(${PKGDEPS_STATIC_INCLUDE_DIRS})
479 else()
480         include_directories(${PKGDEPS_INCLUDE_DIRS})
481 endif()
482
483 #===============================================================================
484 #= Linker Configuration
485 #-------------------------------------------------------------------------------
486
487 link_directories(${Boost_LIBRARY_DIRS})
488
489 set(PULSEVIEW_LINK_LIBS
490         ${Boost_LIBRARIES}
491         ${QT_LIBRARIES}
492         ${CMAKE_THREAD_LIBS_INIT}
493         ${LIBATOMIC_LIBRARY}
494 )
495
496 if(STATIC_PKGDEPS_LIBS)
497         link_directories(${PKGDEPS_STATIC_LIBRARY_DIRS})
498         list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LDFLAGS})
499 else()
500         link_directories(${PKGDEPS_LIBRARY_DIRS})
501         list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES})
502 endif()
503
504 if(WIN32)
505         # On Windows we need to statically link the libqsvg imageformat
506         # plugin (and the QtSvg component) for SVG graphics/icons to work.
507         # We also need QWindowsIntegrationPlugin, Qt5PlatformSupport (only for
508         # Qt < 5.8.0), and all Qt libs and their dependencies.
509         add_definitions(-DQT_STATICPLUGIN)
510         list(APPEND PULSEVIEW_LINK_LIBS Qt5::QSvgPlugin)
511         list(APPEND PULSEVIEW_LINK_LIBS Qt5::QWindowsIntegrationPlugin)
512         if(Qt5Gui_VERSION VERSION_LESS 5.8.0)
513                 list(APPEND PULSEVIEW_LINK_LIBS -lQt5PlatformSupport)
514         endif()
515         list(APPEND PULSEVIEW_LINK_LIBS ${QT5ALL_LDFLAGS})
516 endif()
517
518 if(ENABLE_STACKTRACE)
519         # Needed to resolve dladdr.
520         list(APPEND PULSEVIEW_LINK_LIBS "-ldl")
521 endif()
522
523 if(ANDROID)
524         list(APPEND PULSEVIEW_LINK_LIBS "-llog")
525 endif()
526
527 if(ANDROID)
528         add_library(${PROJECT_NAME} SHARED ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES})
529 else()
530         add_executable(${PROJECT_NAME} ${pulseview_SOURCES} ${pulseview_RESOURCES_RCC} ${QM_FILES})
531 endif()
532
533 target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS})
534
535 if(WIN32 AND NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
536         # Pass -mwindows so that no "DOS box" opens when PulseView is started.
537         set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows")
538 endif()
539
540 #===============================================================================
541 #= Installation
542 #-------------------------------------------------------------------------------
543
544 # Install the executable.
545 install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
546
547 # Install the manpage.
548 install(FILES doc/pulseview.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
549
550 # Install the desktop file.
551 install(FILES contrib/org.sigrok.PulseView.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
552
553 # Install the AppData/AppStream file.
554 install(FILES contrib/org.sigrok.PulseView.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
555
556 # Install the PulseView icons.
557 install(FILES icons/pulseview.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps)
558 install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
559
560 # Generate Windows installer script.
561 configure_file(contrib/pulseview_cross.nsi.in ${CMAKE_CURRENT_BINARY_DIR}/contrib/pulseview_cross.nsi @ONLY)
562
563 #===============================================================================
564 #= Packaging (handled by CPack)
565 #-------------------------------------------------------------------------------
566
567 set(CPACK_PACKAGE_VERSION_MAJOR ${PV_VERSION_MAJOR})
568 set(CPACK_PACKAGE_VERSION_MINOR ${PV_VERSION_MINOR})
569 set(CPACK_PACKAGE_VERSION_PATCH ${PV_VERSION_MICRO})
570 set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
571 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
572 set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_CURRENT_BINARY_DIR} ".gitignore" ".git")
573 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PV_VERSION_STRING}")
574 set(CPACK_SOURCE_GENERATOR "TGZ")
575
576 include(CPack)
577
578 #===============================================================================
579 #= Tests
580 #-------------------------------------------------------------------------------
581
582 if(ENABLE_TESTS)
583         add_subdirectory(test)
584         enable_testing()
585         add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/pulseview-test)
586 endif()