2 ## This file is part of the PulseView project.
4 ## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
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.
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.
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/>.
20 cmake_minimum_required(VERSION 2.6)
21 include(FindPkgConfig)
25 find_package(PkgConfig)
26 pkg_check_modules(PKGDEPS REQUIRED
27 libsigrokdecode>=0.1.0
31 # On Windows/MinGW we explicitly point cmake to the Boost directory.
33 set(BOOST_ROOT /usr/local)
36 find_package(Qt4 REQUIRED)
37 find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED)
46 pv/logicdatasnapshot.cpp
74 set(pulseview_RESOURCES
78 set(pulseview_TEST_SOURCES
80 pv/logicdatasnapshot.cpp
81 test/logicdatasnapshot.cpp
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})
89 include(${QT_USE_FILE})
91 add_definitions(${QT_DEFINITIONS})
92 add_definitions(-DAPP_VERSION="${VERSION}")
94 # On Windows/MinGW we need PKGDEPS_STATIC_INCLUDE_DIRS.
97 ${include_directories}
98 ${CMAKE_CURRENT_BINARY_DIR}
100 ${PKGDEPS_STATIC_INCLUDE_DIRS}
104 ${include_directories}
105 ${CMAKE_CURRENT_BINARY_DIR}
106 ${Boost_INCLUDE_DIRS}
107 ${PKGDEPS_INCLUDE_DIRS}
111 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS.
114 ${Boost_LIBRARY_DIRS}
115 ${PKGDEPS_STATIC_LIBRARY_DIRS}
119 ${Boost_LIBRARY_DIRS}
120 ${PKGDEPS_LIBRARY_DIRS}
124 add_executable(pulseview
126 ${pulseview_HEADERS_MOC}
127 ${pulseview_FORMS_HEADERS}
128 ${pulseview_RESOURCES_RCC}
131 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
133 target_link_libraries(pulseview
135 ${PKGDEPS_STATIC_LIBRARIES}
139 target_link_libraries(pulseview
146 install(PROGRAMS pulseview DESTINATION bin/)
150 add_definitions(-DBOOST_TEST_DYN_LINK)
152 add_executable(pulseview-test
153 ${pulseview_TEST_SOURCES}
156 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
158 target_link_libraries(pulseview-test
160 ${PKGDEPS_STATIC_LIBRARIES}
164 target_link_libraries(pulseview-test
172 add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test)