Initial tests for LogicDataSnapshot
[pulseview.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 include(FindPkgConfig)
3
4 project(sigrok-qt2)
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(sigrok-qt2_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         sigview.cpp
30 )
31
32 set(sigrok-qt2_HEADERS
33         about.h
34         mainwindow.h
35         samplingbar.h
36         sigsession.h
37         sigview.h
38 )
39
40 set(sigrok-qt2_FORMS
41         about.ui
42 )
43
44 set(sigrok-qt2_RESOURCES
45         sigrok-qt2.qrc
46 )
47
48 set(sigrok-qt2_TEST_SOURCES
49         test/test.cpp
50         datasnapshot.cpp
51         logicdatasnapshot.cpp
52 )
53
54 set(QT_USE_QTOPENGL TRUE)
55
56 qt4_wrap_cpp(sigrok-qt2_HEADERS_MOC ${sigrok-qt2_HEADERS})
57 qt4_wrap_ui(sigrok-qt2_FORMS_HEADERS ${sigrok-qt2_FORMS})
58 qt4_add_resources(sigrok-qt2_RESOURCES_RCC ${sigrok-qt2_RESOURCES})
59
60 include(${QT_USE_FILE})
61
62 add_definitions(${QT_DEFINITIONS})
63 add_definitions(-DAPP_VERSION="${VERSION}")
64
65 include_directories(
66         ${include_directories}
67         ${Boost_INCLUDE_DIRS}
68         ${PKGDEPS_INCLUDE_DIRS}
69 )
70
71 link_directories(
72         ${Boost_LIBRARY_DIRS}
73         ${PKGDEPS_LIBRARY_DIRS}
74 )
75
76 add_executable(sigrok-qt2
77         ${sigrok-qt2_SOURCES}
78         ${sigrok-qt2_HEADERS_MOC}
79         ${sigrok-qt2_FORMS_HEADERS}
80         ${sigrok-qt2_RESOURCES_RCC}
81 )
82
83 target_link_libraries(sigrok-qt2
84         ${Boost_LIBRARIES}
85         ${PKGDEPS_LIBRARIES}
86         ${QT_LIBRARIES}
87 )
88
89 add_definitions(-DBOOST_TEST_DYN_LINK)
90
91 add_executable(sigrok-qt2-test
92         ${sigrok-qt2_TEST_SOURCES}
93 )
94
95 target_link_libraries(sigrok-qt2-test
96         ${Boost_LIBRARIES}
97         ${PKGDEPS_LIBRARIES}
98         ${QT_LIBRARIES}
99 )
100
101 enable_testing()
102 add_test(test ${CMAKE_CURRENT_BINARY_DIR}/sigrok-qt2-test)