]> sigrok.org Git - pulseview.git/blob - CMakeLists.txt
3d26b236569def367d0a446519aa26e998c9e55a
[pulseview.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 include(FindPkgConfig)
3
4 project(pulseview)
5
6 find_package(PkgConfig)
7 pkg_check_modules(PKGDEPS REQUIRED
8         libsigrokdecode>=0.1.0
9         libsigrok>=0.1.0
10 )
11
12 find_package(Qt4 REQUIRED)
13 find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED)
14
15 set(VERSION 0.1.0)
16
17 set(pulseview_SOURCES
18         about.cpp
19         datasnapshot.cpp
20         logicdata.cpp
21         logicdatasnapshot.cpp
22         logicsignal.cpp
23         main.cpp
24         mainwindow.cpp
25         samplingbar.cpp
26         signaldata.cpp
27         sigsession.cpp
28         signal.cpp
29         pv/view/header.cpp
30         pv/view/ruler.cpp
31         pv/view/view.cpp
32         pv/view/viewport.cpp
33 )
34
35 set(pulseview_HEADERS
36         about.h
37         mainwindow.h
38         samplingbar.h
39         sigsession.h
40         pv/view/header.h
41         pv/view/ruler.h
42         pv/view/view.h
43         pv/view/viewport.h
44 )
45
46 set(pulseview_FORMS
47         about.ui
48 )
49
50 set(pulseview_RESOURCES
51         pulseview.qrc
52 )
53
54 set(pulseview_TEST_SOURCES
55         test/logicdatasnapshot.cpp
56         test/test.cpp
57         datasnapshot.cpp
58         logicdatasnapshot.cpp
59 )
60
61 set(QT_USE_QTOPENGL TRUE)
62
63 qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
64 qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
65 qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
66
67 include(${QT_USE_FILE})
68
69 add_definitions(${QT_DEFINITIONS})
70 add_definitions(-DAPP_VERSION="${VERSION}")
71
72 include_directories(
73         ${include_directories}
74         ${Boost_INCLUDE_DIRS}
75         ${PKGDEPS_INCLUDE_DIRS}
76 )
77
78 link_directories(
79         ${Boost_LIBRARY_DIRS}
80         ${PKGDEPS_LIBRARY_DIRS}
81 )
82
83 add_executable(pulseview
84         ${pulseview_SOURCES}
85         ${pulseview_HEADERS_MOC}
86         ${pulseview_FORMS_HEADERS}
87         ${pulseview_RESOURCES_RCC}
88 )
89
90 target_link_libraries(pulseview
91         ${Boost_LIBRARIES}
92         ${PKGDEPS_LIBRARIES}
93         ${QT_LIBRARIES}
94 )
95
96 add_definitions(-DBOOST_TEST_DYN_LINK)
97
98 add_executable(pulseview-test
99         ${pulseview_TEST_SOURCES}
100 )
101
102 target_link_libraries(pulseview-test
103         ${Boost_LIBRARIES}
104         ${PKGDEPS_LIBRARIES}
105         ${QT_LIBRARIES}
106 )
107
108 enable_testing()
109 add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test)