Fix CMake CXX_STANDARD handling https://sigrok.org/gitweb/?p=pulseview.git;a=commit;f=CMakeLists.txt;h=fa8d0fcb4cff4f19943fe3ff152dc1428b400b01 introduced a CXX_STANDARD value of 17 while still only requiring cmake 2.8.12. However, https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#cxx-standard shows that a value of 17 was introduced with cmake 3.8, leading to "CXX_STANDARD is set to invalid value '17'" when trying to build with cmake < 3.8. Hence, for versions below 3.8, we only check for up to 14.
Fix glibmm dependency check https://sigrok.org/gitweb/?p=pulseview.git;a=commit;f=CMakeLists.txt;h=33c5ac28f73aa35c5fc4bbcf69a5ae61c0b50989 introduced the line pkg_check_modules(GLIBMM_2_4 glibmm-2.4>2.28.0) but https://cmake.org/cmake/help/v3.0/module/FindPkgConfig.html states A <MODULE> parameter can have the following formats: {MODNAME} ... matches any version {MODNAME}>={VERSION} ... at least version <VERSION> is required {MODNAME}={VERSION} ... exactly version <VERSION> is required {MODNAME}<={VERSION} ... modules must not be newer than <VERSION> Hence, ">" is an invalid atom and always makes the check fail. On systems without glibmm-2.68, this leads to glibmm not being found and the build aborting.
cmake: only optionally modify in-source .ts files (Qt lupdate) The creation of .qm output files from .ts input data undoubtedly needs to be an unconditional part of the build process. The modification of .ts source files in contrast needs to remain an intentional activity during development. The mere act of compiling sources to binaries shall never modify the source tree. Move the lupdate(1) invocation out of the default build process, while lrelease(1) remains in place. Ideally we could have a "make ts-update" target for developers to invoke as needed. But that'd be more involved since the qt5_create_translation() cmake routine is involved, which needs to be passed variables content that is only available at configure time. A future implementation could investigate the add_custom_target() approach. This commit introduces the ENABLE_TS_UPDATE cmake option to quickly address the issue. How to reproduce: $ cd $SRC $ cmake --build $OUT $ git status -s $ cmake -DENABLE_TS_UPDATE=ON $OUT $ cmake --build $OUT $ git status -s This commit also happens to bring build steps in closer promixity, while making development iterations stand out more perceivably.
CMakeLists.txt: adjust cmake build rules for Qt6 support Check for the availability of Qt5 as well as Qt6. Prefer Qt5 for backwards compatibility, but accept when only Qt6 is available. This unbreaks Mac OSX 12 builds with homebrew. This change is based on work that was submitted by Dominik Sliwa <redacted>. It is assumed that failed tests for timestamps to text conversion (the format_time_minutes() routine) and Qt widgets not being thread safe are issues that do reproduce more often on the Mac platform but are independent from Qt6 support. These issues will be dealt with separately.
CMakeLists.txt: always use highest available C++17/C++14/C++11 standard Check for the availability of the C++17, C++14, and C++11 language standards. Prefer the highest available to build any of the feature tests or applications. Factor out common conditions into a central spot in the CMake build rules. Rename variables to avoid special chars in their name. Setup both the CMAKE_CXX_STANDARD cmake variable which internally is used transparently, as well explicitly pass the -std= compile flag in build instructions for feature checks and application code. It's what the smuview build does, should also work for pulseview, and is assumed to not harm either in case it's redundant. This unbreaks operation in most generic ways on platforms like MacOS 12 (system library), and for external libraries of differing degrees of aggressivness (boost, glibmm, sig++).
CMakeLists.txt: Detect glibmm-2.68 in addition to glibmm-2.4 On OS X with homebrew only glibmm-2.68 series is available. As far as I can tell there are no breaking changes for PulseView on the glibmm-2.68 ABI change. This change still prefers glibmm-2.4 if found, and uses 2.4 if both 2.4 and 2.68 are available.
CMakeLists.txt: move includes to the top, earlier pkg-config lookup Move some of the common cmake includes to a location near the top of the file. Lookup the pkg-config(1) utility before the construction of the list of dependendencies. Remaining subsequent includes are strictly conditional (backtrace), or belong to different groups than source compilation (VCS revision, CPack).
CMakeLists.txt: consistent whitespace in atomics check Previous CMakeLists.txt rules used to mix TAB and SPACE indentation. Consistently use TAB instead. This amends commit 4da54b6be6a1 which introduced the check for the atomics library. [ no change in behaviour, see whitespace ignoring diff to verify ]
cmake: check for optional libsigrokdecode features (send EOF) Implement a feature check for the srd_session_send_eof() routine which depends on the libsigrokdecode version. This test implementation is a little more redundant than necessary, check_symbol_exists() would be preferred instead but would not work in my local setup.
cmake: move project() before other statements The included GNUInstallDirs logic needs to know about the programming languages which are used in the project. Without this spec a verbose developer message gets emitted: CMake Warning (dev) at $HOME/share/cmake-3.18/Modules/GNUInstallDirs.cmake:225 (message): Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. Please enable at least one language before including GNUInstallDirs. Call Stack (most recent call first): CMakeLists.txt:24 (include) This warning is for project developers. Use -Wno-dev to suppress it. Move the project() statement in CMakeList.txt before the include(), and specify the C and C++ programming languages (C is needed at configuration time for feature detection, before the application's C++ sources get built).