### Install Manual Files Source: https://github.com/sigrokproject/pulseview/blob/master/manual/CMakeLists.txt Installs the generated HTML and PDF manual files, along with the 'images' directory, to a specific subdirectory within the installation path. The installation is optional and includes specific file permissions. ```cmake set(MANUAL_INST_SUBDIR "share/doc/pulseview") install( FILES ${MANUAL_OUT_HTML} ${MANUAL_OUT_PDF} DESTINATION ${MANUAL_INST_SUBDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ OPTIONAL ) if (ASCIIDOCTOR_EXECUTABLE) install( DIRECTORY images DESTINATION ${MANUAL_INST_SUBDIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ PATTERN "*.xcf" EXCLUDE ) endif () ``` -------------------------------- ### Install Desktop Entry File Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Installs the desktop entry file for application menus. ```cmake install(FILES contrib/org.sigrok.PulseView.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) ``` -------------------------------- ### Install Executable Target Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Installs the main project executable to the 'bin' directory. ```cmake install(TARGETS ${PROJECT_NAME} DESTINATION bin/) ``` -------------------------------- ### Install Application Icons Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Installs application icons in various sizes and formats. ```cmake install(FILES icons/pulseview.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps) ``` ```cmake install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) ``` -------------------------------- ### Install Manpage Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Installs the project's man page to the system's man directory. ```cmake install(FILES doc/pulseview.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) ``` -------------------------------- ### Install AppData/AppStream File Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Installs the AppData/AppStream metadata file for software centers. ```cmake install(FILES contrib/org.sigrok.PulseView.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo) ``` -------------------------------- ### Make AppImage Executable and Run Source: https://github.com/sigrokproject/pulseview/blob/master/manual/installation.txt Use this command to make the PulseView AppImage executable and then run it. The AppImage contains all required files and needs no installation. ```bash chmod u+x PulseView-NIGHTLY-x86_64.AppImage ./PulseView-NIGHTLY-x86_64.AppImage ``` -------------------------------- ### Generate Windows Installer Script Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Configures a template file to generate a Windows installer script. ```cmake configure_file(contrib/pulseview_cross.nsi.in ${CMAKE_CURRENT_BINARY_DIR}/contrib/pulseview_cross.nsi @ONLY) ``` -------------------------------- ### Build PulseView from Source on Linux Source: https://github.com/sigrokproject/pulseview/blob/master/manual/installation.txt This sequence of commands installs dependencies, downloads the sigrok cross-compile script, and builds PulseView from source. It's an alternative if distro packages are outdated. ```bash _install dependencies https://sigrok.org/wiki/Linux#Building[as listed on the wiki]_ mkdir ~/sr cd ~/sr wget -O sigrok-cross-linux "'https://sigrok.org/gitweb/?p=sigrok-util.git;a=blob_plain;f=cross-compile/linux/sigrok-cross-linux'" chmod u+x sigrok-cross-linux ./sigrok-cross-linux export LD_LIBRARY_PATH=~/sr/lib ~/sr/bin/pulseview ``` -------------------------------- ### Perform Clean Startup Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -c or --clean flag to prevent PulseView from restoring previous sessions on startup. This is useful when PulseView fails to start and the cause is unknown. ```bash pulseview -c ``` -------------------------------- ### Install udev Rules for Device Access on Linux Source: https://github.com/sigrokproject/pulseview/blob/master/manual/installation.txt These commands install udev rules to allow PulseView access to USB and serial port devices without requiring root privileges. This is necessary when not running PulseView as root, such as when using the AppImage or building from source. ```bash sudo bash cd /etc/udev/rules.d/ wget -O 60-libsigrok.rules "'https://sigrok.org/gitweb/?p=libsigrok.git;a=blob_plain;f=contrib/60-libsigrok.rules'" wget -O 61-libsigrok-plugdev.rules "'https://sigrok.org/gitweb/?p=libsigrok.git;a=blob_plain;f=contrib/61-libsigrok-plugdev.rules'" wget -O 61-libsigrok-uaccess.rules "'https://sigrok.org/gitweb/?p=libsigrok.git;a=blob_plain;f=contrib/61-libsigrok-uaccess.rules'" sudo udevadm control --reload-rules ``` -------------------------------- ### Load Session Settings and Input File Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use -s / --settings to manually specify a PulseView session setup file to load. PulseView automatically loads settings if a .pvs file with the same base name as the input file exists. ```bash pulseview -s settings.pvs data.sr ``` -------------------------------- ### PulseView Safe Mode Startup Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Combine -c and -D flags to start PulseView in a 'safe mode', disabling auto-scanning and preventing the restoration of previous sessions. This can help resolve startup issues. ```bash pulseview -c -D ``` -------------------------------- ### Get Git Revision Description Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Retrieves the Git revision description for versioning. It attempts to match a specific tag format for release versions. ```cmake include(GetGitRevisionDescription) # Append the revision hash unless we are exactly on a tagged release. git_describe(PV_TAG_VERSION_STRING --match "pulseview-${PV_VERSION_STRING}" --exact-match) if(NOT PV_TAG_VERSION_STRING) get_git_head_revision(PV_REVSPEC PV_HASH) if(PV_HASH) string(SUBSTRING "${PV_HASH}" 0 7 PV_SHORTHASH) set(PV_VERSION_STRING "${PV_VERSION_STRING}-git-${PV_SHORTHASH}") endif() # Non-tagged releases use the unstable manual set(PV_MANUAL_VERSION "unstable") else() # Tagged releases use a fixed manual version set(PV_MANUAL_VERSION ${PV_VERSION_STRING}) endif() ``` -------------------------------- ### Disable Auto-Scan for Devices Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -D or --dont-scan flag to prevent PulseView from automatically scanning for devices during startup. This can be useful if the scan process causes PulseView to get stuck. ```bash pulseview -D ``` -------------------------------- ### Load Input File with Format Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use -i / --input-file and -I / --input-format to open a file on startup. If -I is omitted, the file is assumed to be in the native sigrok format (.sr). Multiple files can be specified if they are in the same format. ```bash pulseview -i data.csv -I csv:samplerate=3000000 ``` -------------------------------- ### Display Help Information Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -h flag to display a list of available command-line functions. ```bash pulseview -h ``` -------------------------------- ### Show Version Information Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -V or --version flag to display the release version of PulseView. ```bash pulseview -V ``` -------------------------------- ### Find Qt5 or Qt6 Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Searches for Qt5 first. If not found, it searches for Qt6. It requires specific components like Core, Gui, Widgets, etc., and reports the found version. ```cmake set(QT_COMPONENTS Core Gui LinguistTools Widgets Svg) find_package(Qt5 5.3 QUIET COMPONENTS Core) if(Qt5_FOUND) find_package(Qt5 5.3 COMPONENTS ${QT_COMPONENTS} REQUIRED) message(STATUS "Qt version: ${Qt5_VERSION}") else() find_package(Qt6 6.2 COMPONENTS ${QT_COMPONENTS} REQUIRED) message(STATUS "Qt version: ${Qt6_VERSION}") endif() ``` -------------------------------- ### Define Boost Components Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Defines the required Boost components, including filesystem and serialization. Adds 'unit_test_framework' if tests are enabled. ```cmake set(BOOSTCOMPS filesystem serialization) if(ENABLE_TESTS) list(APPEND BOOSTCOMPS unit_test_framework) endif() ``` -------------------------------- ### Generate Manual in PDF Format (Conditional) Source: https://github.com/sigrokproject/pulseview/blob/master/manual/CMakeLists.txt Defines a custom CMake target 'manual-pdf' to generate the manual in PDF format using Asciidoctor-pdf. This target is only created if the 'asciidoctor-pdf' executable is found. If not found, a target that echoes a warning message is created instead. ```cmake if (ASCIIDOCTOR_PDF_EXECUTABLE) add_custom_target(manual-pdf COMMAND ${ASCIIDOCTOR_PDF_EXECUTABLE} -a stylesheet=${STYLE_SHEET} -a stylesdir=${CMAKE_CURRENT_SOURCE_DIR}/${STYLES_DIR} --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${MANUAL_SRC} BYPRODUCTS ${MANUAL_OUT_PDF} DEPENDS ${MANUAL_SRC} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating manual, PDF output" ) else () add_custom_target(manual-pdf COMMAND ${CMAKE_COMMAND} -E echo "asciidoctor-pdf executable is missing, NOT generating PDF output" DEPENDS ${MANUAL_SRC} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif () ``` -------------------------------- ### CPack Packaging Configuration Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Sets CPack variables for packaging the project, including version, description, license, and source control ignore patterns. ```cmake set(CPACK_PACKAGE_VERSION_MAJOR ${PV_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PV_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PV_VERSION_MICRO}) set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README) set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_CURRENT_BINARY_DIR} ".gitignore" ".git") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PV_VERSION_STRING}") set(CPACK_SOURCE_GENERATOR "TGZ") include(CPack) ``` -------------------------------- ### MXE Workaround for Qt on Windows Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Uses pkg-config to find Qt5 or Qt6 libraries on Windows when using the MXE build environment. This is a workaround for a known issue. ```cmake if(WIN32) # MXE workaround: Use pkg-config to find Qt5 and Qt6 libs. # https://github.com/mxe/mxe/issues/1642 # Not required (and doesn't work) on MSYS2. if(NOT DEFINED ENV{MSYSTEM}) if(Qt5_FOUND) pkg_check_modules(QT5ALL REQUIRED Qt5Widgets>=5.3 Qt5Gui>=5.3 Qt5Svg>=5.3) else() pkg_check_modules(QT6ALL REQUIRED Qt6Widgets>=6.2 Qt6Gui>=6.2 Qt6Svg>=6.2) endif() endif() endif() ``` -------------------------------- ### Specify Device Connection Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -d or --driver parameter to specify a device connection, similar to sigrok-cli. This is useful when PulseView cannot automatically scan for devices. ```bash pulseview -d lecroy-xstream:conn=vxi/192.168.178.20/111 ``` -------------------------------- ### Configure Header File Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Configures the `config.h` file based on template `config.h.in` and project settings. ```cmake configure_file ( ${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h ) ``` -------------------------------- ### Generate Manual in HTML Format Source: https://github.com/sigrokproject/pulseview/blob/master/manual/CMakeLists.txt Defines a custom CMake target 'manual-html' to generate the manual in HTML format using Asciidoctor. It specifies stylesheet, styles directory, table of contents, and output directory. ```cmake add_custom_target(manual-html COMMAND ${ASCIIDOCTOR_EXECUTABLE} -a stylesheet=${STYLE_SHEET} -a stylesdir=${CMAKE_CURRENT_SOURCE_DIR}/${STYLES_DIR} -a toc=left --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${MANUAL_SRC} BYPRODUCTS ${MANUAL_OUT_HTML} DEPENDS ${MANUAL_SRC} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating manual, HTML output" ) ``` -------------------------------- ### Create Symlink for Manual Images Source: https://github.com/sigrokproject/pulseview/blob/master/manual/CMakeLists.txt Ensures that images used in the manual are accessible during the build process, especially for out-of-source builds. This command creates a symbolic link if the 'images' directory does not already exist in the binary directory. ```cmake if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/images") message(STATUS "creating symlink for manual's images/ subdirectory") execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/images" "${CMAKE_CURRENT_BINARY_DIR}/images" RESULT_VARIABLE IMAGES_LINK_RESULT ) if (NOT IMAGES_LINK_RESULT EQUAL 0) message(WARNING "manual rendering will lack images") endif () endif () ``` -------------------------------- ### Parse Version String Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Parses the version string to extract major, minor, and micro version components, as well as any suffix. ```cmake if(PV_VERSION_STRING MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)(-[-0-9a-z]*)?$") set(PV_VERSION_MAJOR ${CMAKE_MATCH_1}) set(PV_VERSION_MINOR ${CMAKE_MATCH_2}) set(PV_VERSION_MICRO ${CMAKE_MATCH_3}) set(PV_VERSION_SUFFIX ${CMAKE_MATCH_4}) endif() ``` -------------------------------- ### Define PulseView Source Files Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Lists all source files (`.cpp`) that are part of the PulseView executable. This is used by CMake to compile the application. ```cmake set(pulseview_SOURCES main.cpp pv/application.cpp pv/devicemanager.cpp pv/globalsettings.cpp pv/logging.cpp pv/mainwindow.cpp pv/metadata_obj.cpp pv/session.cpp pv/storesession.cpp pv/util.cpp pv/binding/binding.cpp pv/binding/inputoutput.cpp pv/binding/device.cpp pv/data/analog.cpp pv/data/analogsegment.cpp pv/data/logic.cpp pv/data/logicsegment.cpp pv/data/mathsignal.cpp pv/data/signalbase.cpp pv/data/signaldata.cpp pv/data/segment.cpp pv/devices/device.cpp pv/devices/file.cpp pv/devices/hardwaredevice.cpp pv/devices/inputfile.cpp pv/devices/sessionfile.cpp pv/dialogs/connect.cpp pv/dialogs/inputoutputoptions.cpp pv/dialogs/settings.cpp pv/dialogs/storeprogress.cpp pv/popups/deviceoptions.cpp pv/popups/channels.cpp pv/prop/bool.cpp pv/prop/double.cpp pv/prop/enum.cpp pv/prop/int.cpp pv/prop/property.cpp pv/prop/string.cpp pv/subwindows/subwindowbase.cpp pv/toolbars/mainbar.cpp pv/views/trace/analogsignal.cpp pv/views/trace/cursor.cpp 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 pv/views/trace/signal.cpp pv/views/trace/timeitem.cpp pv/views/trace/timemarker.cpp pv/views/trace/trace.cpp pv/views/trace/tracegroup.cpp pv/views/trace/tracepalette.cpp pv/views/trace/tracetreeitem.cpp pv/views/trace/tracetreeitemowner.cpp pv/views/trace/triggermarker.cpp pv/views/trace/view.cpp pv/views/trace/viewitem.cpp pv/views/trace/viewitemowner.cpp pv/views/trace/viewitempaintparams.cpp pv/views/trace/viewport.cpp pv/views/trace/viewwidget.cpp pv/views/viewbase.cpp pv/views/trace/standardbar.cpp pv/widgets/colorbutton.cpp pv/widgets/colorpopup.cpp pv/widgets/devicetoolbutton.cpp pv/widgets/exportmenu.cpp pv/widgets/flowlayout.cpp pv/widgets/importmenu.cpp pv/widgets/popup.cpp pv/widgets/popuptoolbutton.cpp pv/widgets/sweeptimingwidget.cpp pv/widgets/timestampspinbox.cpp pv/widgets/wellarray.cpp ) ``` -------------------------------- ### Find Boost with Stacktrace Support Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Finds the Boost library, including components for stack tracing if ENABLE_STACKTRACE is set. It checks for Backtrace support and adjusts the required Boost version accordingly. ```cmake if(ENABLE_STACKTRACE) include(FindBacktrace) if (Backtrace_FOUND) set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp") list(APPEND BOOSTCOMPS stacktrace_backtrace) else() set(_Boost_STACKTRACE_BASIC_HEADERS "boost/stacktrace.hpp") list(APPEND BOOSTCOMPS stacktrace_basic) endif() find_package(Boost 1.65.1 COMPONENTS ${BOOSTCOMPS} REQUIRED) else() find_package(Boost 1.55 COMPONENTS ${BOOSTCOMPS} REQUIRED) endif() ``` -------------------------------- ### Check All Dependencies Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Performs a final check for all collected dependencies using pkg_check_modules. 'REQUIRED' ensures the build fails if any are missing. ```cmake pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS}) ``` -------------------------------- ### Enable CMake Automatic Moc Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Enables CMake's automatic handling of Meta-Object Compiler (MOC) files, which is typically used with Qt. ```cmake set(CMAKE_AUTOMOC TRUE) ``` -------------------------------- ### Add PulseView Test Executable Source: https://github.com/sigrokproject/pulseview/blob/master/test/CMakeLists.txt Adds the pulseview-test executable to the build system. It includes source and header files necessary for the test suite. ```cmake add_executable(pulseview-test ${pulseview_TEST_SOURCES} ${pulseview_TEST_HEADERS_MOC} ) ``` -------------------------------- ### Enable and Add Test Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Conditionally enables testing and adds a specific test executable. ```cmake if(ENABLE_TESTS) add_subdirectory(test) enable_testing() add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/pulseview-test) endif() ``` -------------------------------- ### Set Log Level Source: https://github.com/sigrokproject/pulseview/blob/master/manual/cli.txt Use the -l or --loglevel parameter to set the libsigrok/libsigrokdecode log level. The maximum level is 5. ```bash pulseview -l 5 ``` -------------------------------- ### Find Thread Library (CMake) Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Finds the platform's thread library, essential for C++11 threads. Sets CMAKE_THREAD_LIBS_INIT to the OS-specific value. ```cmake find_package(Threads REQUIRED) ``` -------------------------------- ### Check libsigrok C++ Bindings Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Checks for the presence and version of libsigrok C++ bindings. If not found or version is incorrect, it halts the build with an error. ```cmake pkg_check_modules(LIBSRCXX ${LIBSR_CXX_BINDING}) if(NOT LIBSRCXX_FOUND OR NOT LIBSRCXX_VERSION) message(FATAL_ERROR "libsigrok C++ bindings missing, check libsigrok's 'configure' output (missing dependencies?)") endif() ``` -------------------------------- ### Set Qt Libraries Variable Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Sets the QT_LIBRARIES variable based on whether Qt5 or Qt6 was found. This variable is used later to link against the appropriate Qt modules. ```cmake if(Qt5_FOUND) set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg) else() set(QT_LIBRARIES Qt6::Gui Qt6::Widgets Qt6::Svg) endif() ``` -------------------------------- ### Link Libraries to PulseView Test Executable Source: https://github.com/sigrokproject/pulseview/blob/master/test/CMakeLists.txt Links the necessary PulseView libraries to the pulseview-test executable. Ensure PULSEVIEW_LINK_LIBS is defined appropriately in your CMake configuration. ```cmake target_link_libraries(pulseview-test ${PULSEVIEW_LINK_LIBS}) ``` -------------------------------- ### Define Boost Test Dynamic Linking on Non-Windows Source: https://github.com/sigrokproject/pulseview/blob/master/test/CMakeLists.txt Conditionally defines BOOST_TEST_DYN_LINK for non-Windows systems to enable dynamic linking of Boost.Test. This is typically used when building test executables. ```cmake if(NOT WIN32) add_definitions(-DBOOST_TEST_DYN_LINK) endif() ``` -------------------------------- ### Check and Add glibmm Dependency Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Checks for glibmm-2.4. If not found, it adds glibmm-2.68 to the dependency list. This ensures compatibility with different glibmm versions. ```cmake pkg_check_modules(GLIBMM_2_4 glibmm-2.4>=2.28.0) if(GLIBMM_2_4_FOUND) list(APPEND PKGDEPS glibmm-2.4>=2.28.0) else() list(APPEND PKGDEPS glibmm-2.68>=2.68.0) endif() ``` -------------------------------- ### Conditionally Add Android Utilities Dependency Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Adds libsigrokandroidutils to the dependency list if ANDROID is set. This is for Android-specific builds. ```cmake if(ANDROID) list(APPEND PKGDEPS libsigrokandroidutils>=0.1.0) endif() ``` -------------------------------- ### Add libsigrok C++ Bindings Dependency Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Appends the libsigrok C++ bindings dependency to the PKGDEPS list. This is a core dependency for C++ integration. ```cmake set(LIBSR_CXX_BINDING "libsigrokcxx>=0.5.2") list(APPEND PKGDEPS "${LIBSR_CXX_BINDING}") ``` -------------------------------- ### Conditionally Add Decode Dependencies Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Adds libsigrokdecode to the dependency list if ENABLE_DECODE is set. This is used for enabling decoding features. ```cmake if(ENABLE_DECODE) list(APPEND PKGDEPS libsigrokdecode>=0.5.2) endif() ``` -------------------------------- ### Check C++ Atomic Support (CMake) Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Checks if the compiler supports std::atomic operations, first without libatomic, then with it if necessary. Fatal errors are raised if support cannot be established. ```cmake function(check_working_cxx_atomics varname additional_lib) cmake_push_check_state() set(CMAKE_REQUIRED_FLAGS "${REQUIRED_STD_CXX_FLAGS}") set(CMAKE_REQUIRED_LIBRARIES "${additional_lib}") set(CMAKE_REQUIRED_QUIET 1) CHECK_CXX_SOURCE_COMPILES ( #include std::atomic x; int main() { return std::atomic_fetch_add_explicit(&x, 1, std::memory_order_seq_cst); } ${varname}) cmake_pop_check_state() endfunction(check_working_cxx_atomics) check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB "") if(HAVE_CXX_ATOMICS_WITHOUT_LIB) message(STATUS "Atomics provided by the C-library - yes") else() message(STATUS "Atomics provided by the C-library - no") find_library(LIBATOMIC_LIBRARY NAMES atomic PATH_SUFFIXES lib) if(LIBATOMIC_LIBRARY) check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB "${LIBATOMIC_LIBRARY}") if (HAVE_CXX_ATOMICS_WITH_LIB) message(STATUS "Atomics provided by libatomic - yes") else() message(STATUS "Atomics provided by libatomic - no") message(FATAL_ERROR "Compiler must support std::atomic!") endif() else() message(FATAL_ERROR "Compiler appears to require libatomic, but cannot find it.") endif() endif() ``` -------------------------------- ### Conditionally Add Flow Dependencies Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Adds gstreamermm and libsigrokflow to the dependency list if ENABLE_FLOW is set. This is used for enabling flow-related features. ```cmake if(ENABLE_FLOW) list(APPEND PKGDEPS gstreamermm-1.0>=1.8.0) list(APPEND PKGDEPS libsigrokflow>=0.1.0) endif() ``` -------------------------------- ### Check for Unaligned Little-Endian Access Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Determines if the system supports unaligned little-endian memory access. This is a system introspection check. ```cmake memaccess_check_unaligned_le(HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS) ``` -------------------------------- ### Check for libsigrokdecode Functionality Source: https://github.com/sigrokproject/pulseview/blob/master/CMakeLists.txt Checks if the `srd_session_send_eof` function from libsigrokdecode is available. This is used to ensure the decoding library is properly linked and functional. ```cmake if(ENABLE_DECODE) 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() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.