2 ## This file is part of the PulseView project.
4 ## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5 ## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
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.
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.
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/>.
21 cmake_minimum_required(VERSION 2.6)
22 include(FindPkgConfig)
26 #===============================================================================
28 #-------------------------------------------------------------------------------
30 option(ENABLE_TESTS "Enable unit tests" FALSE)
32 #===============================================================================
34 #-------------------------------------------------------------------------------
36 find_package(PkgConfig)
37 pkg_check_modules(PKGDEPS REQUIRED
38 libsigrokdecode>=0.1.0
42 # On Windows/MinGW we explicitly point cmake to the Boost directory.
44 set(BOOST_ROOT /usr/local)
47 find_package(Qt4 REQUIRED)
48 find_package(Boost 1.46 COMPONENTS unit_test_framework REQUIRED)
52 #===============================================================================
54 #-------------------------------------------------------------------------------
61 pv/logicdatasnapshot.cpp
89 set(pulseview_RESOURCES
93 set(pulseview_TEST_SOURCES
95 pv/logicdatasnapshot.cpp
96 test/logicdatasnapshot.cpp
100 qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
101 qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
102 qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
104 include(${QT_USE_FILE})
106 #===============================================================================
107 #= Global Definitions
108 #-------------------------------------------------------------------------------
110 add_definitions(${QT_DEFINITIONS})
111 add_definitions(-DAPP_VERSION="${VERSION}")
113 #===============================================================================
114 #= Global Include Directories
115 #-------------------------------------------------------------------------------
117 # On Windows/MinGW we need PKGDEPS_STATIC_INCLUDE_DIRS.
120 ${include_directories}
121 ${CMAKE_CURRENT_BINARY_DIR}
122 ${Boost_INCLUDE_DIRS}
123 ${PKGDEPS_STATIC_INCLUDE_DIRS}
127 ${include_directories}
128 ${CMAKE_CURRENT_BINARY_DIR}
129 ${Boost_INCLUDE_DIRS}
130 ${PKGDEPS_INCLUDE_DIRS}
134 #===============================================================================
135 #= Linker Configuration
136 #-------------------------------------------------------------------------------
138 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARY_DIRS.
141 ${Boost_LIBRARY_DIRS}
142 ${PKGDEPS_STATIC_LIBRARY_DIRS}
146 ${Boost_LIBRARY_DIRS}
147 ${PKGDEPS_LIBRARY_DIRS}
151 add_executable(pulseview
153 ${pulseview_HEADERS_MOC}
154 ${pulseview_FORMS_HEADERS}
155 ${pulseview_RESOURCES_RCC}
158 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
160 target_link_libraries(pulseview
162 ${PKGDEPS_STATIC_LIBRARIES}
166 target_link_libraries(pulseview
173 #===============================================================================
175 #-------------------------------------------------------------------------------
177 install(PROGRAMS pulseview DESTINATION bin/)
179 #===============================================================================
181 #-------------------------------------------------------------------------------
185 add_definitions(-DBOOST_TEST_DYN_LINK)
187 add_executable(pulseview-test
188 ${pulseview_TEST_SOURCES}
191 # On Windows/MinGW we need PKGDEPS_STATIC_LIBRARIES.
193 target_link_libraries(pulseview-test
195 ${PKGDEPS_STATIC_LIBRARIES}
199 target_link_libraries(pulseview-test
207 add_test(test ${CMAKE_CURRENT_BINARY_DIR}/pulseview-test)