2 ## This file is part of PulseView.
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)
74 set(pulseview_RESOURCES
78 set(pulseview_TEST_SOURCES
79 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}
99 ${PKGDEPS_STATIC_INCLUDE_DIRS}
103 ${include_directories}
104 ${Boost_INCLUDE_DIRS}
105 ${PKGDEPS_INCLUDE_DIRS}
109 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS.
112 ${Boost_LIBRARY_DIRS}
113 ${PKGDEPS_STATIC_LIBRARY_DIRS}
117 ${Boost_LIBRARY_DIRS}
118 ${PKGDEPS_LIBRARY_DIRS}
122 add_executable(pulseview
124 ${pulseview_HEADERS_MOC}
125 ${pulseview_FORMS_HEADERS}
126 ${pulseview_RESOURCES_RCC}
129 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
131 target_link_libraries(pulseview
133 ${PKGDEPS_STATIC_LIBRARIES}
137 target_link_libraries(pulseview
146 add_definitions(-DBOOST_TEST_DYN_LINK)
148 add_executable(pulseview-test
149 ${pulseview_TEST_SOURCES}
152 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
154 target_link_libraries(pulseview-test
156 ${PKGDEPS_STATIC_LIBRARIES}
160 target_link_libraries(pulseview-test
168 add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test)
170 install(PROGRAMS pulseview DESTINATION bin/)