X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=7791b1b138daa601b888f1f59ffe1c1d445e95c3;hb=fe94bf8255145410d1673880932d59573c829b0e;hp=aead6ee7e8e19446f5c961d8620b6a08d3de075f;hpb=b0773a8aa01735d7220284ab7a3e8b5d02b48e9e;p=pulseview.git diff --git a/CMakeLists.txt b/CMakeLists.txt index aead6ee7..7791b1b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ cmake_minimum_required(VERSION 2.8.12) -include(GNUInstallDirs) +project(pulseview C CXX) -project(pulseview) +include(GNUInstallDirs) # Let AUTOMOC and AUTOUIC process GENERATED files. if(POLICY CMP0071) @@ -188,6 +188,29 @@ else() endif() endif() +# Check availability of features which depend on library versions. +# TODO Ideally use check_symbol_exists() instead, reduce boilerplate. +if(ENABLE_DECODE) + include(CheckCSourceCompiles) + include(CMakePushCheckState) + cmake_push_check_state() + set(CMAKE_REQUIRED_INCLUDES "${PKGDEPS_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "sigrokdecode") + foreach (LPATH ${PKGDEPS_LIBRARY_DIRS}) + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-L${LPATH}") + endforeach () + check_c_source_compiles(" + #include + int main(int argc, char *argv[]) + { + (void)argc; + (void)argv; + return srd_session_send_eof(NULL); + } + " HAVE_SRD_SESSION_SEND_EOF) + cmake_pop_check_state() +endif() + #=============================================================================== #= System Introspection #------------------------------------------------------------------------------- @@ -286,6 +309,7 @@ set(pulseview_SOURCES pv/views/trace/cursorpair.cpp pv/views/trace/flag.cpp pv/views/trace/header.cpp + pv/views/trace/mathsignal.cpp pv/views/trace/marginwidget.cpp pv/views/trace/logicsignal.cpp pv/views/trace/ruler.cpp @@ -321,6 +345,7 @@ set(pulseview_SOURCES # This list includes only QObject derived class headers. set(pulseview_HEADERS + pv/exprtk.hpp pv/logging.hpp pv/globalsettings.hpp pv/mainwindow.hpp @@ -353,6 +378,7 @@ set(pulseview_HEADERS pv/views/trace/flag.hpp pv/views/trace/header.hpp pv/views/trace/logicsignal.hpp + pv/views/trace/mathsignal.hpp pv/views/trace/marginwidget.hpp pv/views/trace/ruler.hpp pv/views/trace/signal.hpp @@ -462,6 +488,9 @@ add_definitions(-D__STDC_LIMIT_MACROS) add_definitions(-Wall -Wextra) add_definitions(-std=c++11) add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1) +if(WIN32) + add_definitions(-Wa,-mbig-obj -O3) +endif() if(ENABLE_FLOW) add_definitions(-DENABLE_FLOW)