Compare commits

..
Author SHA1 Message Date
Alexander Shaduri 3f9fe9fc59 Merge branch 'feature/gtk4-support' of https://github.com/ashaduri/gsmartcontrol into feature/gtk4-support 2022-01-25 16:48:46 +04:00
Alexander Shaduri 033fb46b08 Place less code in #ifdef _WIN32 to make platform-specific compilation less error-prone. 2022-01-25 15:58:10 +04:00
Alexander Shaduri 351c8b23cb (Possibly) fix a memory leak related to Gtk::Menu. 2022-01-25 15:53:56 +04:00
Alexander Shaduri 3fc29efd2f Partial port to Gio::Action (from Gtk::Action), Gtk::Builder (from Gtk::UiManager), and Gtk::ApplicationWindow (from Gtk::Window for main window). 2022-01-25 15:53:10 +04:00
Alexander Shaduri 34cd55d9d2 Disable deprecated glibmm and giomm symbols. 2022-01-25 15:49:19 +04:00
Alexander Shaduri c361129929 Place less code in #ifdef _WIN32 to make platform-specific compilation less error-prone. 2022-01-24 13:02:32 +04:00
Alexander Shaduri d42a92e58d Ported away from deprecated Gtk::Dialog methods. 2022-01-24 13:00:40 +04:00
Alexander Shaduri 38f9928756 Ported away from deprecated Gtk::Label methods. 2022-01-24 13:00:21 +04:00
Alexander Shaduri 1614106510 Ported from Gtk::Stock to XDG icon names. 2022-01-24 12:59:37 +04:00
Alexander Shaduri 6b1e9cd3ef Ported from Gtk::Main to Gtk::Application. 2022-01-24 12:58:37 +04:00
Alexander Shaduri 5f11e9a7ce Fixed building under Windows. 2022-01-18 16:31:13 +04:00
Alexander Shaduri f128de2b30 Fixed building non-debug builds. 2022-01-18 15:53:48 +04:00
Alexander Shaduri 88e9e8c2f7 Implemented most build settings as constexpr functions and ported most of macro-based conditional compilation to if constexpr(); this significantly improves code quality and the chance of build success on different platforms and build configurations.
More code modernization.
2022-01-18 15:30:55 +04:00
Alexander Shaduri 235fba8a04 Convert relative smartctl-nc path to absolute before running it. 2022-01-15 15:24:11 +04:00
Alexander Shaduri 0183626c73 Change current path to gsmartcontrol directory before running smartctl - this should fix not being able to find "smartctl-nc" when CWD differs from gsmartcontrol installation directory, as it may happen when running gsmartcontrol from cmd. 2022-01-15 15:07:10 +04:00
Alexander Shaduri bcc36f260d Fixed finding data files in non-debug builds when running from build directory. 2022-01-15 15:01:39 +04:00
Alexander Shaduri ad796dad9e Automatically handle running from source/build directory and from package, using whereami library; this should fix not being able to run the application from non-standard build directories. 2022-01-15 14:35:06 +04:00
Alexander Shaduri 0ca482bc5d Include whereami library as a third-party dependency. 2022-01-15 14:33:12 +04:00
Alexander Shaduri c72b746d0a Escape all text wherever it may be interpreted as markup, even if not coming from external source. 2022-01-14 19:17:15 +04:00
Alexander Shaduri b4b6980a0c Fixed a GTK warning related to markup in Info window's attributes tab. 2022-01-14 18:53:16 +04:00
Alexander Shaduri 534dcd129e Code modernization and cleanups. 2022-01-14 15:06:07 +04:00
Alexander Shaduri 3e4cefb04f Fixed a crash when trying to render main window icons which have incomplete data; fixes #13 in main branch. 2022-01-12 18:04:42 +04:00
Alexander Shaduri dd392845a6 Fixed cmake build for the last commit. 2022-01-10 21:09:03 +04:00
Alexander Shaduri 7f2fb32735 Refactored InstanceManager (now WindowInstanceManager) to manage all window instances, keep them alive and have the ability to destroy them; this avoids any manual "delete" calls, and fixes a (newly introduced) crash on exit. 2022-01-10 19:13:11 +04:00
Alexander Shaduri f3247ec13b Merge remote-tracking branch 'origin/main' into main 2022-01-10 17:02:12 +04:00
Alexander Shaduri ad014517b9 Set LC_NUMERIC=C for smartctl process to avoid locale-dependent number formatting. 2022-01-10 17:01:56 +04:00
Alexander Shaduri e3de5aa3fe Merge pull request #21 from hjudt/fix-barely-readable-info-cell-texts
Device Information window: Fix barely readable table cell text on some systems
2021-12-21 18:03:12 +04:00
Harald Judt 6adac797d3 Fix barely readable info cell texts
By simply resetting values, the rendered cell text colors are barely
readable. Setting Pango::WEIGHT_NORMAL instead of resetting seems to fix this
nicely without any negative consequences.

Signed-off-by: Harald Judt <h.judt@gmx.at>
2021-12-21 14:25:06 +01:00
Alexander Shaduri 99c9d393c2 Merge pull request #15 from davoper/improvements
Add time to default filename in save dialog
2021-12-01 18:07:07 +04:00
dpc 17f54a8848 Add time (%H%M) to default filename in save dialog 2021-10-08 20:24:02 +02:00
Alexander Shaduri f9c5ad470c Merge pull request #11 from Translate-SW/patch-4
Update LINGUAS list
2021-08-11 18:32:23 +04:00
Alexander Shaduri da539e57a4 Merge pull request #12 from Translate-SW/patch-3
Czech translations for GSmartControl (cs.po)
2021-08-11 18:31:59 +04:00
CZ-Translator 37d86b2914 Update LINGUAS 2021-08-09 18:00:39 +02:00
CZ-Translator acc84385b5 Create cs.po 2021-08-09 17:59:07 +02:00
Alexander Shaduri 701ce81aab Merge pull request #5 from pinotree/legacy-pixmaps-location
Stop installing application icons to the legacy pixmaps location
2021-05-17 13:19:34 +04:00
Pino Toscano 71bcfe80e3 Stop installing app icon in pixmaps location
The /usr/share/pixmaps location is considered a legacy location for
application icons; since the application icons are already installed in
the global XDG hicolor theme, then simply stop installing the 48px one
in the legacy pixmaps location.
2021-05-16 17:57:52 +02:00
Pino Toscano b53bbe5a97 Drop the XPM version of the app icon
The application icon is already provided as PNG in different sizes, and
installed in the global XDG hicolor icon theme. Hence, the XPM version
of it can be dropped, as it is redundant.
2021-05-16 17:54:01 +02:00
Pino Toscano ccc9cd1a32 debian: drop old Debian menu file
Debian officially deprecated the old Debian menu system more than 5
years ago [1]. Hence, drop the old menu file, as not much of use
anymore.

[1] https://lists.debian.org/debian-devel-announce/2015/09/msg00000.html
2021-05-16 17:50:38 +02:00
Alexander Shaduri b78f8573b5 Implemented smartctl process environment changes without changing the main program's environment.
Removed ScopedEnv class - it's not thread-safe and very easy to misuse.
2021-04-21 16:48:46 +04:00
Alexander Shaduri 3b7576d95c Catch2: Treat catch2 headers as system. 2021-03-22 16:48:42 +04:00
Alexander Shaduri cdb9a4c603 Renamed SmartctlTextParser to SmartctlAtaTextParser. 2021-03-19 14:51:32 +04:00
Alexander Shaduri 9a2606d96f Disable compiler warnings when compiling third-party dependencies. 2021-03-19 14:50:08 +04:00
Alexander Shaduri b1ebc88a3c GitHub actions: Use msys2 shell when running tests in msys. 2021-03-19 14:49:18 +04:00
Alexander Shaduri a33d4109d1 Fix cross-compiling (test discovery doesn't work when cross-compiling). 2021-03-17 14:26:13 +04:00
Alexander Shaduri 15ab09063b Minor cleanups. 2021-03-17 14:25:30 +04:00
Alexander Shaduri 3f0b7c1681 Fixed catch2 compiling under mingw. 2021-03-17 14:24:52 +04:00
Alexander Shaduri b1150d8e86 Implemented app_pcre_get_options() tests. 2021-03-16 18:10:35 +04:00
Alexander Shaduri b84f3d9218 Register libdebug domains in test_all. 2021-03-16 18:10:19 +04:00
Alexander Shaduri 9db25f3907 Add Catch2 testing framework and integrate it into the build system and CI; moved json to subdirectory. 2021-03-16 17:57:01 +04:00
Alexander Shaduri 812bd2191e Fixed non-linux builds. 2021-03-16 16:27:06 +04:00
Alexander Shaduri 788a4760b8 Refactored storage property classes (better naming, documentation), removed app_gtkmm_features.h. 2021-03-16 16:06:28 +04:00
Alexander Shaduri d74da816a1 Refactored command executors (better naming, documentation). 2021-03-16 15:24:08 +04:00
Alexander Shaduri cfc11bef6e Refactored app_pcrecpp.h structure. 2021-03-15 19:00:50 +04:00
Alexander Shaduri bedd8f362b Refactored gtkmm utils and app builder to simply the code and document it better. 2021-03-15 17:55:22 +04:00
Alexander Shaduri 7855ce9dfb Fixed cmake warnings. 2021-03-15 16:40:25 +04:00
Alexander Shaduri 81d6656f13 Github actions: Add Linux binary package generation. 2021-03-12 18:36:59 +04:00
Alexander Shaduri 6fad220e7e Change version to 1.1.99. 2021-03-12 18:36:18 +04:00
Alexander Shaduri 2a0f32b2c7 Try to fix msys2 packaging. 2021-03-12 18:13:31 +04:00
Alexander Shaduri 212bdb80f8 Try to fix msys2 packaging. 2021-03-12 17:54:37 +04:00
Alexander Shaduri 6039667556 Try to fix msys2 packaging. 2021-03-12 16:25:00 +04:00
Alexander Shaduri 4960be8cd1 Try to fix msys2 packaging. 2021-03-12 16:03:16 +04:00
Alexander Shaduri 89b1a5a6bd Try to fix msys2 packaging. 2021-03-12 15:09:36 +04:00
Alexander Shaduri 173f379111 OBS Debian fixes. 2021-03-12 15:09:29 +04:00
Alexander Shaduri 14288cbd1a OBS Debian fixes. 2021-03-12 15:08:30 +04:00
Alexander Shaduri 4b72bd3824 Fixed compilation under Debian 10. 2021-03-12 10:58:31 +00:00
Alexander Shaduri 902e06b893 Try to fix msys2 packaging. 2021-03-12 14:48:19 +04:00
Alexander Shaduri ca9e83ce9b OBS fixes for Debian, SLE15. 2021-03-12 14:34:51 +04:00
Alexander Shaduri 58919f3dae Implement Windows zip and NSIS packaging in GitHub actions. 2021-03-12 14:34:25 +04:00
Alexander Shaduri b042e8ad19 Merge remote-tracking branch 'origin/main' into main 2021-03-12 14:33:13 +04:00
Alexander Shaduri b188fab4df Improved Windows packaging. 2021-03-12 14:09:10 +04:00
Alexander Shaduri 5f9801328f Merge remote-tracking branch 'origin/main' into main 2021-03-11 18:06:36 +04:00
Alexander Shaduri d7978e759d Support Windows zip and NSIS package generation in MSYS2. 2021-03-11 18:06:06 +04:00
Alexander Shaduri 2d83424510 Another fix for cmake 3.12. 2021-03-11 18:05:23 +04:00
Alexander Shaduri 78391d236b Support cmake 3.12. 2021-03-11 17:09:42 +04:00
Alexander Shaduri 7934433100 Make GitHub treat header files as C++. 2021-03-11 16:44:31 +04:00
Alexander Shaduri 692fb1c7ca Fixed "drive is testing" message on startup. 2021-03-10 14:28:22 +04:00
Alexander Shaduri a6fa512e46 Updated OBS rpm rules. 2021-03-10 14:14:35 +04:00
Alexander Shaduri 4809173feb Updated OBS rpm/debian rules. 2021-03-10 13:57:22 +04:00
Alexander Shaduri 2e49c6b7ed Support compilation under gcc 7. 2021-03-10 13:44:28 +04:00
Alexander Shaduri 72064d2324 Add naive deb package support (incomplete). 2021-03-10 13:31:22 +04:00
Alexander Shaduri ce309529c5 Update OBS rpm and deb builds (deb not really supported yet). 2021-03-10 13:13:19 +04:00
Alexander Shaduri cb1abab75f Support Finnish decimal separator (backported from Debian package). 2021-03-10 13:05:47 +04:00
Alexander Shaduri 9c97f463c9 Fixed a few typos (backported from debian package). 2021-03-10 13:05:21 +04:00
Alexander Shaduri c6d910ec21 GitHub actions: Moved macos to tier2 platform list. 2021-03-10 12:39:42 +04:00
Alexander Shaduri 9574a6df20 Fixed a warning from OBS. 2021-03-09 22:01:19 +04:00
Alexander Shaduri 39c57564a6 Fixed a warning in rpm SPEC file. 2021-03-09 22:00:42 +04:00
Alexander Shaduri c0686dd234 Fixed a typo in rpm spec file. 2021-03-09 21:33:15 +04:00
Alexander Shaduri 134633e7ac Updated RPM spec to support CentOS with EPEL. 2021-03-09 21:32:39 +04:00
Alexander Shaduri c1a1aca7ec GitHub actions: Add cpack test to Ubuntu build. 2021-03-09 21:12:18 +04:00
Alexander Shaduri 57f9605f70 Split github build actions into 2 tiers (tier 1 and 2 supported platforms); tier 1 platforms are build automatically, tier 2 are built on demand. 2021-03-09 21:11:54 +04:00
Alexander Shaduri 4a658d8f43 Require proper cmake version in spec file. 2021-03-09 21:10:43 +04:00
Alexander Shaduri e4e438b579 Fixed rpm spec file for opensuse. 2021-03-09 20:58:23 +04:00
Alexander Shaduri 3080aa7f87 Updated rpm spec file's build requirements. 2021-03-09 18:00:29 +04:00
Alexander Shaduri 3e19e3e5cb Updated rpm spec file to support cmake. 2021-03-09 17:57:46 +04:00
Alexander Shaduri 09e9e7d380 Fixed cmake install target, support cpack windows binary zip / NSIS, support package_source target; removed cpack RPM and DEB support. 2021-03-09 17:14:51 +04:00
Alexander Shaduri cbd45a27fb Removed autotools-related files from gitignore. 2021-03-09 17:12:08 +04:00
Alexander Shaduri b0b9c4169e Initial refactoring to support cpack-based packaging and OBS builds. 2021-03-09 15:17:25 +04:00
Alexander Shaduri 8d6b75057e GitHub action: Fix passing correct cmake flags in freebsd build. 2021-03-09 15:16:19 +04:00
Alexander Shaduri 1ddcbc224e Fixed compilation under FreeBSD and QNX. 2021-03-09 13:08:27 +04:00
Alexander Shaduri 8dd21e2b82 Re-enable freebsd in github workflow. 2021-03-09 12:18:28 +04:00
Alexander Shaduri 2de5360ac8 Updated github workflow. 2021-03-08 18:46:13 +04:00
Alexander Shaduri 28bc0fc826 Updated github workflow. 2021-03-08 18:36:14 +04:00
Alexander Shaduri 98b96cdeb2 Updated github workflow. 2021-03-08 18:06:30 +04:00
Alexander Shaduri 98798a3e57 Updated configure-dev script with cmake support. 2021-03-08 17:24:31 +04:00
Alexander Shaduri 4d04cd5089 Updated github workflow. 2021-03-08 17:16:59 +04:00
Alexander Shaduri 0b8c94bf6f Updated configure-dev script with cmake support. 2021-03-08 17:12:04 +04:00
Alexander Shaduri 2f900bf3a2 Updated github workflow. 2021-03-08 17:11:37 +04:00
Alexander Shaduri 71a34549ab Updated github workflow. 2021-03-08 17:00:35 +04:00
Alexander Shaduri a1c7855a63 Updated github workflow. 2021-03-08 16:53:16 +04:00
Alexander Shaduri d101a92750 Support old Glibmm only with libstdc++. 2021-03-08 16:51:42 +04:00
Alexander Shaduri fce77dc7d7 Fixed building under macosx. 2021-03-08 16:51:12 +04:00
Alexander Shaduri 14a7e26e09 Updated github workflow. 2021-03-08 16:38:37 +04:00
Alexander Shaduri 700ada0b5b Updated github workflow to include macos. 2021-03-08 16:06:16 +04:00
Alexander Shaduri 740b544615 Fixed syntax error in cmake.yml. 2021-03-08 15:58:14 +04:00
Alexander Shaduri ad64427126 Don't use $GITHUB_WORKSPACE in msys2 build. 2021-03-08 15:57:13 +04:00
Alexander Shaduri 4463726d51 Disabled freebsd build for now (it's broken), 2021-03-08 15:52:46 +04:00
Alexander Shaduri 95cb1abab8 Use matrix msystem for msys builds. 2021-03-08 14:55:04 +04:00
Alexander Shaduri 10af1ab1f2 Use msys shell for msys builds. 2021-03-08 14:45:51 +04:00
Alexander Shaduri 824827ff26 Added new experimental GitHub workflows for ubuntu, windows-msys2, freebsd. 2021-03-08 14:38:29 +04:00
Alexander Shaduri 60d9bf1922 Add separate toolchain with clang-tidy support. 2021-03-05 14:19:45 +04:00
Alexander Shaduri cb42040a8d Add .vs (VS with CMake support) to gitignore. 2021-03-05 14:19:26 +04:00
Alexander Shaduri d9d681db5e Refactored libdebug's bitset-related types. 2021-03-05 14:19:01 +04:00
Alexander Shaduri 1d5e8822e6 Fixed compilation under MSYS2. 2021-03-04 14:35:05 +04:00
Alexander Shaduri 53a3f73156 Modernized Windows code, fixed compiler warnings under mingw. 2021-03-03 19:40:02 +04:00
Alexander Shaduri 28dacf4d74 Fixed all remaining clang-tidy warnings. 2021-03-03 18:15:23 +04:00
Alexander Shaduri 2859666708 Make all examples use main_tools.h exception wrapper. 2021-03-03 18:15:05 +04:00
Alexander Shaduri f861918789 Fixed compilation error in hz/main_tools.h. 2021-03-03 17:40:46 +04:00
Alexander Shaduri 8e2cf08be1 Cleaned up libdebug for clang-tidy warnings. 2021-03-03 17:40:21 +04:00
Alexander Shaduri 4f6f0ce9f6 Minor cleanup. 2021-03-03 16:54:59 +04:00
Alexander Shaduri 3032bbc4e7 Added new hz/main_tools.h header to cmake. 2021-03-03 16:54:37 +04:00
Alexander Shaduri 6f1dd37818 Fixed a few clang-tidy warnings in hz. 2021-03-03 16:54:16 +04:00
Alexander Shaduri f8369fe436 Fixed a few clang-tidy warnings in libdebug. 2021-03-03 16:53:50 +04:00
Alexander Shaduri ff3b07a086 Fixed a few clang-tidy warnings in applib. 2021-03-03 16:53:22 +04:00
Alexander Shaduri e329946213 Ported some main() functions to new main_tools. 2021-03-03 16:43:04 +04:00
Alexander Shaduri 5572421eca New hz::main_tools component to handle exceptions in main(). 2021-03-03 16:42:26 +04:00
Alexander Shaduri ef0803cb4d Redirect github page to old sourceforge page for now. 2021-03-03 12:22:21 +04:00
Alexander Shaduri 60ba6078c2 Fixed some problems reported by clang-tidy. 2021-03-02 19:12:18 +04:00
Alexander Shaduri 8d66596995 New .clang-tidy configuration to catch code problems. 2021-03-02 19:11:56 +04:00
Alexander Shaduri 07b6a27dc0 Fixed libintl conflicts causing compilation errors in Windows. 2021-03-02 18:25:16 +04:00
Alexander Shaduri 6e93516a4b Fixed copying .ico file in Windows. 2021-03-02 18:24:19 +04:00
Alexander Shaduri 5ce4a3aeb8 Implement toolchain support for cross-compilation and development. 2021-03-02 18:23:49 +04:00
Alexander Shaduri 2e3d8e72b6 Fixed a memory leak in utf8-to-utf16 conversion and a gcc warning. 2021-03-02 18:22:46 +04:00
Alexander Shaduri 0be08399a0 Fixed Win32 compiler errors related to paths. 2021-03-02 18:21:55 +04:00
Alexander Shaduri 0cd5202e74 Hide binary symbols by default. 2021-03-02 18:20:13 +04:00
Alexander Shaduri 1479256575 Update "JSON for Modern C++" to version 3.9.1. 2021-03-02 18:19:42 +04:00
Alexander Shaduri 306fbd503b Write debian and rpm scripts to "data" directory, not build directory. 2021-03-02 18:19:12 +04:00
Alexander Shaduri a5aff22d34 Link Win32 manifest into the gsmartcontrol binary. 2021-03-02 16:44:50 +04:00
Alexander Shaduri 3a8d75fbf0 Link Win32 manifest into the gsmartcontrol binary. 2021-03-02 16:44:23 +04:00
Alexander Shaduri 1d0762e756 Disable format-security warnings in Clang. 2021-03-02 16:43:25 +04:00
Alexander Shaduri d017f425d0 Use "example_" prefix instead of "_example" suffix for example sources and binaries. 2021-03-02 16:42:24 +04:00
Alexander Shaduri 56dec521c5 Updated Doxyfile with latest doxygen template. 2021-03-01 23:19:14 +04:00
Alexander Shaduri fdce91471e Fixed clang warning. 2021-03-01 22:45:19 +04:00
Alexander Shaduri 2986bb4893 Ported hz::scoped_ptr to std::unique_ptr and removed it. 2021-03-01 22:43:22 +04:00
Alexander Shaduri 8f82cd5c8a Removed unnecessary line in github action. 2021-03-01 22:42:49 +04:00
Alexander Shaduri 11bbbe1155 Removed TODO file. 2021-03-01 18:12:23 +04:00
Alexander Shaduri 80cc4c9515 Disable glibmm throw(...) workaround with newer glibmm. 2021-03-01 16:47:02 +04:00
Alexander Shaduri c6f506781b Make flags size_t. 2021-03-01 16:26:51 +04:00
Alexander Shaduri be22e3b999 Re-enable checkout action. 2021-03-01 16:26:34 +04:00
Alexander Shaduri 8cc7fb1e17 Disable compiler warnings unless explicitly enabled, to avoid compilation failures on older systems without specific warning flags. 2021-03-01 16:21:42 +04:00
Alexander Shaduri 28c86de4c9 Fixed compiler warning in libdebug. 2021-03-01 16:20:54 +04:00
Alexander Shaduri dac585c01b Fixed building examples. 2021-03-01 16:20:40 +04:00
Alexander Shaduri 357207c6a8 Added gettext as debian package dependency. 2021-03-01 16:20:21 +04:00
Alexander Shaduri 4e1db889c0 Disable github checkout action, it's unnecessary. 2021-03-01 16:19:59 +04:00
Alexander Shaduri 8d4f4d26f7 Added Ubuntu dependencies. 2021-03-01 15:19:59 +04:00
Alexander Shaduri 6e4766149f Fixed github action matrix. 2021-03-01 15:08:22 +04:00
Alexander Shaduri d4bc3f01bf Added github action (Ubuntu). 2021-03-01 15:04:52 +04:00
Alexander Shaduri d5785606a0 Updated homepage URLs and some copyright notices. 2021-03-01 14:53:00 +04:00
Alexander Shaduri d760a3d0f2 Map gtk log levels to libdebug log levels. 2021-03-01 14:44:30 +04:00
Alexander Shaduri b013cbd65c Updated copyright notices in .glade files. 2021-03-01 14:04:46 +04:00
Alexander Shaduri 698500fd3e Refactored the build config header and macros; Added OS- and compiler-specific options and macros to cmake. 2021-03-01 14:04:35 +04:00
Alexander Shaduri f0dfeaf8c0 Updated / added copyright headers. 2021-02-26 14:36:27 +04:00
Alexander Shaduri fed79c7de0 Updated .in files to use cmake variables. 2021-02-26 14:01:09 +04:00
Alexander Shaduri 8eaef139e9 Merge remote-tracking branch 'origin/master' 2021-02-24 17:58:02 +04:00
Alexander Shaduri c6ebf9feb1 Initial version of complete port to cmake; removed all autotools files. 2021-02-24 17:57:51 +04:00
Alexander Shaduri 9ec1e52b5a Create CNAME 2021-02-23 20:37:50 +04:00
Alexander Shaduri d0db433bc8 Added sample github pages. 2021-02-23 20:33:46 +04:00
Alexander Shaduri b7be12c7aa Removed old IDE files. 2021-02-23 20:33:28 +04:00
Alexander Shaduri 7b1217100b Updated license files and some file license headers. 2021-02-23 20:33:17 +04:00
Alexander Shaduri b24e0ef6f2 Moved files out of doc directory and updated them. 2021-02-23 20:32:40 +04:00
Alexander Shaduri dc6bd27d22 Added .gitignore, removed SVN ignore files. 2021-02-23 20:29:29 +04:00
Alexander Shaduri 0f6ff2a4cb Moved files out of gsmartcontrol directory after import from SVN. 2021-02-23 20:24:01 +04:00
Alexander Shaduri 7075a4f4d5 More work on cmake support. 2021-02-23 11:54:56 +00:00
Alexander Shaduri f4ed97d5ea Fixed a crash when system locale is set to invalid locale. 2021-01-05 12:25:21 +00:00
Alexander Shaduri 6d3a097f20 Started marking texts as translatable.
Fixed a few minor bugs.
2019-07-23 10:45:17 +00:00
Alexander Shaduri 5265ebb939 Implemented gettext integration.
Marked all window texts for translation (library texts still to go).
Switched glade files to use gtk 3.20, added copyright information.
2018-02-05 17:52:41 +00:00
Alexander Shaduri 9e783a5afc Drive settings are now serialized to config as json objects.
Removed bin2ascii_encoder.
2018-02-02 20:21:35 +00:00
Alexander Shaduri 0feb3b4aaa Data files are no longer compiled-in, but loaded at runtime.
Moved licenses and other documentation to "docs".
Simplified some GtkBuilder code.
2018-02-01 22:26:31 +00:00
Alexander Shaduri 6c624de79c Ported all filesystem code to C++17 std::filesystem.
Removed hz/fs_*.
Added new hz/fs.h and hz/fs_ns.h files with some filesystem utility functions.
Removed hz/string_wcmatch.h, it's no longer needed.
Removed hz/i18n.h, it never worked.
2018-01-31 20:17:03 +00:00
Alexander Shaduri b48bd99f70 More C++17 modernization. 2018-01-27 21:09:14 +00:00
Alexander Shaduri cbd0d94d90 Removed some autoconf checks, they're detected using macros now.
Use config.h only for CONFIG_* macros; for everything else - define them on
the command-line, or detect using feature checks.
Removed hz_config.h - moved all of its checks to respective files.
More C++17 modernization.
Split GscInfoWindow::fill_ui_with_info() into tab-specific functions.
2018-01-27 20:44:55 +00:00
Alexander Shaduri ee3adb70d4 Info window: Fixed attribute values not being rendered properly.
Fixed examples.
2018-01-15 21:16:53 +00:00
Alexander Shaduri d8af6a9af1 Got rid of intrusive_ptr. 2018-01-15 20:11:55 +00:00
Alexander Shaduri e20b4326a8 switch on type -> static map. 2018-01-15 17:28:04 +00:00
Alexander Shaduri 77e0278f93 enum -> enum class where applicable. 2018-01-15 16:55:03 +00:00
Alexander Shaduri 32623afb9b Use std::variant in StorageProperty. 2018-01-15 15:00:46 +00:00
Alexander Shaduri e83abacffd Ported to std::chrono.
Fixed lots of build warnings.
2018-01-14 21:39:55 +00:00
Alexander Shaduri 52eb101aeb GSmartControl is GPL3 only now.
Updated copyrights to 2018.
2018-01-13 20:31:43 +00:00
Alexander Shaduri 59b3a8a8e4 Don't use picojson (it has problems), use Lohmann's JSON for Modern C++. 2018-01-13 20:09:04 +00:00
Alexander Shaduri f87003b192 Removed rmn.
Added picojson.
Ported rconfig to picojson.
Ported rconfig's "/runtime" to GscStartupSettings.
2018-01-12 21:16:36 +00:00
Alexander Shaduri 89fb954223 Removed errno_string. 2018-01-05 21:30:13 +00:00
Alexander Shaduri ecea03b271 Fixed string_num.
Renamed tests to examples.
2018-01-02 19:47:15 +00:00
Alexander Shaduri f127fb9afd Further porting to C++17 (string_num, ...). 2018-01-01 22:58:42 +00:00
Alexander Shaduri c77d23be7a Moar porting. 2018-01-01 00:29:24 +00:00
Alexander Shaduri 72343e1067 Futher porting to C++17. 2017-12-31 23:09:29 +00:00
Alexander Shaduri 0902345808 Removed all thread stuff. 2017-12-31 16:56:17 +00:00
Alexander Shaduri 2ae1a561d7 Further removal of old code and porting to C++17. 2017-12-30 22:52:39 +00:00
Alexander Shaduri d4c06f61d6 Ported from hz::any_type to std::any. 2017-12-30 21:35:28 +00:00
Alexander Shaduri 02cfa33907 First round of porting to C++17 and removing old code. 2017-12-30 20:27:07 +00:00
Alexander Shaduri 6e8628b1df Fixed gsmartcontrol-root not launching if no GDK_* variables are set.
Increased version to 1.1.3.
2017-11-12 09:55:27 +00:00
Alexander Shaduri 2b19afe66d Fixed not picking up GDK_DPI_SCALE=-1 by command-line. 2017-11-11 20:49:09 +00:00
Alexander Shaduri 7236841d64 Fixed compilation under gcc 4.7. 2017-11-11 19:10:11 +00:00
Alexander Shaduri 49fb65ce71 Updated NEWS file. 2017-11-11 18:52:51 +00:00
Alexander Shaduri ad87baee70 Windows: Show volume names beside drives letters in tooltips. 2017-11-11 18:19:57 +00:00
Alexander Shaduri 5e8fef98ec Fixed compilation with gtkmm < 3.10 and gcc 4.7. 2017-11-11 11:32:19 +00:00
Alexander Shaduri 83baafa615 Force C++11 mode since gtkmm3 requires it, but fails to enable it on Centos7. 2017-11-11 10:44:49 +00:00
Alexander Shaduri 9f39db9517 Tweak default window size. 2017-10-06 10:26:43 +00:00
Alexander Shaduri 19f2bcf286 Fixed a crash when icon theme doesn't contain a specified icon. 2017-10-05 20:14:23 +00:00
Alexander Shaduri 02e8876acc Bumped version to 1.1.2. 2017-10-05 19:55:56 +00:00
Alexander Shaduri 4f78e3dd90 Removed unused function. 2017-10-04 21:10:34 +00:00
Alexander Shaduri 6888d0862d Increased iconview icon size to 64.
Increased iconview icon widths to correspond to 2 icons per row for default window size; the text
will less likely get wrapped in this case.
Changed bundled icons to size 64.
Fixed iconview icon blurriness with GDK_SCALE=2.
Use XDG-style icon names, as per GTK >= 3.10; fallback to old names and bundled icons if needed.
Removed all mention of .glade files from comments; don't use non-standard gnome names anymore.
Don't show empty "()" for drive letters in Linux.
Show "not mounted" for drive letters when no drive letters are present.
Added new "--gdk-scale" and "--gdk-dpi-scale" parameters, since pkexec discards user environment;
pass $GDK_SCALE and $GDK_DPI_SCALE to these from gsmartcontrol-root.
2017-10-04 21:09:32 +00:00
Alexander Shaduri a95be84eac Fixed make dist. 2017-09-25 15:00:50 +00:00
Alexander Shaduri b76b5f2227 Removed Help window.
Moved most of the documentation to website.
The Help menu items now open the website pages.
2017-09-25 14:58:58 +00:00
Alexander Shaduri 7a12c0880f Don't package gtkrc in Windows (it's unused).
Added French translations to desktop file.
2017-09-23 17:14:45 +00:00
Alexander Shaduri 58b0b1fab2 Windows: Changed GTK+ theme changing to use gtkmm functions.
Added some special cases to SCT parser.
2017-09-23 16:06:09 +00:00
Alexander Shaduri 16b5c322d5 Bumped version to 1.1.1.
Windows: Default to Adwaita theme for Windows 7 and Windows Server, since
"Classic" theme is broken in GTK+3 with win32 theme.
Format Statistics entry values with commas for readability.
2017-09-15 12:26:45 +00:00
Alexander Shaduri 16d5b82ac8 Fixed compilation under C++98.
Fixed smartmontools URLs.
2017-09-07 13:51:26 +00:00
Alexander Shaduri be66a8749c Bumped version to 1.1.0.
Updated NEWS file.
Clarified a message for self-test log entry count.
2017-09-07 12:43:38 +00:00
Alexander Shaduri 5192a9d447 Implemented ability to copy rows from Attribute, Statistics and Self-Test Log
tables.
2017-09-06 20:11:39 +00:00
Alexander Shaduri b9160ec173 Improved parser so that all the "-x" test data is parsed. 2017-09-05 20:53:19 +00:00
Alexander Shaduri 675fad3fc1 Documented RAID support. 2017-09-05 17:27:31 +00:00
Alexander Shaduri f7c01d6c7b Implemented "Update Drive Database" item in main window menu. 2017-09-05 16:12:19 +00:00
Alexander Shaduri 5bc6318dcd Implemented parsing of "==> Warning" in Info section. 2017-09-05 15:45:21 +00:00
Alexander Shaduri 3d8b0c94df Allow loading multiple virtual drives from one Open dialog. 2017-09-05 15:14:02 +00:00
Alexander Shaduri 73fec7fa3f Rate individual error log entries for error severity. 2017-09-05 14:53:47 +00:00
Alexander Shaduri 22971e8567 Show scan time on virtual drive icons.
Show windows drive letters if "device name under icon" is enabled.
2017-09-04 18:52:41 +00:00
Alexander Shaduri 3df4cdae56 Implemented devstat warnings. 2017-09-04 18:12:27 +00:00
Alexander Shaduri 062096a0b4 Improve GtkNotebook appearances in Windows.
Don't show Info window tabs if only one tab is present.
2017-09-04 16:57:08 +00:00
Alexander Shaduri 978e7d41b7 Added filters to file chooser dialogs.
Add .txt when saving files if it's not present (fixes a Windows bug when the
default drive name is cleared by typing something else).
2017-09-04 14:38:10 +00:00
Alexander Shaduri 33028f81d9 Fixed a few parser issues.
SCT temperature overrides all others now.
2017-09-04 13:43:40 +00:00
Alexander Shaduri 4cb12c5e0c Show temperature (from sct, devstat, or attributes) in Temperature Log tab,
including warnings.
Don't warn if SCT is unsupported.
2017-09-01 19:21:15 +00:00
Alexander Shaduri b01acfeef3 Added entry descriptions to Statistics table. 2017-09-01 17:53:09 +00:00
Alexander Shaduri b7676aaba8 Added Page,Offset column to Statistics.
Enabled multiple selection in treeviews.
Renamed ERC tab to Error Recovery.
2017-09-01 14:20:34 +00:00
Alexander Shaduri e0a13c6867 Implemented parsing of devstat section.
Implemented Statistics tab.
Increased borders in some tabs.
Some code style changes.
2017-09-01 13:42:51 +00:00
Alexander Shaduri 9f5db6d034 Visual improvements in Error Log tab. 2017-08-31 20:50:41 +00:00
Alexander Shaduri 5c3bfe8db0 Fixed not detecting the number of errors in extended error log. 2017-08-31 20:44:00 +00:00
Alexander Shaduri 5926e43bc5 Refactored Info Window tabs (again).
Implemented support for Temperature Log, ERC, Physical, Directory tabs.
Added detection of a few "not supported" messages.
Added some more --get=all output lines.
Smartctl invocation now corresponds to -x, and -x output can be loaded as
a virtual drive (parsed fully except for devstat).
2017-08-31 20:03:04 +00:00
Alexander Shaduri f21f076386 Refactored Info window UI (added tabs for various logs).
Hid annoying gcc warning.
2017-08-29 19:06:46 +00:00
Alexander Shaduri da403b28c9 Require smartmontools version 5.43 at runtime. 2017-08-29 15:13:13 +00:00
Alexander Shaduri faba9270a0 Use --format=brief attribute format by default.
Removed "Updated" column from attributes; advanced users can look at flags to
get that information.
2017-08-29 13:41:38 +00:00
Alexander Shaduri 9ca87eb296 Use -l xerror,error and -l xselftest,selftest by default.
Implemented parsing of xerror, xselftest sections.
2017-08-29 13:26:25 +00:00
Alexander Shaduri b2b97f2c9a Added more info output detection (APM feature is...).
Enable -v by default on Windows (makes debugging easier).
2017-08-29 11:47:14 +00:00
Alexander Shaduri 8494880943 Fixes in spec file.
Fixes with polkit's pkexec invocation.
2017-08-28 12:29:54 +00:00
Alexander Shaduri 0f8f38f0e1 Fixed compilation. 2017-08-28 10:12:39 +00:00
Alexander Shaduri 8544163c46 Make sure we bundle the polkit file on make dist. 2017-08-28 09:59:42 +00:00
Alexander Shaduri fdcd190592 Added --get=all information to General section.
Made General section scrollable
Changed all smartctl invocation parameters to full versions (very old smartctl
versions didn't support these, but we can drop their support from now on).
2017-08-27 20:00:43 +00:00
Alexander Shaduri 40e08796d1 Use pkexec --disable-internal-agent for polkit.
Don't warn on Unknown property "Form Factor".
2017-08-27 19:07:52 +00:00
Alexander Shaduri 1e72729056 Implemented PolKit support.
Install gsmartcontrol binary to /usr/sbin.
Removed Fedora consolehelper support from spec file (in favor of PolKit).
2017-08-27 17:33:09 +00:00
Alexander Shaduri 731122e891 Bumped version number to 1.0.3. 2017-08-26 17:23:43 +00:00
Alexander Shaduri ebb3ab6017 Removed local copy of pcrecpp, always use system-installed one (it's not a
rarity anymore).
2017-08-26 17:23:14 +00:00
Alexander Shaduri 3d2fe7fd50 Windows: Show drive letters for each device. 2017-08-26 16:47:11 +00:00
Alexander Shaduri 9a70345f4a Format large numbers according to locale (usually with commas).
Save Open/Save paths across windows and program restarts.
2017-08-26 13:18:32 +00:00
Alexander Shaduri 897a4efa96 Save / load default window size and position (both for main window, size only
for info window).
2017-08-26 12:09:51 +00:00
Alexander Shaduri 6ab53c5436 Updated site URLs to https://gsmartcontrol.sourceforge.io/ . 2017-08-18 09:33:55 +00:00
Alexander Shaduri 6b5110e0b9 Updated NEWS file. 2017-07-21 10:08:04 +00:00
Alexander Shaduri 687c0bfe08 Fixed being able to turn on AODC even if unsupported. 2017-07-20 19:15:22 +00:00
Alexander Shaduri 48b069fef4 Added missing icon dialog-information under Windows.
Don't use gtk-stock icons (they're deprecated).
2017-07-19 14:41:12 +00:00
Alexander Shaduri ab48307235 Bump version to 1.0.2.
Bundle missing icons during make-win-dist so that the sorting
indicators are displayed properly.
2017-07-19 14:09:34 +00:00
Alexander Shaduri 93c43d8612 Make sure we capture the full output of smartctl under Windows. 2017-07-19 13:53:06 +00:00
Alexander Shaduri bf9889cb0c Fixed compilation under macOS.
Fixed compilation under Fedora Rawhide.
Don't use -mtune=generic for all targets.
Don't use common compiler options by default.
2017-06-19 14:29:12 +00:00
Alexander Shaduri 6e7d67aa61 Updated news file for 1.0.0. 2017-06-16 16:55:58 +00:00
Alexander Shaduri 16f60c678b Fixed build under older gtk3. 2017-06-16 10:49:59 +00:00
Alexander Shaduri 1b8f7bd886 About dialog: Fixed mailto: links not working under Windows. 2017-06-16 10:26:21 +00:00
Alexander Shaduri 31278654a0 Fixed Help menu items not scolling to right locations. 2017-06-16 10:01:45 +00:00
Alexander Shaduri 80e87d7868 Tweaked default window sizes. 2017-06-16 09:58:13 +00:00
Alexander Shaduri e21ccb9671 Fixed NSIS installer issues. 2017-06-15 21:09:27 +00:00
Alexander Shaduri e6cdcc9ee2 Fixed win64 zip packaging. 2017-06-15 20:07:23 +00:00
Alexander Shaduri 4a579b5141 Fixed "Use system-installed smartctl" not working with newer smartmontools. 2017-06-15 19:54:11 +00:00
Alexander Shaduri dc166364de Implemented native file chooser dialogs (Windows). 2017-06-15 19:37:09 +00:00
Alexander Shaduri 4564fd2948 Disable client-side window decorations under Windows. 2017-06-15 18:16:00 +00:00
Alexander Shaduri c591823c3e Disable dpi-aware for now; it has some artifacts (titlebar, checkboxes, font
size) under 250%.
Make main window a bit larger.
2017-06-15 12:34:38 +00:00
Alexander Shaduri 7a1904c1ef Get rid of "More", make its children direct parts of the GUI. 2017-06-14 21:53:16 +00:00
Alexander Shaduri 5c5466d6b2 Fixed "More" button to show horizontal layout.
Fixed win-dist target not picking up glib-2.0 schemas and Adwaita icons.
2017-06-14 21:30:05 +00:00
Alexander Shaduri 6aaf467950 Don't require library packages in spec - they are auto-computed by OBS. 2017-05-19 21:24:39 +00:00
Alexander Shaduri 428abcb3e7 Fixed syntax error in spec file. 2017-05-19 21:13:01 +00:00
Alexander Shaduri 9dea31e3d7 Don't generate tar.gz distribution files.
Compatibility with gtk3 <= 3.8.
Updated spec file to avoid errors on Fedora.
2017-05-19 21:10:39 +00:00
Alexander Shaduri 154b609576 Removed logo from About dialog (it wasn't working).
Changed back to Windows 2000 compatibility - apparently gtk3 in cross/mingw supports XP.
Updated svn ignore flags for new autotools-generated files.
Updated debian and spec files to reflect new gtk3 requirements.
Enabled dpiAware flag for Windows - gtk3 should support it properly.
Rewrote win32/win64 packaging to pick proper files (including gtk3).
Removed nogtk distribution generation code (it doesn't make sense without gtk installer).
Changed configure-dev to support msys- and cross-based mingw (win32 and win64).
2017-05-19 20:33:43 +00:00
Alexander Shaduri 7bfb502aa0 Added msys configuration to configure-dev. 2017-05-19 16:16:05 +00:00
Alexander Shaduri ded7d3bc86 Properly expand menubar. 2017-05-18 16:42:34 +00:00
Alexander Shaduri 526c1f6a69 Make sure menubar is expanded horizontally. 2017-05-18 16:35:03 +00:00
Alexander Shaduri 6fd501d553 Fixed launching URLs in About dialog under Windows. 2017-05-18 15:57:39 +00:00
Alexander Shaduri 11aa08354e Fixed an error in process_signa.h (win32). 2017-05-18 15:44:31 +00:00
Alexander Shaduri 0bfbebeb8b Avoid unhandled exception Gtk::IconThemeError. 2017-05-18 15:35:14 +00:00
Alexander Shaduri 413ba1c1a9 Fixed autogen warnings about AR. 2017-05-18 15:34:23 +00:00
Alexander Shaduri fdec3e8151 Fixed "empty iconview" text displaying.
Disabled no-deprecation flags to avoid future incompatibilities.
Info window: Renamed "Identity" tab to "General".
2017-05-17 18:28:49 +00:00
Alexander Shaduri 0012f831a8 Fixed a crash on exit. 2017-05-17 17:35:48 +00:00
Alexander Shaduri c8962a4e67 Fix Info Identity tab to look like the gtk2 version. 2017-05-17 17:10:57 +00:00
Alexander Shaduri 74d09cf879 Initial (incomplete) port to GTK 3.4. 2017-05-17 16:49:20 +00:00
Alexander Shaduri afdb516386 Updated copyright years. 2017-05-11 08:42:23 +00:00
Alexander Shaduri 9a1f28fe9a Fixed some win32 installer issues. 2017-05-10 21:26:56 +00:00
Alexander Shaduri b4583a7cc6 Bumped version to 0.9.0. 2017-05-10 20:08:20 +00:00
Alexander Shaduri 9918b13214 Updated drive descriptions to drivedb.h r4430, 2017-05-03.
Fixed selective self-test section parsing (if it's unsupported).
2017-05-10 20:06:44 +00:00
Alexander Shaduri 3f9d830294 Added appdata metainfo file. 2017-05-08 17:54:25 +00:00
Alexander Shaduri 7b2627b236 Clear the drives and show "please rescan" message after the preferences are
updated; this ensures that no old settings are used.
2017-05-08 17:16:27 +00:00
Alexander Shaduri c40d87b3ae Require gtk2 2.6.0 until we move to 2.24.0.
Win32 drive detection: stop scanning only after 3 not-found drives, so that
we detect drives after old removed drives.
2017-05-08 16:47:52 +00:00
Alexander Shaduri 99f707b6c6 Require gtk2 2.24.0, for future compatibility with gtk3. 2017-05-08 10:51:27 +00:00
Alexander Shaduri a561d5fef6 Changed the license field in spec file to conform to OBS requirements. 2016-06-04 16:14:12 +00:00
Alexander Shaduri 1d305e7626 Fixed time formatting with VS. 2015-07-01 12:10:23 +00:00
Alexander Shaduri 194fb51f75 Disable dpiAware flag in win32 manifest since it's not supported that well. 2014-05-29 18:00:49 +00:00
Alexander Shaduri e2dc39bff2 Don't show the info window if there's nothing to show. 2014-05-05 10:37:24 +00:00
Alexander Shaduri 836aa73430 Avoid scientific notation when displaying the drive size. 2014-05-05 10:16:38 +00:00
Alexander Shaduri 63f5b885a3 Fixed glib 2.32 warnings. 2014-05-05 09:36:10 +00:00
Alexander Shaduri c68d017475 Updated to latest libhz. 2014-05-05 09:20:18 +00:00
Alexander Shaduri bbe3bac923 Make sure we write some data from the Info window on Save Output if only basic
data is available.
Fixed a harmless "Number of written bytes doesn't match the data size" warning.
Added support for SSD-only and HDD-only vendor attributes.
Added the latest (r3897 / 2014-04-28) attributes from smartmontools.
Increased the Info window size a bit.
2014-05-05 08:59:13 +00:00
Alexander Shaduri 2293e357f4 Increased main window size a bit to avoid the iconview shift down each time an
icon is selected.
Added some scsi-output properties to full parser to avoid console warnings.
Devices having only basic info can be displayed now in the info window.
2014-04-30 10:38:48 +00:00
Alexander Shaduri 85dbceb14d Fixed a crash at scan time (bad parsing of empty smartctl output sections).
Updated program descriptions to include SSD.
2014-04-16 20:04:04 +00:00
Alexander Shaduri 45cba39be7 RAID volumes which report having SMART are now detected and explicitly set to
not having SMART.
2013-10-17 10:26:53 +00:00
Alexander Shaduri a0b235dd8a Increased timeouts when executing commands before the "Cancel" dialog is
shown; this helps with constant focus stealing from other windows when
smartctl is too slow (usually under Windows).
2013-02-25 20:27:18 +00:00
Alexander Shaduri 7e3db9ec30 Implemented detection for some new "not supported" smartctl messages. 2013-02-24 20:07:51 +00:00
Alexander Shaduri 6cc8770599 Implemented Linux support for Areca controllers with enclosures (untested).
Implemented Windows support for Areca controllers (thanks to Richard Kagerer);
untested so far.
2013-02-24 20:02:30 +00:00
Alexander Shaduri 462d465f3a Modified all glade files to use gtk 2.8 compatibility (not sure if it works).
Removed "tooltip_text" properties from all glade files, "tooltip" should be
enough.
Set the "activates_default" property on all relevant entries in glade files;
this will make the Enter key activate the default dialog action when these
entries are focused.
Added some clarifying text to Add Device dialog.
Clarified the per-drive parameters section (what it does) in Preferences.
Added a confirmation dialog in case the user doesn't set the Parameters field
in one of the Per-Drive Parameters entries.
Added a "Smartctl Options" section to README/Help.
Clarified the difference between smartctl.exe and smartctl-nc.exe in a
tooltip.
Improved some other tooltips.
2013-02-11 11:09:00 +00:00
Alexander Shaduri 6ac62cd0de Device detection is a lot more verbose now.
The read /proc files are now cached to avoid needless re-reading.
Some other minor changes.
2013-02-10 20:55:58 +00:00
Alexander Shaduri 1174b62b8f Bumped version number to 0.8.8. 2012-12-23 19:27:47 +00:00
Alexander Shaduri ef713900a0 Implemented support for HP controllers behind cciss and hpsa/hpahcisr drivers. 2012-12-23 19:25:20 +00:00
Alexander Shaduri c60f6815fa Fixed BDRW drive detection (it was detected as a HDD).
Added support for recent smartctl -i changes.
2012-09-28 08:52:10 +00:00
Alexander Shaduri 7ca709fcbb Fixed a comment. 2012-08-11 14:24:58 +00:00
Alexander Shaduri c3ce878376 Don't require libglademm in debian control file, it confuses newer Ubuntus. 2012-08-11 14:19:58 +00:00
Alexander Shaduri a06ac42eff Don't limit Fedora versions. 2012-08-11 13:30:55 +00:00
Alexander Shaduri 444eb6c211 Fixed spec file problems with Fedora.
Updated NEWS file.
2012-08-11 11:43:39 +00:00
Alexander Shaduri eb6cbe1ee0 Fixed make dist error. 2012-08-10 16:47:11 +00:00
Alexander Shaduri bcae9a2c37 Increased application version to 0.8.7.
Added Fedora consolehelper support to the spec file.
2012-08-10 16:33:29 +00:00
Alexander Shaduri d411b34dae Updated smartctl attributes from r3515 to r3587.
Added warnings for SSD lifetime attributes.
2012-08-10 15:49:28 +00:00
Alexander Shaduri a0fad4375a Added options to show device name and serial number under drive icons.
Added serial number to drive icon tooltip.
Fixed compiler error introduced in previous revision.
Removed some useless tooltips from UI.
2012-08-10 09:44:06 +00:00
Alexander Shaduri ffb02984fe Documented the rest of the code (rconfig, rmn, libdebug).
Fixed up the doxygen documentation, should be in usable state now.
2012-08-08 17:33:26 +00:00
Alexander Shaduri b400df2565 Completely documented hz, gsc and applib.
Fixed some compiler warnings.
Removed some unused files.
Added hz/initialized.h as part of hz.
2012-08-05 20:18:22 +00:00
Alexander Shaduri b06607cc37 Added a missing #include statement that caused build errors on SLES SP2.
Updated .spec and .desktop file to fix some warnings.
2012-04-28 15:17:44 +00:00
Alexander Shaduri 8881f42470 Fixed the detection of 3ware 9750 (twl) devices.
Implemented support for systems with several different 3ware controllers
(twa/twe/twl).
2012-03-12 20:06:33 +00:00
Alexander Shaduri 6558d31680 Support Areca RAID controller detection under Linux (untested).
Support 3ware 3w-sas-supported RAID controller detection under Linux (untested).
2012-03-03 18:03:15 +00:00
Alexander Shaduri 6e949677ec Don't open \\.\PhysicalDriveN needlessly if it was filtered out by --scan-open. 2012-02-26 19:19:34 +00:00
Alexander Shaduri 72f2d166b6 Updated the man page to reflect the new gsmartcontrol-root syntax.
The previous commit also contained the following changes:
The gsmartcontrol-root wrapper script now properly escapes the arguments
before passing them to gsmartcontrol.
gsmartcontrol-root has a new argument "--desktop=..." which replaces the old
positional argument; compatibility with the old invokation syntax has been
retained.
2012-02-19 15:09:26 +00:00
Alexander Shaduri 7b13cdf7b3 GSmartControl now prints an error message and a help text if an invalid
command-line options was specified.
2012-02-19 15:04:47 +00:00
Alexander Shaduri c7bdaad30a Fixed invalid parsing of tw_cli output which caused non-detection of drives
and controllers with controller or port numbers greater than 9 (3ware linux,
windows).
The same-brand controllers with identical SCSI host numbers are collapsed into
one controller now (the others are for LUNs and only pollute the drive list).
The drives are sorted during detection, not when adding them to the GUI.
The drive sorting algorithm has been slightly changed.
2012-02-19 13:10:05 +00:00
Alexander Shaduri fd9fce25fc Implemented support for Adaptec RAID 5805 controller and possibly other
Adaptec models as well.
2012-02-19 10:28:52 +00:00
Alexander Shaduri 5ba7add5b5 Fixed a few VS /analyze warnings in win32_tools.h. 2012-01-16 16:28:52 +00:00
Alexander Shaduri 68889d3804 Updated copyright headers for year 2012.
Updated the command line option descriptions in the man page and README.txt.
2012-01-11 17:26:34 +00:00
Alexander Shaduri 8ab18d433a The manifest now indicates that GSmartControl is dpi-aware (no more blurring
in high-dpi situations under Windows).
2012-01-09 16:52:29 +00:00
Alexander Shaduri 13d83949c4 Fix possibly invalid utf-8 data before showing it to the user (GscTextWindow,
GscExecutorLogWindow).
2011-12-15 16:58:06 +00:00
Alexander Shaduri daf98009d4 Added description for Multi_Zone_Error_Rate. 2011-12-15 15:57:58 +00:00
Alexander Shaduri 0cf5848772 Merged FreeBSD patches (fix in gsmartcontrol-root, /dev/ada* detection. 2011-11-19 18:08:58 +00:00
Alexander Shaduri 0ecc4bd8d3 Fixed compilation under Glib 2.31.x. 2011-11-02 16:00:39 +00:00
Alexander Shaduri 388a195794 Fixed compilation error.
Fixed parsing 'smartctl -v 194,raw8 -a' output (the attribute line).
2011-10-15 17:56:55 +00:00
Alexander Shaduri 0f89010225 Documented some more of hz. 2011-08-17 20:15:58 +00:00
Alexander Shaduri 42da49c5c1 Documented parts of hz library using doxygen tags. 2011-08-16 20:05:39 +00:00
Alexander Shaduri 0ffba26b1f Added (untested) Doxyfile.
Documented a few more hz files.
Added clang detection to the build system, use it when setting flags, etc...
Added some clang-specific flags to avoid excessive and unneeded warnings.
Fixed compilation under clang.
Fixed some clang-reported warnings.
2011-08-15 20:08:11 +00:00
Alexander Shaduri b19b094aaa Fixed a bug that issued SIGTERM to the child process instead of SIGKILL.
Documented applib completely.
Some minor member visibility adjustments.
2011-07-30 19:57:28 +00:00
Alexander Shaduri 5cc1e898b9 Use model name as well when detecting S/N duplicates. 2011-07-30 16:16:21 +00:00
Alexander Shaduri a4aa68a085 Very minor documentation changes.
NSIS: Don't strip update-smart-database.exe (it breaks if stripped) and
smartctl* (no reason to do it).
NSIS: Delete gtk installer on uninstall, sometimes it's not deleted during
installation.
2011-06-20 20:59:36 +00:00
Alexander Shaduri c954101bd9 Updated attribute database to smartmontools 5.41. 2011-06-11 17:27:28 +00:00
Alexander Shaduri d20aeb4121 Updated attribute DB.
Support older smartctl when filtering out 3ware sd* devices.
2011-06-07 17:08:57 +00:00
Alexander Shaduri 9440de5ca9 Updated some docs.
Proper filtering of /dev/sd* devices with older smartctl and 3ware.
Added missing file to Makefile.am.
2011-06-01 07:44:43 +00:00
Alexander Shaduri c2955b508c Fixed compilation under non-Linux/Windows platforms. 2011-05-28 12:49:56 +00:00
Alexander Shaduri fbf70814f0 Fixed make dist. 2011-05-28 12:22:54 +00:00
Alexander Shaduri a823790926 Updated NEWS file. 2011-05-28 12:18:05 +00:00
Alexander Shaduri 14838b82ae Updated readme. 2011-05-28 10:11:21 +00:00
Alexander Shaduri e11347c005 Support brief format of attributes, parse them to populate known columns. 2011-05-11 09:22:43 +00:00
Alexander Shaduri 98842f238e Windows: SUpport tw_cli/cx/px variant of smartctl device if --scan-open fails
and tw_cli is installed.
2011-05-01 14:41:58 +00:00
Alexander Shaduri 5ffc87ad9b Set tooltips wherever we have "No description available". 2011-05-01 13:03:36 +00:00
Alexander Shaduri fb5d139443 The detection now executes smartctl on the drives directly.
Don't execute smartctl --info if it was already executed during drive detection.
Made number of scanned ports configurable.
2011-05-01 12:16:26 +00:00
Alexander Shaduri 9d6ee05660 Add debian/ubuntu's su-to-root support to gsmartcontrol-root. 2011-04-30 18:41:36 +00:00
Alexander Shaduri 1ee97606aa Confirm operations (quit, rescan) when tests are running, don't just deny them. 2011-04-28 18:42:03 +00:00
Alexander Shaduri b6f721c167 Detect scsi number for 3ware and use that for tw_cli controller (Linux). 2011-04-20 12:23:54 +00:00
Alexander Shaduri ede4933819 Display device type argument along with device name everywhere. 2011-04-20 10:38:41 +00:00
Alexander Shaduri 70ce4a6d06 Fixed detecting usb flash drive names under winxp (smartctl would return a cli
parse error, which is incorrect).
Fixed parsing smartctl --scan-open output under windows.
2011-04-20 10:19:20 +00:00
Alexander Shaduri 213c26db3f Don't add sd* device if it's 3ware controller.
Properly add devices detected through 3ware scan (linux).
Limit smartctl sequential scans to 24 drives (it takes too long without it).
2011-04-19 17:59:44 +00:00
Alexander Shaduri 8ae3c42100 Added tooltips to both the labels and the entries in Add Device and Preferences
dialogs.
Changed the tooltips to avoid showing unsupported values for that OS.
Fixed usb drive re-detection with scsi (regression from previous commit).
Fixed invalid regexps in tw_cli output parsing (fixes 3ware in windows).
Added support for "Product" field of USB drives (used instead of Device in
newer smartctl).
2011-04-18 12:14:20 +00:00
Alexander Shaduri ff466a1d2d Add a note that we probably support Intel Matrix controllers as well. 2011-04-17 20:55:50 +00:00
Alexander Shaduri 5e46ed7cb6 Added support for devices detected by "smartctl --scan-open" under win32 (this
includes 3ware).
2011-04-17 20:36:54 +00:00
Alexander Shaduri c197ba76fa Support detecting drives behind 3ware controllers.
Add ExecutorFactory - now detectors can create their own gui or non-gui
executors, depending on who called them.
2011-04-17 18:47:43 +00:00
Alexander Shaduri fa2b10f3ce Show drive WWN and sector size. 2011-04-17 09:28:59 +00:00
Alexander Shaduri 7b523aa075 Updated to latest drivedb.h.
Made the type entry in Add Device window an editable combo, added sample types.
2011-04-16 20:38:39 +00:00
Alexander Shaduri 0ca9971460 Some more UI tweaks.
A new "Add Device" dialog - allows specifying type and additional smartctl
parameters.
Drive properties in preferences - allow specifying device type.
2011-04-16 19:25:06 +00:00
Alexander Shaduri b3f23abec0 Made the user interface more GNOME HIG-compliant. 2011-04-16 11:29:46 +00:00
Alexander Shaduri a2d735fee5 Added support for specifying -d option and extra parameters via command line
and preferences dialog. StorageDevice will use the specified type and
arguments when executing smartctl. This change effectively adds support for
multiple drives behind a single device name.
The preferences dialog can distinguish between various device types now (when
supplying smartctl arguments).
2011-04-04 20:02:41 +00:00
Alexander Shaduri fb801d8ebb Documented, reorganized StorageDevice source code.
Added "type argument" and "extra arguments" fields to StorageDevice.
2011-04-04 18:22:18 +00:00
Alexander Shaduri 9a92bfec45 Renamed "type" field (and all related stuff) of StorageDevice to detected_type. 2011-04-04 16:46:28 +00:00
Alexander Shaduri 6d50abb3cf Detect one more "smart unsupported" string in the latest version of smartctl
output.
Add a hint about "pd0" for Windows version in Preferences dialog.
2011-04-04 16:26:10 +00:00
Alexander Shaduri 778872363a New and improved attribute database (including SSD attributes).
Attributes are now matched according to smartctl names, and only then by ids.
Attribute notices are set by their generic names, not ids.
Improved displaying of attributes when they're unknown to us but known to
smartctl.
Set descriptions on all known capabilities.
Disabled tooltips on self-test log and error log entries (they always showed
"description unavailable" anyway).
2011-03-12 21:06:15 +00:00
Alexander Shaduri 6c404d57c9 Use -include only when using pch.
Document OptionalValue.
Use spaces when formatting date/time.
Capitalize some property names for consistency.
2011-03-09 11:26:52 +00:00
Alexander Shaduri 449b645278 Split storage detector to per-platform files. 2011-03-06 21:12:18 +00:00
Alexander Shaduri 02428a26c0 Show Error Log and Self-Test Log support.
Support attributes with undefined values like "---".
2011-03-06 20:31:39 +00:00
Alexander Shaduri 90bbc19923 Fixed inability to parse some error types in error log. 2011-03-06 19:04:13 +00:00
Alexander Shaduri 4f5690c89b Added ability to show smartctl output for devices whose info could not be
parsed fully.
2011-03-06 18:06:14 +00:00
Alexander Shaduri 4000fa1a2e Added the ability to configure default smartctl info save filename through
config file.
Use model-serial-date.txt for default save filename.
2011-03-06 17:15:56 +00:00
Alexander Shaduri ba7ffafa7f Updated copyrights to 2011.
Adjust Makefile.am for dist-files.
Added configure-dev script for easy developer-build configuration.
2011-03-06 10:43:38 +00:00
Alexander Shaduri 33b59d5723 Updated copyrights to 2010.
Reimplement locale stuff in hz (adding different controls for C and C++
locales), also take the recent locale-related changes in gtkmm into account.
Cleanups in snprintf-related code, portable_snprintf().
Added doxygen-style comments to some hz headers.
Better console redirection handling for win32.
Blacklisted linux device mapper devices (annoying in LVM setups).
Added beesu support and generally improved gsmartcontrol-root script (this is
needed for Fedora 14 which doesn't have any old supported su mechanisms).
Added "menu" dependency for deb packages.
Added kdev4 project.
2010-12-26 20:35:24 +00:00
Alexander Shaduri 28551a9666 Note: This revision was used to build 0.8.5-4 Windows package.
Set C++ locale as well, when setting C locale.
Improved windows installer.
2010-12-26 20:12:08 +00:00
Alexander Shaduri c5478d6a0e Note:This revision was used to build 0.8.5-3 Windows package.
Previous test result is cleared in GUI when running new tests now.
Windows: Vastly improved installer, supports built-in GTK+ now.
Windows: A proper method of privilege escalation is used for Vista/7.
Windows: GSmartControl works on Windows 7 now.
Updated copyright for files with Whatever License to use Unlicense.
2010-12-26 20:07:02 +00:00
Alexander Shaduri 2ca8174054 Importing 0.8.5. 2010-12-26 19:50:52 +00:00
637 changed files with 84751 additions and 43256 deletions
+95
View File
@@ -0,0 +1,95 @@
---
# Exceptions:
# bugprone-branch-clone is too noisy in parsing code.
# cert-dcl50-cpp is triggered by debug_print()'s C style.
# clang-analyzer-deadcode.DeadStores is too noisy.
# clang-analyzer-cplusplus.NewDeleteLeaks doesn't understand Gtkmm memory management.
# cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers is triggered by attribute database.
# cppcoreguidelines-owning-memory doesn't support deleting Gtkmm objects.
# cppcoreguidelines-pro-type-cstyle-cast needed by GTK C casts.
# cppcoreguidelines-pro-type-reinterpret-cast is needed by WinAPI-facing functions
# cppcoreguidelines-pro-type-vararg is triggered by libdebug's debug_print().
# cppcoreguidelines-pro-bounds-array-to-pointer-decay is triggered by va_start in libdebug's debug_print().
# cppcoreguidelines-pro-bounds-pointer-arithmetic is useless (triggered by argv) until we have std::span.
# misc-no-recursion is too noisy.
# modernize-raw-string-literal is very noisy.
# modernize-use-trailing-return-type is contrary to our style.
# readability-convert-member-functions-to-static is triggered for many callbacks.
# readability-function-cognitive-complexity needed by UI constructors.
# readability-isolate-declaration is noisy.
Checks: >
-abseil-*,
-altera-*,
-android-*,
-boost-*,
bugprone-*,
-bugprone-branch-clone,
cert-*,
-cert-dcl50-cpp,
clang-analyzer-*,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-cplusplus.NewDeleteLeaks,
concurrency-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-darwin-*,
-fuchsia-*,
google-*
hicpp-*,
-linuxkernel-*,
-llvm-*,
-llvmlibc-*,
misc-*,
-misc-no-recursion,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-raw-string-literal,
-mpi-*,
-objc-*,
openmp-*,
performance-*,
portability-*,
readability-*,
-readability-convert-member-functions-to-static,
-readability-function-cognitive-complexity,
-readability-isolate-declaration,
-readability-magic-numbers,
-zircon-*
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
CheckOptions:
- key: bugprone-exception-escape.CheckCapsOnly
value: '1'
- key: cppcoreguidelines-macro-usage.CheckCapsOnly
value: '1'
- key: cppcoreguidelines-owning-memory.LegacyResourceConsumers
value: '::free;::realloc;::freopen;::fclose;Gtk::manage'
- key: misc-assert-side-effect.AssertMacros
value: assert,DBG_ASSERT
- key: misc-assert-side-effect.CheckFunctionCalls
value: '0'
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: performance-unnecessary-value-param.AllowedTypes
value: 'RefPtr;Ptr$'
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: '1'
- key: readability-implicit-bool-cast.AllowConditionalPointerCasts
value: '1'
...
+3
View File
@@ -0,0 +1,3 @@
# Make sure github recognizes header files as C++, not C.
*.h linguist-language=C++
+165
View File
@@ -0,0 +1,165 @@
name: Build (Tier 1 platforms)
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
SMARTMONTOOLS_INSTALLER: smartmontools-7.2-1.win32-setup.exe
SMARTMONTOOLS_URL: https://nav.dl.sourceforge.net/project/smartmontools/smartmontools/7.2/smartmontools-7.2-1.win32-setup.exe
jobs:
linux-ubuntu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt-get install libpcre3-dev libgtkmm-3.0-dev gettext
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: >
cmake $GITHUB_WORKSPACE
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE
- name: Pack (cmake install and make binary package)
shell: bash
working-directory: ${{runner.workspace}}/build
run: cpack -G TBZ2
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Linux Packages
path: ${{runner.workspace}}/build/gsmartcontrol-*-Linux*.*
windows-msys2:
runs-on: windows-latest
strategy:
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 },
{ msystem: MINGW32, arch: i686 }
]
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
# p7zip is needed to extract smartmontools
# fontconfig owns /etc/fonts
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
mingw-w64-${{ matrix.arch }}-gtkmm3
mingw-w64-${{ matrix.arch }}-pkg-config
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-fontconfig
make
p7zip
- name: Configure CMake
shell: msys2 {0}
working-directory: ${{runner.workspace}}
run: >
cmake -B build -S "$GITHUB_WORKSPACE" -G "MSYS Makefiles"
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
- name: Build
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: msys2 {0}
run: ctest -C $BUILD_TYPE
- name: Download Package Requirements
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: |
mkdir smartmontools
cd smartmontools
wget $SMARTMONTOOLS_URL
- name: Extract Package Requirements (64-bit)
if: ${{ matrix.msystem == 'MINGW64' }}
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build/smartmontools
run: >
7z -bb1 e $SMARTMONTOOLS_INSTALLER
bin64/smartctl.exe
bin64/smartctl-nc.exe
bin/update-smart-drivedb.exe
bin/drivedb.h
- name: Extract Package Requirements (32-bit)
if: ${{ matrix.msystem == 'MINGW32' }}
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build/smartmontools
run: >
7z -bb1 e $SMARTMONTOOLS_INSTALLER
bin/smartctl.exe
bin/smartctl-nc.exe
bin/update-smart-drivedb.exe
bin/drivedb.h
- name: Package ZIP
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: cpack -G ZIP
- name: Package NSIS (64-bit)
if: ${{ matrix.msystem == 'MINGW64' }}
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: cpack -G NSIS64
- name: Package NSIS (32-bit)
if: ${{ matrix.msystem == 'MINGW32' }}
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: cpack -G NSIS
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Windows Packages
path: ${{runner.workspace}}/build/gsmartcontrol-*-win*.*
+76
View File
@@ -0,0 +1,76 @@
name: Build (Tier 2 platforms)
# Manually triggered
on: [workflow_dispatch]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
macos-homebrew:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: brew install pkg-config gtkmm3 pcre cmake
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: >
cmake $GITHUB_WORKSPACE
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -C $BUILD_TYPE
freebsd:
runs-on: macos-latest
# env:
# variables to pass to VM
# MYTOKEN : ${{ secrets.MYTOKEN }}
steps:
- uses: actions/checkout@v2
- name: Build and test in FreeBSD
id: test
uses: vmactions/freebsd-vm@v0.1.2
with:
envs: 'BUILD_TYPE'
usesh: true
sync: rsync
mem: 2048
prepare: >
pkg install -y cmake pkgconf gtkmm30 gettext pcre libiconv
run: >
mkdir build && cd build
cmake ..
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
cmake --build . --config $BUILD_TYPE
ctest -C $BUILD_TYPE
+42
View File
@@ -0,0 +1,42 @@
# Builds
/0*
/doxygen_doc*
/win32*
/win64*
/cmake-build-*
# Non-project files
/TODO
# Doxygen generated
/doxygen_doc
# OS-generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
# IDE
/.vs
/*.pcs
/.idea
/CMakeLists.txt.user
# Translations
/po/boldquot.sed
/po/en@boldquot.header
/po/en@quot.header
/po/insert-header.sin
/po/Makevars.template
/po/quot.sed
/po/remove-potcdate.sin
/po/Rules-quot
/po/gsmartcontrol.pot
/po/*.gmo
-16
View File
@@ -1,16 +0,0 @@
0*
*.pcs
autom4te.cache
Makefile.in
configure
depcomp
config.guess
config.sub
aclocal.m4
config.h.in
missing
install-sh
*.glade.cpp
*.ui.cpp
*.txt.cpp
gsmartcontrol.spec
-1
View File
@@ -1 +0,0 @@
Alexander Shaduri <ashaduri 'at' gmail.com>
+80
View File
@@ -0,0 +1,80 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
# 3.12 for CMAKE_PROJECT_VERSION
cmake_minimum_required(VERSION 3.12)
# Use new policy for option() to supress warnings.
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
include(${CMAKE_SOURCE_DIR}/version.txt)
project(gsmartcontrol
VERSION ${CMAKE_PROJECT_VERSION}
DESCRIPTION "Hard Disk Drive and SSD Health Inspection Tool"
HOMEPAGE_URL "https://gsmartcontrol.shaduri.dev"
LANGUAGES CXX
)
# Provide DATADIR, etc...
include(GNUInstallDirs)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
include(src/build_config/compiler_options.cmake)
# Disable RPATH manipulation, we don't have shared libraries
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
# Write the binaries to project root (avoids conflicts with manifests, also it's more convenient this way)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
# User-controlled build options
option(APP_BUILD_EXAMPLES "Build examples" OFF)
option(APP_BUILD_TESTS "Build tests" OFF)
# Install documentation
set(DOC_FILES
LICENSE.LGPL3.txt
LICENSE.txt
NEWS.txt
README.md
)
if (WIN32)
install(FILES ${DOC_FILES} DESTINATION doc/)
install(DIRECTORY docs DESTINATION doc/
PATTERN "*.yml" EXCLUDE
PATTERN "CNAME" EXCLUDE
)
else()
install(FILES ${DOC_FILES} DESTINATION "${CMAKE_INSTALL_DOCDIR}/")
install(DIRECTORY docs DESTINATION "${CMAKE_INSTALL_DOCDIR}/"
PATTERN "*.yml" EXCLUDE
PATTERN "CNAME" EXCLUDE
)
endif()
# CTest support
include(CTest)
include(${CMAKE_SOURCE_DIR}/dependencies/catch2/Catch2/extras/Catch.cmake)
add_subdirectory(contrib)
add_subdirectory(data)
add_subdirectory(dependencies)
add_subdirectory(packaging)
add_subdirectory(src)
# Packaging support
include(packaging/cpack_options.cmake)
-1
View File
@@ -1 +0,0 @@
See LICENSE.gsmartcontrol.txt file for copyright and license information.
-1
View File
@@ -1 +0,0 @@
See the NEWS file.
+2524
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
See README.txt file, Installation section.
+165
View File
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
View File
-26
View File
@@ -1,26 +0,0 @@
Copyright (c) 1987, 1989, 1990, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-339
View File
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-37
View File
@@ -1,37 +0,0 @@
GSmartControl License
This product is multi-licensed under GNU GPL versions 2 and 3.
You are free to choose which one you use.
This program is free software: you can redistribute it and/or modify it under
the terms of either version 2 or (at your option) version 3 of the GNU General
Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public Licenses for more details.
You should have received copies of these licenses along with this program.
If not, see <http://www.gnu.org/licenses/>.
See LICENSE_gpl2.txt and LICENSE_gpl3.txt for details.
All files which don't have any copyright notices, tests and examples are
covered under the Whatever License. See LICENSE_whatever.txt for details.
Portions of this software are copyright Google Inc. See LICENSE_pcrecpp.txt
for details.
This product includes the HZ library (or portions of it). See LICENSE_hz.txt
for details.
This product includes icons from Crystal Project,
copyright 2006-2007 Everaldo Coelho.
http://www.everaldo.com/crystal, http://www.yellowicon.com .
Crystal Project icons are licensed under GNU LGPL. See
http://www.everaldo.com/crystal/?action=license for details.
-36
View File
@@ -1,36 +0,0 @@
HZ Library License
The HZ library contains software licensed under several different licenses.
This is due to HZ including portions of other software.
All original code (except for the tests) is licensed under the Zlib License.
See LICENSE_zlib.txt for details.
All tests and examples are covered under the Whatever License. See
LICENSE_whatever.txt for details.
Portions of this software are copyright Regents of the University of
California, see LICENSE_bsd-ucb.txt for details.
Portions of this software are licensed under Boost Software License, see
LICENSE_boost_1_0.txt and individual source files for copyright information.
Each source file contains its copyright information.
If you intend to use HZ in your product, please note that you MUST include
these licenses somewhere in your distribution (simply redistributing the
license files or reproducing their texts in documentation and/or other
supplied materials is OK):
* LICENSE_zlib.txt (source distributions only);
* LICENSE_bsd-ucb.txt (source and binary distributions);
* LICENSE_boost_1_0.txt (source distributions only).
If you use only portions of HZ, you may ignore this requirement for files you
don't use. For example, if you don't use any of the Boost-licensed files, you
are not required to distribute the Boost license.
-28
View File
@@ -1,28 +0,0 @@
Copyright (c) 2005, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-12
View File
@@ -1,12 +0,0 @@
Whatever License
THIS SOFTWARE IS PROVIDED 'AS-IS', WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN NO EVENT WILL THE AUTHORS BE HELD LIABLE FOR ANY DAMAGES
ARISING FROM THE USE OF THIS SOFTWARE.
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
-17
View File
@@ -1,17 +0,0 @@
Zlib License
THIS SOFTWARE IS PROVIDED 'AS-IS', WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN NO EVENT WILL THE AUTHORS BE HELD LIABLE FOR ANY DAMAGES
ARISING FROM THE USE OF THIS SOFTWARE.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-143
View File
@@ -1,143 +0,0 @@
# Add autoconf.m4 directory to local macro search path
ACLOCAL_AMFLAGS = -I autoconf.m4
SUBDIRS = data debian.dist src
# These files are actually needed for compilation.
noinst_DATA = AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt
# For the files to be bundled with the distribution, specify them in
# one of the following.
# These will be installed into docdir.
# Some of these files are actually needed for compilation (see src/res/Makefile.am).
dist_doc_DATA = AUTHORS.txt ChangeLog NEWS README.txt \
LICENSE_boost_1_0.txt \
LICENSE_bsd-ucb.txt \
LICENSE_gpl2.txt \
LICENSE_gpl3.txt \
LICENSE_gsmartcontrol.txt \
LICENSE_hz.txt \
LICENSE_pcrecpp.txt \
LICENSE_whatever.txt \
LICENSE_zlib.txt
# nobase_ preserves their directory names.
nobase_dist_doc_DATA = contrib/cron-based_noadmin/README \
contrib/cron-based_noadmin/cron_gather_smart.sh \
contrib/cron-based_noadmin/crontab.example \
contrib/cron-based_noadmin/smartctl_subst.sh
# Extra files bundled with distribution.
# file2csource.sh is needed for building but not installed.
EXTRA_DIST = COPYING TODO INSTALL configure autogen.sh \
baqup gsmartcontrol.kdevelop \
templates \
file2csource.sh \
gsmartcontrol.spec
# PCH support
global_macros.h.gch: $(top_srcdir)/src/global_macros.h
$(CXX) $(CXXFLAGS) $(DEFS) -x "c++-header" $(top_srcdir)/src/global_macros.h -o global_macros.h.gch
gch: global_macros.h.gch
gch-clean:
rm -f global_macros.h.gch
# rpm support
src-rpm: dist
rpmbuild -ts $(distdir).tar.bz2
# Don't use this - it does something weird, and gcc errors out with "long long long" errors, etc...
#rpm: dist
# rpmbuild -ta $(distdir).tar.bz2
# NSIS installer support.
# Requires wine, installed NSIS, gtkmm dlls, pcre dlls, smartctl-nc.exe, smartctl.exe.
# dos2unix on build machine.
# Execute only with win32 build present.
WIN_ZIP_NAME = $(PACKAGE)-$(VERSION)-win32
win-dist: win-dist-prepare nsis-dist-nocleanup win-zip-dist
win-dist-clean:
rm -rf gsmartcontrol-*.exe gsmartcontrol-*.zip nsis-dist $(WIN_ZIP_NAME)
win-dist-prepare: all win-dist-clean
$(MKDIR_P) nsis-dist
cp data/nsis/gsmartcontrol.nsi $(top_srcdir)/data/nsis/nsi_* nsis-dist/
cp $(top_srcdir)/data/gsmartcontrol.ico $(top_srcdir)/data/icon_*.png nsis-dist/
$(MKDIR_P) nsis-dist/doc
cp data/nsis/distribution.txt nsis-dist/doc/
cp $(top_srcdir)/AUTHORS.txt $(top_srcdir)/LICENSE_* $(top_srcdir)/README.txt nsis-dist/doc/
cp $(top_srcdir)/NEWS nsis-dist/doc/NEWS.txt
unix2dos nsis-dist/*.nsi nsis-dist/doc/*.txt
cp "@WINDOWS_DLLS_LOCATION@"/libatkmm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libcairomm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libgdkmm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libgiomm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libglibmm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libgtkmm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libpangomm-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/libsigc-*.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/pcre3.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/mingwm10.dll nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/smartctl-nc.exe nsis-dist/
cp "@WINDOWS_DLLS_LOCATION@"/smartctl.exe nsis-dist/
cp src/gsmartcontrol.exe nsis-dist/
$(STRIP) nsis-dist/*.exe
mv nsis-dist/mingwm10.dll nsis-dist/mingwm10.dll_
$(STRIP) --strip-debug --strip-unneeded nsis-dist/*.dll
mv nsis-dist/mingwm10.dll_ nsis-dist/mingwm10.dll
nsis-dist: nsis-dist-nocleanup nsis-cleanup
nsis-dist-nocleanup: win-dist-prepare
cd nsis-dist && @NSIS_EXEC@ gsmartcontrol.nsi
mv nsis-dist/$(PACKAGE)-$(VERSION).exe .
nsis-cleanup:
rm -rf nsis-dist
win-zip-dist: win-zip-dist-nocleanup win-zip-dist-cleanup
win-zip-dist-nocleanup: win-dist-prepare
mv nsis-dist $(WIN_ZIP_NAME)
rm -rf $(WIN_ZIP_NAME)/gsmartcontrol.ico $(WIN_ZIP_NAME)/nsi_* $(WIN_ZIP_NAME)/*.nsi
zip -9r $(WIN_ZIP_NAME).zip $(WIN_ZIP_NAME)
win-zip-dist-cleanup:
rm -rf $(WIN_ZIP_NAME)
distclean-local: gch-clean win-dist-clean
-89
View File
@@ -1,89 +0,0 @@
Version 0.8.4, released on 2009-03-23
Linux Software RAID devices are blacklisted now. (backported from Debian).
Attributes tab is before the capabilities tab now.
A man page has been generously contributed by Giuseppe Iuculano
<giuseppe@iuculano.it>.
Smartctl version now includes the CVS snapshot date (if available).
Windows: Look for "smartctl-nc.exe" instead of "smartctl.exe" by default.
Windows: Use smartmontools-supplied smartctl-nc.exe by default (if found).
Other minor changes (mainly Debian backports).
Version 0.8.3, released on 2008-12-27
A random "Smartctl returned an empty output" error on Windows was fixed.
Thanks to Zurab Khetsuriani for testing.
Fixed a parser issue which prevented running self-tests in Windows.
The supplied icon (hopefully) shows correctly in Windows 2000 now.
This release adds an official support for Windows 2000 SP4.
Added scripts to allow GSmartControl to read smartctl data from
cron-generated files. This allows users to read somewhat recent
smartctl information without having to run GSmartControl as root.
Generously contributed by Alex Butcher <alex dot butcher 'at'
assursys.co.uk>.
Configure script correctly aborts instead of printing a warning if gtkmm
or libglademm (if needed) is not found.
Configure script now accepts --enable-windows-console,
--disable-abort-if-no-gtkmm, --disable-abort-if-no-glade-reader,
as well as Windows-supporting "auto" for --enable-nsis-wine and
--with-nsis.
Configure's --with-win32-env has been renamed to --with-windows-dlls.
The "About" dialog shows version information now.
Minor bugs were fixed.
Version 0.8.2, released on 2008-12-10
Fixed gsmartcontrol_root.sh script to support distributions with no
/usr/sbin in their users' paths (thanks to Erwan Velu).
Added desktop auto-detection to gsmartcontrol_root.sh script. This allows
us to use only one desktop file (thanks to Erwan Velu).
Added Debian package directory (named "debian.dist" for now to avoid
control file conflicts with Build Service).
Renamed gsmartcontrol_root.sh to gsmartcontrol-root, to make Debian happy.
Added make targets for Windows packages (zip and NSIS).
Fixed Windows-related issues (Vista is fully supported now).
Fixed minor bugs:
Smartctl parser is win32-locale-aware now.
No more unnecessary parsing.
No segfault on exit under Windows and Solaris.
A friendlier message is displayed if smartctl was not found.
No highlighted labels when switching tabs in Information window.
Version 0.8.1, released on 2008-11-11
Disabled Linux "by-id" drive detection - it's unreliable on some broken
systems.
Added some more attribute descriptions.
Our names for attributes override smartctls' now.
Added a proper "Add Device" dialog for Windows.
Added an icon and resource file for Windows.
Fixed minor bugs.
Version 0.8.0rc4, released on 2008-10-20
FreeBSD support (tested with DesktopBSD 1.6 (FreeBSD 6.3) / x86).
NetBSD support (tested with NetBSD 4.0.1 / x86).
OpenBSD support (tested with OpenBSD 4.3 / x86-64 / gcc-3.3.5).
Solaris/gcc support (tested with Solaris 10 / x86 / gcc-3.4.3 / blastwave).
Solaris/sunstudio support (tested with Solaris 10 / x86 / sunstudio12 /
sunfreeware).
Code to support Windows, Mac OS X, QNX.
Support of older pcre versions (at least 4.5, maybe older too).
Added gsmartcontrol_root.sh script to easily run gsmartcontrol as root.
Improved .desktop files.
License for tests and examples is legally more correct now.
Minor bugfixes.
Version 0.8.0rc3, released on 2008-10-08
Added support for udevless Linux distributions by providing a fallback
/proc/partitions-based drive detection method. The new method adds
support for Linux 2.4 and older systems. Thanks to Paul Marwick for
reporting and testing.
Fixed invalid error messages with directory-related operations.
Fixed invalid verbosity levels of console output of debug messages in
non-debug builds.
Improved rpm spec file - now supports building on OpenSUSE build
service with various distributions as targets.
Version 0.8.0rc2, released on 2008-10-05
Fixed compilation under gcc 4.3. Thanks to Peter Linnell for reporting.
Removed test data (there's a lot of it and it's unnecessary).
Version 0.8.0rc1, released on 2008-10-01
Initial public release.
+230
View File
@@ -0,0 +1,230 @@
Version 1.1.3, released on 2017-11-12
Fixed gsmartcontrol-root not launching if GDK_* variables are not set.
Version 1.1.2, released on 2017-11-11
Fixed gsmartcontrol-root not passing GDK_SCALE and GDK_DPI_SCALE variables
to gsmartcontrol when using PolKit.
Fixed blurriness of icons in the main window with GDK_SCALE=2.
Tweaked the main window interface.
Windows: Show volume labels beside drive letters in icon tooltips.
Version 1.1.1, released on 2017-09-25
Windows: Use Adwaita GTK+ theme for systems which support Classic Windows
theme, since the default win32 GTK+ theme is broken in it; this
includes Windows 7 and Windows Server.
Statistics entry values are formatted with commas for readability.
Moved help information to website.
Version 1.1.0, released on 2017-09-07
New Statistics, Temperature Log, Error Recovery, Physical and Directory
tabs.
General tab shows non-SMART device settings as well.
Attributes tab shows entries in "brief" format.
Error Log tab shows Extended error log by default (if supported).
Self-Test Log tab now shows Extended self-test log by default (if
supported).
GSmartControl now uses "-x" equivalent for retrieving data (as upposed to
"-a"); loading "-x" outputs as virtual drives is also supported.
Implemented ability to copy rows in CSV format from Attribute, Statistics
and Self-Test Log tables.
Implemented "Update Drive Database" functionality.
Windows: Drive letters are shown for each drive.
Scan time is shown under virtual drive icons.
Polkit is supported with gsmartcontrol-root script now.
Pcrecpp is no longer bundled, use system-installed one instead.
Smartmontools version 5.43 is required at runtime.
Other minor improvements and fixes.
Version 1.0.2, released on 2017-07-21
Fixed incomplete capturing of smartctl output under Windows.
Added missing icons under Windows.
Fixed being able to turn on AODC even if unsupported.
Version 1.0.1, released on 2017-06-19
Fixed compilation under macOS.
Fixed compilation under Fedora Rawhide.
Don't use -mtune=generic for all targets.
Version 1.0.0, released on 2017-06-16
Ported to GTK+ 3.
Tweaked the user interface a bit.
Dropped support for Windows XP, 2000 and 2003 (they are no longer
supported by GTK+).
Fixed detection of newer system-installed smartmontools under Windows.
Version 0.9.0, released on 2017-05-11
Implemented (untested) support for Linux-based Areca controllers with
enclosures.
Implemented (untested) support for Windows-based Areca controllers (thanks
to Richard Kagerer).
Implemented (untested) support for Linux-based HP controllers with cciss
and hpsa/hpahcisr drivers (thanks to Fabrice Bacchella).
Changes in Preferences no longer fail silently until rescan/restart.
Better drive detection under Windows after removable drives are detached.
Windows version is no longer marked as "dpi aware" since it's not
supported that well.
Drive attribute descriptions have been updated (including clarifications
for SSDs).
Added support for SSD-only and HDD-only vendor attributes.
Devices having only basic info can be displayed now in the info window.
Fixed BDRW drive detection (it was detected as a HDD).
Other minor improvements.
A number of issues have been fixed (including a crash).
Version 0.8.7, released on 2012-08-11
Implemented support for Adaptec RAID 5805 controller and possibly other
Adaptec models as well (Linux).
Implemented support for Areca RAID controller detection under Linux
(untested).
Implemented support for 3ware 3w-sas-supported (twl) RAID controller
detection under Linux (untested).
Implemented support for systems with several different 3ware controllers
(twa/twe/twl).
Fixed invalid parsing of tw_cli output which caused non-detection of
drives and controllers with controller or port numbers greater than 9
if tw_cli was found (3ware linux, windows).
The duplicate drives are no longer shown for some Intel matrix controllers
under Windows; Intel RAID controllers are fully supported under
Windows now.
Added options to show device name and serial number under drive icons.
Updated SMART attribute definitions and added warnings for SSD lifetime
attributes.
gsmartcontrol-root has a new argument "--desktop=..." which replaces the
old positional argument; compatibility with the old invocation syntax
has been retained.
Completely documented the source using doxygen tags.
Added support for Fedora's consolehelper.
Made GSmartControl DPI-aware under Windows.
Fixed compilation issues with clang and gcc 4.7, as well as glib 2.31.x
and newer.
Fixed minor issues in NSIS installer.
Fixed other minor bugs and made minor improvements.
Version 0.8.6, released on 2011-06-12
Support detecting drives behind 3ware controllers (Linux, Windows),
including tw_cli/cx/px mode in Windows. Having tw_cli is recommended
but not required.
Added support for specifying -d option and extra parameters via command
line, "Add Device" and "Preferences" dialogs. This change effectively
adds full support for multiple drives behind a single device name.
Beesu and su-to-root are supported by gsmartcontrol-root script now.
Completely revamped the attribute database and its handling, should be a
lot more usable and forward-compatible now; SSD attributes are also
included.
In-program help has been expanded considerably.
General improvements to user interface have been implemented (better GNOME
HIG compliance, better tooltips, dialogs, etc...).
Added ability to show smartctl output for devices whose info could not be
parsed fully.
Attributes in "brief" format are supported now.
The parser has been updated to reflect the recent changes in smartctl.
Quit and rescan operations are no longer denied without confirmation when
tests are running.
The Windows NSIS installer has been vastly improved.
Better support for Windows Vista and 7.
Changed copyright notices for files with Whatever License to use Unlicense.
Added other minor features and fixed quite a few bugs.
Version 0.8.5, released on 2009-09-05
GSmartControl now uses XDG config directory for per-user configuration on
UNIX and CSIDL_PROFILE directory on Windows. Existing configuration is
migrated automatically.
The names are shown correctly for unsupported devices even with the latest
smartctl snapshots now.
Smartctl SVN revision is shown (if available).
The progress bars update properly when parallel tests are run.
Windows: GSmartControl should be able to operate on any valid filesystem
path (not just locale-representable ones).
Windows: GSmartControl is now officially compilable on x86_64 via mingw64.
Fixed compilation under very old gtkmm/libglademm, and with gcc 4.4.
Fixed parsing of multiple error types in SMART error log.
Added minor features and fixed miscellaneous bugs.
Version 0.8.4, released on 2009-03-23
Linux Software RAID devices are blacklisted now. (backported from Debian).
Attributes tab is before the capabilities tab now.
A man page has been generously contributed by Giuseppe Iuculano
<giuseppe@iuculano.it>.
Smartctl version now includes the CVS snapshot date (if available).
Windows: Look for "smartctl-nc.exe" instead of "smartctl.exe" by default.
Windows: Use smartmontools-supplied smartctl-nc.exe by default (if found).
Other minor changes (mainly Debian backports).
Version 0.8.3, released on 2008-12-27
A random "Smartctl returned an empty output" error on Windows was fixed.
Thanks to Zurab Khetsuriani for testing.
Fixed a parser issue which prevented running self-tests in Windows.
The supplied icon (hopefully) shows correctly in Windows 2000 now.
This release adds an official support for Windows 2000 SP4.
Added scripts to allow GSmartControl to read smartctl data from
cron-generated files. This allows users to read somewhat recent
smartctl information without having to run GSmartControl as root.
Generously contributed by Alex Butcher <alex dot butcher 'at'
assursys.co.uk>.
Configure script correctly aborts instead of printing a warning if gtkmm
or libglademm (if needed) is not found.
Configure script now accepts --enable-windows-console,
--disable-abort-if-no-gtkmm, --disable-abort-if-no-glade-reader,
as well as Windows-supporting "auto" for --enable-nsis-wine and
--with-nsis.
Configure's --with-win32-env has been renamed to --with-windows-dlls.
The "About" dialog shows version information now.
Minor bugs were fixed.
Version 0.8.2, released on 2008-12-10
Fixed gsmartcontrol_root.sh script to support distributions with no
/usr/sbin in their users' paths (thanks to Erwan Velu).
Added desktop auto-detection to gsmartcontrol_root.sh script. This allows
us to use only one desktop file (thanks to Erwan Velu).
Added Debian package directory (named "debian.dist" for now to avoid
control file conflicts with Build Service).
Renamed gsmartcontrol_root.sh to gsmartcontrol-root, to make Debian happy.
Added make targets for Windows packages (zip and NSIS).
Fixed Windows-related issues (Vista is fully supported now).
Fixed minor bugs:
Smartctl parser is win32-locale-aware now.
No more unnecessary parsing.
No segfault on exit under Windows and Solaris.
A friendlier message is displayed if smartctl was not found.
No highlighted labels when switching tabs in Information window.
Version 0.8.1, released on 2008-11-11
Disabled Linux "by-id" drive detection - it's unreliable on some broken
systems.
Added some more attribute descriptions.
Our names for attributes override smartctls' now.
Added a proper "Add Device" dialog for Windows.
Added an icon and resource file for Windows.
Fixed minor bugs.
Version 0.8.0rc4, released on 2008-10-20
FreeBSD support (tested with DesktopBSD 1.6 (FreeBSD 6.3) / x86).
NetBSD support (tested with NetBSD 4.0.1 / x86).
OpenBSD support (tested with OpenBSD 4.3 / x86-64 / gcc-3.3.5).
Solaris/gcc support (tested with Solaris 10 / x86 / gcc-3.4.3 / blastwave).
Solaris/sunstudio support (tested with Solaris 10 / x86 / sunstudio12 /
sunfreeware).
Code to support Windows, Mac OS X, QNX.
Support of older pcre versions (at least 4.5, maybe older too).
Added gsmartcontrol_root.sh script to easily run gsmartcontrol as root.
Improved .desktop files.
License for tests and examples is legally more correct now.
Minor bugfixes.
Version 0.8.0rc3, released on 2008-10-08
Added support for udevless Linux distributions by providing a fallback
/proc/partitions-based drive detection method. The new method adds
support for Linux 2.4 and older systems. Thanks to Paul Marwick for
reporting and testing.
Fixed invalid error messages with directory-related operations.
Fixed invalid verbosity levels of console output of debug messages in
non-debug builds.
Improved rpm spec file - now supports building on OpenSUSE build
service with various distributions as targets.
Version 0.8.0rc2, released on 2008-10-05
Fixed compilation under gcc 4.3. Thanks to Peter Linnell for reporting.
Removed test data (there's a lot of it and it's unnecessary).
Version 0.8.0rc1, released on 2008-10-01
Initial public release.
+118
View File
@@ -0,0 +1,118 @@
# GSmartControl
### Hard disk drive and SSD health inspection tool
[GSmartControl](https://gsmartcontrol.shaduri.dev/)
is a graphical user interface for smartctl (from [smartmontools](https://www.smartmontools.org/)
package), which is a tool for
querying and controlling [SMART](https://en.wikipedia.org/wiki/S.M.A.R.T.)
(Self-Monitoring, Analysis, and Reporting
Technology) data on modern hard disk and solid-state drives. It allows you to
inspect the drive's SMART data to determine its health, as well as run various
tests on it.
GSmartControl supports ATA drives (both PATA and SATA), various USB to
ATA bridges and drives behind some RAID controllers:
* Adaptec (Linux, some models only)
* Areca (Linux, Windows)
* HP CCISS (Linux)
* HP hpsa / hpahcisr (Linux)
* Intel Matrix Storage (CSMI) (Linux, Windows, FreeBSD)
* LSI 3ware (Linux, Windows)
* LSI MegaRAID (Windows)
Note: Smartmontools supports even more RAID Controllers. The drives
behind such controllers can be manually added to GSmartControl using
"Add Device..." functionality or `--add-device` command-line option.
See [Supported RAID Controllers](https://www.smartmontools.org/wiki/Supported_RAID-Controllers).
## Software Requirements
Note: If using the official Windows package, no additional software is required.
### Build Requirements
* [pcre1](https://www.pcre.org)
* [GTK+ 3](https://www.gtk.org), version 3.4 or higher
* [Gtkmm](https://www.gtkmm.org), version 3.4 or higher
### Runtime Requirements
* [smartmontools](https://www.smartmontools.org/)
* xterm (optional)
### Supported Operating Systems
* Linux - All the popular configurations should work.
* FreeBSD - Tested with DesktopBSD / x86.
* NetBSD - Tested with NetBSD / x86.
* OpenBSD - Tested with OpenBSD / x86-64.
* DragonFlyBSD - Code written but no testing has been performed yet. Expected
to work without any issues.
* Windows Vista SP2 (32-bit and 64-bit), Windows 7 SP1, Windows Server 2008,
Windows 8.1, Windows 10. The Windows port uses pd0, pd1, etc...
for physical drives 0, 1, etc... .
* Mac OS X.
* Solaris.
* QNX - Code written but no testing has been performed yet.
## Usage
### Command-Line Options
GSmartControl inherits options from GTK+ and other libraries, so be sure to
run it with `--help` option to get a full list of accepted parameters.
Note: The Windows version may not have a text output at all, so `--help` and
similar arguments won't have any effect.
The most important parameters are:
`-?`, `--help` - Show help options.
`-l`, `--no-locale` - Don't use system locale.
`-V`, `--version` - Display version information.
`--no-scan` - Don't scan devices on startup.
`--no-hide-tabs` - Don't hide non-identity tabs when SMART is disabled. Useful
for debugging.
`--add-virtual <file>` - Load smartctl data from file, creating a virtual drive. You
can specify this option multiple times.
`--add-device <device>::<type>[::<extra_args>]` - Add a device to device list.
This option is useful with `--no-scan` to list certain drives only. You can specify
this option multiple times.
Example:
`--add-device /dev/sda --add-device /dev/twa0::3ware,2 --add-device
'/dev/sdb::::-T permissive'`.
`-v`, `--verbose` - Enable verbose logging; same as `--verbosity-level 5`.
`-q`, `--quiet` - Disable logging; same as `--verbosity-level 0`.
`-b`, `--verbosity-level` - Set verbosity level [0-5].
## Copyright and Licensing
GSmartControl is Copyright (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com> and contributors.
GSmartControl is licensed under the terms of
[GNU General Public License Version 3](https://www.gnu.org/licenses/gpl-3.0.en.html).
This program is free software: you can redistribute it and/or modify it under
the terms of version 3 of the GNU General Public License as published by the
Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public Licenses for more details.
This product includes icons from Crystal Project,
copyright 2006-2007 Everaldo Coelho (https://www.everaldo.com).
Crystal Project icons are licensed under [GNU LGPL](https://www.gnu.org/licenses/lgpl-3.0.en.html).
-412
View File
@@ -1,412 +0,0 @@
About GSmartControl
GSmartControl - Hard disk drive health inspection tool.
GSmartControl is a graphical user interface for smartctl (from smartmontools
package, see http://smartmontools.sourceforge.net), which is a tool for
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
Technology) data on modern hard disk drives. It allows you to inspect the
drive's SMART data to determine its health, as well as run various tests on
it.
Note: Only ATA drives (both PATA and SATA) are supported for now.
http://gsmartcontrol.berlios.de
Features
* automatically reports and highlights any anomalies;
* allows enabling/disabling SMART;
* allows enabling/disabling Automatic Offline Data Collection - a short
self-check that the drive will perform automatically every four hours with no
impact on performance;
* supports configuration of global and per-drive options for smartctl;
* displays drive identity information, capabilities, attributes, and
self-test/error logs;
* performs SMART self-tests;
* can read in smartctl output from a saved file, interpreting it as a
read-only virtual device;
* works on most smartctl-supported operating systems;
* has extensive help information.
What Is SMART?
Short answer: SMART is a technology which provides hard disk drives with
methods to predict certain kinds of failures with certain chance of success.
Long answer: read below.
Self-Monitoring, Analysis, and Reporting Technology, or SMART, is a
monitoring system for hard drives to detect and report various indicators of
reliability, in the hope of anticipating failures. It is implemented inside
the drives SMART provides several ways of monitoring hard drive health. It
may provide information about general health, various drive attributes (for
example, number of unreadable sectors), error logs, and so on. It may also
provide ways to instruct the drive to run various self-tests, which may report
valuable information. It may even automatically scan the disk surface in when
the drive is idle, and repair the defects, reallocating the data to more safe
areas.
While having SMART sounds really good, there are some nuances to consider. One
of the common pitfalls is that it may create a false sense of security. That
is, a perfectly good SMART data is NOT an indication that the drive won't fail
the next minute. The reverse is also true - some drives may function perfectly
even with not-so-good-looking SMART data. However, as studies indicate, given
a large population of drives, some SMART attributes may reliably predict
drive failures within up to two months.
Another common mistake is to assume that the attribute values are the real
physical values, as experienced by the drive. As manufacturers do not
necessarily agree on precise attribute definitions and measurement units, the
exact meaning of the attributes may vary greatly across different drive
models.
At present SMART is implemented individually by manufacturers, and while some
aspects are standardized for compatibility, others are not. In fact, most
manufacturers refer the users to their own health monitoring utilities, and
advice against taking SMART data seriously. Nevertheless, SMART may prove an
effective measure against data loss.
Yet another issue is that quite often the drives have bugs which prevent
correct SMART usage. This is usually due to buggy firmware, or the
manufacturer ignoring the standard. Luckily, smartmontools usually detects
these bugs and works around them.
Software Requirements
You need to have the following software installed:
* pcre - http://www.pcre.org .
* smartmontools - see http://smartmontools.sourceforge.net .
* GTK+, version 2.6 or higher - see http://www.gtk.org .
* Gtkmm, version 2.6 or higher - see http://www.gtkmm.org .
* libglademm, version 2.4 or higher - see http://www.gtkmm.org .
Note: libglademm is not needed when using GTK 2.12 and Gtkmm 2.12.
Note that having GTK+ 2.12 and Gtkmm 2.12 is HIGHLY recommended. While earlier
versions may work, they may produce suboptimal results and buggy behavior.
Libglademm is not needed when using GTK / Gtkmm 2.12.
Most of these packages are probably already provided by your distribution.
Here are the packages you need to have to build GSmartControl on some Linux
distributions:
openSUSE, SLES, SLED:
gcc-c++, pcre-devel, gtkmm2-devel, (possibly) libglademm-devel.
Fedora, CentOS, RHEL:
gcc-c++, pcre-devel, gtkmm24-devel, (possibly) libglademm24-devel.
Mandriva:
gcc-c++, gcc-cpp, libpcre-devel, gtkmm2.4-devel, (possibly)
libglademm2.4-devel.
Ubuntu, Debian GNU/Linux:
g++, libpcre3-dev, libgtkmm-2.4-dev, (possibly) libglademm-2.4-dev.
Note that usually you need to specify only these packages - the rest is
installed automatically by the package manager's dependency resolver. Keep in
mind that you also need smartmontools to run the program.
Note: If using the official Windows package, the requirements are listed on
GSmartControl's website.
The following operating systems are supported:
* Linux - All the popular configurations should work.
* FreeBSD - Tested with DesktopBSD 1.6 (FreeBSD 6.3) / x86.
* NetBSD - Tested with NetBSD 4.0.1 / x86.
* OpenBSD - Tested with OpenBSD 4.3 / x86-64 / gcc-3.3.5.
* Windows (2000 SP4 or newer) - Tested with Windows 2000 SP4, XP SP2 and Vista
SP1. The Windows port uses pd0, pd1, etc... for physical drives 0, 1, etc... .
* Solaris - Tested with Solaris 10 / x86 / gcc-3.4.3 / blastwave,
Solaris 10 / x86 / sunstudio12 / sunfreeware. OpenSolaris should work but has
not been tested yet. Note that until either smartctl gets ATA support under
Solaris or GSmartControl gets SCSI support, these configurations are
essentially useless.
* Mac OS X - 3rd-party testing by Fink project.
* DragonFlyBSD - Code written but no testing has been performed yet. Expected
to work without any issues.
* QNX - Code written but no testing has been performed yet.
Installation
Short answer: build and install via: ./configure; make; make install
Run gsmartcontrol-root to invoke gsmartcontrol with your desktop's su
mechanism, or use the desktop menu entry.
Long answer: read below.
First, check if you can find a pre-built package for your distribution or
operating system - they usually provide the best integration and the easiest
installation procedure. For Linux, one option is to try the openSUSE Build
Service - it provides ready-to-install packages for various popular Linux
distributions (openSUSE, Fedora, etc...). See
http://download.opensuse.org/repositories/home:/alex_sh/ .
If you want to compile from source, check that you have all the required
dependencies (see Software Requirements section). Then the usual
./configure; make; make install
will build and install it. Installation usually requires administrative
privileges, but you don't need to install the program in order to run it
directly from the build directory.
Command Line Options
GSmartControl inherits options from GTK+ and other libraries, so be sure to
run it with --help option to get a full list of accepted parameters.
Note: The Windows version may not have a text output at all, so --help and
similar arguments won't have any effect. However, --verbose will still
increase the verbosity of a log saved via "Options -> View Execution Log ->
Save All".
The most important parameters are:
-?, --help - Show help options.
-V, --version - Display version information.
-l, --no-locale - Disable locale.
--no-scan - Don't scan devices on startup.
--no-hide-tabs - Don't hide non-identity tabs when SMART is disabled.
--add-virtual - Load smartctl data from file, creating a virtual drive.
--add-device - Add this device to device list. Useful with --no-scan to list
certain drives only.
-v, --verbose - Enable verbose logging; same as --verbosity-level 5.
-q, --quiet - Disable logging; same as --verbosity-level 0.
-b, --verbosity-level - Set verbosity level [0-5].
Permission Problems
Short answer: you need to be root (that's Administrator in Windows).
In X11, use kdesu, gnomesu, sux, xdg-su or similar.
Long answer: read below.
Most operating systems prohibit direct access to hardware to users with
non-administrative privileges. Unfortunately, to access SMART data, smartctl
needs to directly access the hard drive.
The provided X11 desktop and menu icons should show the "Please enter the root
password" dialog boxes, and, after correct information is entered, should run
this program with root privileges. The dialogs should be available in most
commonly used X11 desktop environments.
Another way is to use the included gsmartcontrol-root script, which finds the
available su program and runs gsmartcontrol with it.
Yet another way is to manually invoke the program with kdesu, gnomesu, sux or
similar programs. For example,
kdesu -u root -c gsmartcontrol
will ask for root password and run gsmartcontrol with root privileges. Replace
"kdesu" with "gnomesu" if using Gnome. The "sux" or "xdg-su" commands may also
help, if neither KDE or GNOME are available.
Please don't set the "setuid" flag on smartctl binary. It is considered a
security risk.
Enable SMART Permanently
Specifications say that once you set a SMART-related property, it will be
preserved across reboots. So, when you, say, enable SMART and Automatic
Offline Data Collection, both will stay enabled until you disable them.
However, BIOS, your operating system, your other operating systems (if
present), and various startup programs may affect that. For example, BIOS may
enable SMART each time you start your computer, so if you disabled SMART
previously, it will be re-enabled on reboot.
The easiest way to work around this is to set the desired settings on system
startup. You may use smartctl or smartd to do that. For example, to enable
both SMART and Automatic Offline Data Collection on /dev/sda, one would write
the following to the system startup script (e.g. boot.local, rc.local or
similar on Linux):
smartctl -s on -o on /dev/sda
For more information, see smartctl and smartd documentation.
Known Issues
Only ATA (both PATA and SATA) disks are supported for now. The main reasons
are:
* We can't support drives which don't work with smartmontools. This affects
drives which don't support SMART or don't export SMART data correctly (e.g.
USB enclosures, RAIDs, etc...).
* Smartctl's output for SCSI drives is completely different compared to ATA.
Also, SCSI drives are rarely found in desktop systems and the servers rarely
have X11 / Gtkmm running, so this is a low priority task.
* I only have ATA drives, so testing would be almost impossible.
Immediate Offline Tests are not supported. I haven't found a way to reliably
monitor them yet. Besides, they run automatically anyway if Automatic Offline
Data Collection is enabled.
You may run several tests on different drives in parallel, but you will only
see the progress information of the last executing test. So, if you run tests
on drives A, B and C (in that order), you won't be able to monitor the tests
on A and B until C completes. And you won't be able to see any progress on A
until both B and C complete their tests. This doesn't affect the tests
themselves, just your ability to see their progress.
Testing is only supported on drives which correctly report their progress
information in capabilities.
Not all drives support disabling Automatic Offline Data Collection, even if
they report otherwise.
Running on GTK+ / Gtkmm versions earlier than 2.12 may cause visual artifacts,
usability issues (especially with tooltips and icons), instability, etc...
The texts probably contain a lot of grammatical errors, English being my third
language and all.
Reporting Bugs
If it is a SMART or drive-related problem, please try to test it with smartctl
first. Chances are, the problem you're experiencing is not tied to
GSmartControl, but is a drive firmware or smartctl problem. For example, to
see a complete information about your /dev/sda drive, type the following in a
terminal emulator (e.g., xterm, konsole or gnome-terminal):
smartctl -a /dev/sda
Note: If using Windows, the device name should be /dev/pd1 for the second
physical drive, etc... .
If you still think it's a GSmartControl issue, please collect the following
information about your system. Without it, it may be very hard or impossible
to fix the bug.
* Which operating system you use (for example, openSUSE Linux 11.0).
* Which version of GTK and Gtkmm you have installed. Finding this out is very
distribution-specific. For example, on openSUSE it would be
"rpm -q gtk2 gtkmm2". Some distributions have gtkmm24 instead. You may also
search them in your distribution's graphical package manager, if there is one.
* Execution log from the program, if possible. To obtain it, run the program
with -v option, e.g. (type the following in a terminal emulator or Run
dialog):
gsmartcontrol-root auto -v
Note: On Windows, run gsmartcontrol.exe with "-v" switch as Administrator.
Perform the steps needed to reproduce the bug, then go to
"Options -> View Execution Log", and click "Save All".
* Detailed description of steps you performed when the bug occurred.
Once you have this information, send an email to me, Alexander Shaduri
<ashaduri 'at' gmail.com>. Note that I may refer you to smartmontools support
if it's a bug in smartmontools and not GSmartControl. Normally, I won't
redirect your support request to them myself, because they may ask questions
which only you have the answers to.
Please read the "License and Copyright" and "Patch Licensing" sections before
sending any patches.
License and Copyright
For license information, see LICENSE_gsmartcontrol.txt file.
You may notice that GSmartControl is not licensed under "GNU GPL version X or
later", but under "GNU GPL version X and Y". I firmly believe that it's unwise
to license a piece of code under non-existent licenses, whatever anyone else
might say. The reason for this is that one simply CANNOT know that, say, in 20
years FSF won't be bought by some corporation who will release GPL version Z
which will completely reverse the reasons GPL was created for.
The removal of "or later" clause somewhat imposes responsibility on the
copyright holders to review every future version of the license once it's
released, and, if deemed acceptable, re-license the code under the new license
(possibly retaining the old licenses). Unfortunately, this is a necessary
inconvenience we will have to deal with.
Patch Licensing
Due to reasons described in "License and Copyright" section, to make it
possible to re-license the code without tracking down all the people who ever
wrote a patch, the copyrights of all minor patches must be assigned to the
central copyright holder of the project. If the patch is major enough (that
is, it forms a significant part of the program source code), the author may
retain the copyright, if he or she chooses to do so. However, unless the
author plans to maintain his part of the source code, he / she is humbly asked
to consider assigning away his / her copyright. A simple "I disclaim all
copyright to this patch" by the author is sufficient. All credits will be
mentioned in product documentation, whatever the size of the patch is.
Please note that centralization of copyright is needed to maintain a
reasonably healthy legal status of the project. Also note that this method is
not unique - FSF and many other organizations require exactly the same thing.
Some contributors may have reasonable doubts about the future status of this
project. Let me assure you that this project will never have more restrictive
license than GPLv2. If, some time in the future, the GPL is somehow
invalidated in court, the project will be re-licensed under similar (in
spirit) license, if possible, or a license less restrictive than GPL (for
example, the three-clause BSD license).
-151
View File
@@ -1,151 +0,0 @@
GTKMM Notes:
To transfer an ownership from your local code to a container, use
Gtk::Button* pButton = Gtk::manage(new Gtk::Button("Test"));
container->add(*pButton);
(add() takes an object by reference).
otherwise, you will need to delete() it.
local scope destruction also works if using stack variables.
{
Gtk::Button aButton;
// destroyed here
}
A treeview (also iconview, combobox) from glade comes
with existing model, which should be unset.
--------------------------------------------------------
portability:
win32 32-bit: int: 4, long: 4, pointer: 4.
win32 64-bit: int: 4, long: 8, pointer: 8.
sparc: same as win32 (what about OS?).
--------------------------------------------------------
TODO:
Patch pangomm for Pango::strip_markup().
Patch gtkmm, glibmm, pangomm for static win32 builds.
No Gtk::AboutDialog::set_logo(NULL);
libdebug:
per-channel disabling.
per-channel formatting.
all flags should be per-channel.
bug: if -q is passed, Execution log doesn't contain libdebug log. (requires per-channel status control).
'-l sataphy' -> SATA Phy event counters: Non-SMART feature, useful to detect SATA cabling problems.
'-l xerror' -> Extended Comprehensive Error log: An multi-sector and
LBA48 capable version of '-l error'. Output is similar, except more
entries can exists and the high bytes of the registers are also printed.
Some newer drives (Samsung) only write to this log.
'-l scttemp' -> SCT Temperature history table. See below.
'-l xselftest' -> Extended Self Test Log: An multi-sector and LBA48
capable version of '-l selftest'. Output will be similar, except more
entries can exists and the LBA values can be somewhat longer.
----------- Feature List ----------
+Autodetect available devices
+Select current device (from autodetected list; manually whitelist devices).
+Smartctl binary (text entries in Options - binary, default command line options).
+ Global command-line options for smartctl.
+ Command-line options per-device in settings (e.g. -d ata).
+ Search smartctl binary on startup (try to execute it with --version). If it's not there, alert the user.
+Indicate which of the devices has SMART supported / enabled.
+ Enable / disable smart on devices.
+ Indicate that this is until shutdown (but may be preserved on reboot).
+ Direct them to smartd / smartctl documentation for permanent enabling.
+ NOTE: SMART is sometimes preserved across power cycles.
+Enable / disable Automatic Offline Data Collection for devices. (-o on)
+ Show its status in the main window.
+Show identity information for device (aka short info), --info.
+Show all SMART information for device (--all), includes:
+ * Short info (--info)
+ * SMART DATA
+ * overall-health (-H, --health) - may check this automatically as well.
+ * General SMART Values, aka Capabilities (-c, --capabilities)
+ * Attributes (-A, --attributes). These need decoding.
+ * Error Log (-l error)
+ * Self-test log (-l selftest)
+ * Selective self-test log and settings
* SCT status and other stuff
Display temperature somewhere (use SCT or Attr 194 for this).
+ * Ability to save this information to a file.
+ * On info window show: Ask to turn SMART on if it's disabled
+Program error reporting:
+ invalid smartmontools version.
+ cannot parse output - show log.
+ smartctl exited with error - look it up in error map.
SCT Temperatures
-l scttemp prints temperature and history.
-t scttempint,N[,p] (N - count, p - preserve across reset or not).
This configures temperature logging interval (1 min by default) and clears the history.
+Tests:
Ability to detect a testing drive on boot, show its info with testing tab.
Run one-time Immediate Offline test (-t offline).
Offline tests only update Attributes, and if errors are found they will
appear in SMART error log. Self-test logs are unaffected.
Abort (-X). Abort works with Offline only if there's
"Abort Offline collection upon new command" capability.
If the drive has "Suspend Offline collection upon new command" capability,
immediate offline test may be tracked through --capabilities (not on mine!).
If it's "Abort Offline collection upon new command", then the test
will abort on --capabilities or --abort.
Polling time
The self-test routine recommended polling time shall be equal to the number of minutes that is the minimum
recommended time before which the host should first poll for test completion status. Actual test time could
be several times this value. Polling before this time could extend the self-test execution time or abort the test
depending on the state of bit 2 of the off-line data capability bits.
Autosave
This command enables and disables the optional attribute autosave feature of the device. This command
may either allow the device, after some vendor specified event, to save the device updated attribute values
to non-volatile memory; or this command may cause the autosave feature to be disabled. The state of the
attribute autosave feature (either enabled or disabled) shall be preserved by the device across power cycles.
A value of zero written by the host into the device’s Sector Count register before issuing this command shall
cause this feature to be disabled. Disabling this feature does not preclude the device from saving SMART
data to non-volatile memory during some other normal operation such as during a power-on or power-off
sequence or during an error recovery sequence.
A value of F1h written by the host into the device’s Sector Count register before issuing this command shall
cause this feature to be enabled. Any other meaning of this value or any other non-zero value written by the
host into this register before issuing this command may differ from device to device. The meaning of any
non-zero value written to this register at this time shall be preserved by the device across power cycles.
-37
View File
@@ -1,37 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ac_cxx_exceptions.html
# ===========================================================================
#
# SYNOPSIS
#
# AC_CXX_EXCEPTIONS
#
# DESCRIPTION
#
# If the C++ compiler supports exceptions handling (try, throw and catch),
# define HAVE_EXCEPTIONS.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Todd Veldhuizen
# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AC_CXX_EXCEPTIONS],
[AC_CACHE_CHECK(whether the compiler supports exceptions,
ac_cv_cxx_exceptions,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[try { throw 1; } catch (int i) { return i; }]])],[ac_cv_cxx_exceptions=yes],[ac_cv_cxx_exceptions=no])
AC_LANG_POP([])
])
if test "$ac_cv_cxx_exceptions" = yes; then
AC_DEFINE(HAVE_EXCEPTIONS,,[define if the compiler supports exceptions])
fi
])
-37
View File
@@ -1,37 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ac_cxx_namespaces.html
# ===========================================================================
#
# SYNOPSIS
#
# AC_CXX_NAMESPACES
#
# DESCRIPTION
#
# If the compiler can prevent names clashes using namespaces, define
# HAVE_NAMESPACES.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Todd Veldhuizen
# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[namespace Outer { namespace Inner { int i = 0; }}]], [[using namespace Outer::Inner; return i;]])],[ac_cv_cxx_namespaces=yes],[ac_cv_cxx_namespaces=no])
AC_LANG_POP([])
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])
-50
View File
@@ -1,50 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ac_cxx_rtti.html
# ===========================================================================
#
# SYNOPSIS
#
# AC_CXX_RTTI
#
# DESCRIPTION
#
# If the compiler supports Run-Time Type Identification (typeinfo header
# and typeid keyword), define HAVE_RTTI.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Todd Veldhuizen
# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AC_CXX_RTTI],
[AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification,
ac_cv_cxx_rtti,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <typeinfo>
class Base { public :
Base () {}
virtual int f () { return 0; }
};
class Derived : public Base { public :
Derived () {}
virtual int f () { return 1; }
};
]], [[Derived d;
Base *ptr = &d;
return typeid (*ptr) == typeid (Derived);
]])],[ac_cv_cxx_rtti=yes],[ac_cv_cxx_rtti=no])
AC_LANG_POP([])
])
if test "$ac_cv_cxx_rtti" = yes; then
AC_DEFINE(HAVE_RTTI,,
[define if the compiler supports Run-Time Type Identification])
fi
])
@@ -1,40 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ac_cxx_verbose_terminate_handler.html
# ===========================================================================
#
# SYNOPSIS
#
# AC_CXX_VERBOSE_TERMINATE_HANDLER
#
# DESCRIPTION
#
# If the compiler does have the verbose terminate handler, define
# HAVE_VERBOSE_TERMINATE_HANDLER.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Lapo Luchini <lapo@lapo.it>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AC_CXX_VERBOSE_TERMINATE_HANDLER],
[AC_CACHE_CHECK(whether the compiler has __gnu_cxx::__verbose_terminate_handler,
ac_cv_verbose_terminate_handler,
[
AC_REQUIRE([AC_CXX_EXCEPTIONS])
AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <exception>]], [[std::set_terminate(__gnu_cxx::__verbose_terminate_handler);]])],[ac_cv_verbose_terminate_handler=yes],[ac_cv_verbose_terminate_handler=no
])
AC_LANG_POP([])
])
if test "$ac_cv_verbose_terminate_handler" = yes; then
AC_DEFINE(HAVE_VERBOSE_TERMINATE_HANDLER, , [define if the compiler has __gnu_cxx::__verbose_terminate_handler])
fi
])
-34
View File
@@ -1,34 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_AUTO_CLEAR_FLAGS()
# Clear user-specified CFLAGS / CXXFLAGS / LIBS / LDFLAGS if requested.
# You should call this macro before any of AC_PROG_C(XX) checks to
# avoid checking with user-specified options.
AC_DEFUN([APP_AUTO_CLEAR_FLAGS], [
AC_ARG_ENABLE(user-flags, AS_HELP_STRING([--disable-user-flags],
[ignore user-supplied compiler flags (default: user flags are enabled)]),
[app_cv_compiler_user_flags=${enableval}], [app_cv_compiler_user_flags=yes])
AC_MSG_NOTICE([Enable user-specified compiler flags: $app_cv_compiler_user_flags])
# Reset user-supplied flags if requested.
if test "x$app_cv_compiler_user_flags" = "xno"; then
CFLAGS="";
CXXFLAGS="";
LIBS="";
LDFLAGS="";
fi
])
-153
View File
@@ -1,153 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_CHOOSE_GLD_READER([C|C++][, flags_prefix])
# This macro detects whether GtkBuilder (from gtk >= 2.12) or libglade
# are present. If the first parameter is C++, then gtkmm and libglademm
# are searched for instead.
# flags_prefixCFLAGS, flags_prefixCXXFLAGS and flags_prefixLIBS
# will be initialized (or appended to) with the correct flags in case of libglade(mm).
# app_cv_gld_reader will be set to none, libglade or gtkbuilder.
# ENABLE_LIBGLADE or ENABLE_GTKBUILDER will be exported to config.h
# You must call AX_COMPILER_VENDOR before using this macro.
AC_DEFUN([APP_CHOOSE_GLD_READER], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_ARG_ENABLE(abort-if-no-glade-reader, AS_HELP_STRING([--disable-abort-if-no-glade-reader],
[disable abort if no glade file reader is found (default: configure aborts when glade file reader is not found)]),
[app_cv_abort_if_no_glade_reader=${enableval}], [app_cv_abort_if_no_glade_reader=yes])
AC_MSG_NOTICE([Abort if no glade file reader is found: $app_cv_abort_if_no_glade_reader])
# This is just in case
# PKG_PROG_PKG_CONFIG()
# this variable will have values "none", "libglade" or "gtkbuilder".
app_cv_gld_reader="none";
# in case libglade(mm) is found, these will contain the flags.
app_cv_gld_reader_CFLAGS="";
app_cv_gld_reader_CXXFLAGS="";
app_cv_gld_reader_LIBS="";
app_cv_gld_reader_libglade_name="libglade";
app_cv_gld_reader_libglade_pkg_name="libglade-2.0";
app_cv_gld_reader_gtk_name="gtk";
app_cv_gld_reader_gtk_pkg_name="gtk+-2.0";
if test "x$1" = "xC++"; then
app_cv_gld_reader_libglade_name="libglademm";
app_cv_gld_reader_libglade_pkg_name="libglademm-2.4";
app_cv_gld_reader_gtk_name="gtkmm";
app_cv_gld_reader_gtk_pkg_name="gtkmm-2.4";
fi
# Manual control. AC_ARG_ENABLE doesn't get bash variables, so we have
# to do it this way. If put inside a shell conditional, it still shows up in configure help.
AC_ARG_ENABLE(libglade, AS_HELP_STRING([--enable-libglade],
[use libglade(mm) instead of GtkBuilder (default: auto)]),
[with_libglade=${enableval}], [with_libglade=auto])
# Try gtkbuilder first
if test "x$with_libglade" = "xno" || test "x$with_libglade" = "xauto"; then
PKG_CHECK_EXISTS([$app_cv_gld_reader_gtk_pkg_name >= 2.12.0],
[app_cv_gld_reader="gtkbuilder"])
fi
if test "$with_libglade" = "no" && test "$app_cv_gld_reader" = "none"; then
AC_MSG_ERROR([GtkBuilder support not found (you need $app_cv_gld_reader_gtk_name version 2.12 or higher). Try using $app_cv_gld_reader_libglade_name instead.])
fi
# libglade specified, or auto and no gtkbuilder. gtkmm2.4-compatible libglademm is >= 2.4.0.
# (not sure about libglade version).
if test "x$app_cv_gld_reader" = "xnone"; then
if test "x$app_cv_gld_reader_libglade_name" = "xlibglade"; then
# libglade
PKG_CHECK_MODULES([LIBGLADE], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
[app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])])
app_cv_gld_reader_CFLAGS="$LIBGLADE_CFLAGS";
app_cv_gld_reader_CXXFLAGS="$LIBGLADE_CFLAGS";
app_cv_gld_reader_LIBS="$LIBGLADE_LIBS";
else
# libglademm
PKG_CHECK_MODULES([LIBGLADEMM], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
[app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADEMM_PKG_ERRORS])])
app_cv_gld_reader_CFLAGS=""
app_cv_gld_reader_CXXFLAGS="$LIBGLADEMM_CFLAGS";
app_cv_gld_reader_LIBS="$LIBGLADEMM_LIBS";
fi
# reset them so they don't interfere later
LIBGLADE_CFLAGS="";
LIBGLADE_LIBS="";
fi
if test "x$with_libglade" = "xyes" && test "x$app_cv_gld_reader" = "xnone"; then
AC_MSG_ERROR([$app_cv_gld_reader_libglade_name not found. Try building with GtkBuilder support (you need $app_cv_gld_reader_gtk_name version 2.12 or higher).])
fi
# still not found.
if test "$app_cv_gld_reader" = "none"; then
if test "x$app_cv_abort_if_no_glade_reader" = "xno"; then
AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])
AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found. The program will be unable to compile fully.])
else
AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found.])
AC_MSG_ERROR([$LIBGLADE_PKG_ERRORS])
fi
fi
# export the flags
if test "x$2" != "x"; then
if test "x$$2[]CFLAGS" = "x"; then
$2[]CFLAGS="$app_cv_gld_reader_CFLAGS";
else
$2[]CFLAGS="$$2[]CFLAGS $app_cv_gld_reader_CFLAGS";
fi
if test "x$$2[]CXXFLAGS" = "x"; then
$2[]CXXFLAGS="$app_cv_gld_reader_CXXFLAGS";
else
$2[]CXXFLAGS="$$2[]CXXFLAGS $app_cv_gld_reader_CXXFLAGS";
fi
if test "x$$2[]LIBS" = "x"; then
$2[]LIBS="$app_cv_gld_reader_LIBS";
else
$2[]LIBS="$$2[]LIBS $app_cv_gld_reader_LIBS";
fi
fi
# export to automake.am-s
AM_CONDITIONAL([ENABLE_LIBGLADE], [test "$app_cv_gld_reader" = "libglade"])
AM_CONDITIONAL([ENABLE_GTKBUILDER], [test "$app_cv_gld_reader" = "gtkbuilder"])
# export to config.h
if test "$app_cv_gld_reader" = "libglade"; then
AC_DEFINE(ENABLE_LIBGLADE, 1, [Use libglade(mm) instead of GtkBuilder])
fi
if test "$app_cv_gld_reader" = "gtkbuilder"; then
AC_DEFINE(ENABLE_GTKBUILDER, 1, [Use GtkBuilder instead of libglademm])
fi
# If we move this to the start, some messages get in between, so we have to have it here.
AC_MSG_CHECKING([for glade file support:])
AC_MSG_RESULT([$app_cv_gld_reader])
])
-279
View File
@@ -1,279 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_COMPILER_OPTIONS([flags_prefix])
# This macro enables various compiler flags (common warnings, optimization,
# debug, etc...), controllable through configure options.
# flags_prefixCFLAGS, flags_prefixCXXFLAGS and flags_prefixLDFLAGS
# will be initialized (or appended to) with the results.
# DEBUG and DEBUG_BUILD will be exported to config.h in case of debug builds.
# You must call AX_COMPILER_VENDOR, APP_DETECT_OS_KERNEL([target], ...)
# and APP_DETECT_OS_ENV([target], ...) before using this macro.
AC_DEFUN([APP_COMPILER_OPTIONS], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_REQUIRE([APP_DETECT_OS_ENV])
app_cv_compiler_options_cflags="";
app_cv_compiler_options_cxxflags="";
app_cv_compiler_options_ldflags="";
# ---- Common compiler options (warnings, etc...)
AC_ARG_ENABLE(common-options, AS_HELP_STRING([--enable-common-options=<compiler>|auto|none],
[enable useful compilation options (warnings, mostly). Accepted values are auto, none, gnu, intel, sun. (Default: auto)]),
[app_cv_compiler_common_options=${enableval}], [app_cv_compiler_common_options=auto])
# the default value is "yes" (if no value given after =), treat it as auto.
if test "x$app_cv_compiler_common_options" = "xyes" || test "x$app_cv_compiler_common_options" = "xauto"; then
app_cv_compiler_common_options="$ax_cv_cxx_compiler_vendor";
fi
if test "x$app_cv_compiler_common_options" = "xno"; then
# for pretty message
app_cv_compiler_common_options="none";
fi
AC_MSG_NOTICE([Enable common compiler flags for: $app_cv_compiler_common_options])
if test "x$app_cv_compiler_common_options" != "xnone"; then
# gcc / gnu environment, mingw, cygwin.
if test "x$app_cv_compiler_common_options" = "xgnu"; then
if test "x$app_cv_target_os_env" = "xmingw" || test "x$app_cv_target_os_env" = "xcygwin"; then
# mingw gcc options:
# -mno-cygwin - generate non-cygwin executables in cygwin's mingw.
# -mms-bitfields - make structures compatible with msvc. recommended default for non-cygwin.
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mms-bitfields"
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mms-bitfields"
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mms-bitfields"
fi
# Note: Disabled -Wconversion, it was causing lots of silly warnings under x86-64.
app_cv_compiler_tmp_var="-Wall -Wcast-align -Wcast-qual \
-Wctor-dtor-privacy -Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual \
-Wpointer-arith -Wshadow -Wsign-compare -Wsign-promo -Wundef -Wwrite-strings";
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags $app_cv_compiler_tmp_var";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags $app_cv_compiler_tmp_var";
# intel / gnu environment
elif test "x$app_cv_compiler_common_options" = "xintel" && test "x$app_cv_target_os_env" = "xgnu"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -w1";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags \
-ftrapuv -fstack-security-check -early-template-check -static-libgcc -static-intel \
-Wcomment -Wdeprecated -Wextra-tokens -Wformat -Wmissing-prototypes -Wnon-virtual-dtor \
-Wpointer-arith -Wreturn-type -Wshadow -Wtrigraphs -Wuninitialized -w1";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -static-libgcc -static-intel";
# suncc
elif test "x$app_cv_compiler_common_options" = "xsun"; then
# Enable useful language extensions (e.g. __func__ in C++). Details at
# http://docs.sun.com/app/docs/doc/819-5267/6n7c46drp?a=view
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags \
+w -errtags -erroff=notemsource,notused -features=extensions";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags \
+w -errtags -erroff=notemsource,notused -features=extensions";
fi
fi
# ---- Compiler options for debug builds
AC_ARG_ENABLE(debug-options, AS_HELP_STRING([--enable-debug-options=<compiler>|auto|none],
[enable debug build options. Accepted values are auto, none, gnu, intel, sun. (Default: none)]),
[app_cv_compiler_debug_options=${enableval}], [app_cv_compiler_debug_options=none])
# the default value is "yes" (if no value given after =), treat it as auto.
if test "x$app_cv_compiler_debug_options" = "xyes" || test "x$app_cv_compiler_debug_options" = "xauto"; then
app_cv_compiler_debug_options="$ax_cv_cxx_compiler_vendor";
fi
if test "x$app_cv_compiler_debug_options" = "xno"; then
# for pretty message
app_cv_compiler_debug_options="none";
fi
AC_MSG_NOTICE([Enable debug build flags for: $app_cv_compiler_debug_options])
if test "x$app_cv_compiler_debug_options" != "xnone"; then
# Define DEBUG and DEBUG_BUILD for debug builds (through config.h).
AC_DEFINE([DEBUG], [1], [Defined for debug builds])
AC_DEFINE([DEBUG_BUILD], [1], [Defined for debug builds])
# gcc, mingw
if test "x$app_cv_compiler_debug_options" = "xgnu"; then
# We could put libstdc++ debug options here, but it generates binary-incompatible
# C++ code, which leads to runtime errors with e.g. libsigc++.
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g3 -O0";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g3 -O0";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g3 -O0";
# intel / gnu
elif test "x$app_cv_compiler_debug_options" = "xintel" && test "x$app_cv_target_os_env" = "xgnu"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g3 -O0";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g3 -O0";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g3 -O0";
# suncc
elif test "x$app_cv_compiler_debug_options" = "xsun"; then
# There's no -O0, it's the default. Debug format is stabs by default, but can be switched
# to dwarf by -xdebugformat=dwarf.
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -xs -g";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -xs -g";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -xs -g";
fi
fi
# ---- Compiler options for optimized builds
AC_ARG_ENABLE(optimize-options, AS_HELP_STRING([--enable-optimize-options=<compiler>|auto|none],
[enable optimized build options. Accepted values are auto, none, gnu, intel, sun. (Default: none)]),
[app_cv_compiler_optimize_options=${enableval}], [app_cv_compiler_optimize_options=none])
# the default value is "yes" (if no value given after =), treat it as auto.
if test "x$app_cv_compiler_optimize_options" = "xyes" || test "x$app_cv_compiler_optimize_options" = "xauto"; then
app_cv_compiler_optimize_options="$ax_cv_cxx_compiler_vendor";
fi
if test "x$app_cv_compiler_optimize_options" = "xno"; then
# for pretty message
app_cv_compiler_optimize_options="none";
fi
AC_MSG_NOTICE([Enable optimized build flags for: $app_cv_compiler_optimize_options])
if test "x$app_cv_compiler_optimize_options" != "xnone"; then
# gcc, mingw
if test "x$app_cv_compiler_optimize_options" = "xgnu"; then
# -mtune=generic is since gcc 4.0 iirc
if test "x$app_cv_target_os_env" = "xmingw" || test "x$app_cv_target_os_env" = "xcygwin"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s -march=i586";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s -march=i586";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s -march=i586";
else
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s -mtune=generic";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s -mtune=generic";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s -mtune=generic";
fi
# intel / gnu
elif test "x$app_cv_compiler_optimize_options" = "xintel" && test "x$app_cv_target_os_env" = "xgnu"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s";
# suncc
elif test "x$app_cv_compiler_optimize_options" = "xsun"; then
# There's no -O0, it's the default. Debug format is stabs by default, but can be switched
# to dwarf by -xdebugformat=dwarf.
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -xO5";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -xO5";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -s";
fi
fi
# ---- Compiler options for GCC pch support
AC_ARG_ENABLE(gcc-pch,
AS_HELP_STRING([--enable-gcc-pch],[enable precompiled header support (pch make target) (GCC only) (default: disabled)
(use "make gch" to speed up the compilation, but don't enable it if you don't intend to use it - it will slow things down)]),
[app_cv_compiler_gcc_pch=${enableval}], [app_cv_compiler_gcc_pch=no])
AC_MSG_NOTICE([Enable GCC precompiled header usage: $app_cv_compiler_gcc_pch])
# Don't check the vendor here - it's disabled by default, so it's on the user.
if test "x$app_cv_compiler_gcc_pch" = "xyes"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -Winvalid-pch -DENABLE_PCH"
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -Winvalid-pch -DENABLE_PCH"
fi
# ---- Compiler options for Mingw's mwindows/mconsole
# -mwindows - hide console window. possibly suppresses any std output / error.
# -mconsole - opposite of -mwindows, default.
AC_ARG_ENABLE(windows-console, AS_HELP_STRING([--enable-windows-console=yes|no|auto],
[enable windows console (MinGW only). Accepted values are yes, no, auto. ]
[Auto means disabled for optimized builds, enabled for all others. (Default: auto)]),
[app_cv_compiler_windows_console=${enableval}], [app_cv_compiler_windows_console=auto])
if test "x$app_cv_compiler_windows_console" = "xauto"; then
# disable console for optimized builds.
if test "x$app_cv_compiler_optimize_options" != "xnone"; then
app_cv_compiler_windows_console="no";
else
app_cv_compiler_windows_console="yes";
fi
fi
if test "x$app_cv_target_os_env" = "xmingw" || test "x$app_cv_target_os_env" = "xcygwin"; then
if test "x$app_cv_compiler_windows_console" = "xno"; then
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mwindows";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mwindows";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mwindows";
else
# specify -mconsole even if it's the default - it should override the user-supplied setting
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mconsole";
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mconsole";
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mconsole";
fi
AC_MSG_NOTICE([Enable windows console: $app_cv_compiler_windows_console])
fi
# ---- Export our variables
if test "x$$1[]CFLAGS" = "x"; then
$1[]CFLAGS="$app_cv_compiler_options_cflags";
else
$1[]CFLAGS="$$1[]CFLAGS $app_cv_compiler_options_cflags";
fi
if test "x$$1[]CXXFLAGS" = "x"; then
$1[]CXXFLAGS="$app_cv_compiler_options_cxxflags";
else
$1[]CXXFLAGS="$$1[]CXXFLAGS $app_cv_compiler_options_cxxflags";
fi
if test "x$$1[]LDFLAGS" = "x"; then
$1[]LDFLAGS="$app_cv_compiler_options_ldflags";
else
$1[]LDFLAGS="$$1[]LDFLAGS $app_cv_compiler_options_ldflags";
fi
AC_MSG_NOTICE([Compiler-specific build options:])
AC_MSG_NOTICE([CFLAGS: $app_cv_compiler_options_cflags])
AC_MSG_NOTICE([CXXFLAGS: $app_cv_compiler_options_cxxflags])
AC_MSG_NOTICE([LDFLAGS: $app_cv_compiler_options_ldflags])
])
-46
View File
@@ -1,46 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# Check whether C++ compiler supports overloading between
# extern "C" function pointer and C++ function pointer. GCC and
# Intel treat them equally, so no overloads are needed (or accepted)
# there.
# SunCC accepts C++-to-C function pointer assignment in function
# parameters, but not in constructor parameters. To make such
# code work an additional C-function-pointer constructor must be
# specified. Then the constructor itself can make the conversion
# (with a compiler warning though).
# SunCC also disallows C-to-C++ function pointer specification
# for template parameters (I don't remember the exact details).
# If such support is found, HAVE_CXX_EXTERN_C_OVERLOAD is defined.
AC_DEFUN([APP_CXX_EXTERN_C_OVERLOAD], [
AC_CACHE_CHECK(whether $CXX accepts extern C function pointer overload, ac_cv_cxx_extern_c_overload, [
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
extern "C" { typedef void (*c_func_t)(void); }
typedef void (*cpp_func_t)(void);
void f1(c_func_t f) { }
void f1(cpp_func_t f) { }
]], [[]])],
[ac_cv_cxx_extern_c_overload=yes], [ac_cv_cxx_extern_c_overload=no])
AC_LANG_POP([])
])
if test "x$ac_cv_cxx_extern_c_overload" = "xyes"; then
AC_DEFINE(HAVE_CXX_EXTERN_C_OVERLOAD, ,
[Define if the C++ complier accepts extern C function pointer overload])
fi
])
-44
View File
@@ -1,44 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# Check whether C++ compiler supports C99 __func__.
AC_DEFUN([APP_CXX___FUNC__], [
AC_CACHE_CHECK(whether $CXX recognizes __func__, app_cv_cxx___func__, [
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[const char* s = __func__;]])],
[app_cv_cxx___func__=yes], [app_cv_cxx___func__=no])
AC_LANG_POP([])
])
if test "x$app_cv_cxx___func__" = "xyes"; then
AC_DEFINE(HAVE_CXX___func__, ,
[Define if the C++ complier supports __func__])
fi
])
# Check whether C++ compiler supports __FUNCTION__.
AC_DEFUN([APP_CXX___FUNCTION__], [
AC_CACHE_CHECK(whether $CXX recognizes __FUNCTION__, app_cv_cxx___FUNCTION__, [
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[const char* s = __FUNCTION__;]])],
[app_cv_cxx___FUNCTION__=yes], [app_cv_cxx___FUNCTION__=no])
AC_LANG_POP([])
])
if test "x$app_cv_cxx___FUNCTION__" = "xyes"; then
AC_DEFINE(HAVE_CXX___FUNCTION__, ,
[Define if the C++ complier supports __FUNCTION__])
fi
])
-323
View File
@@ -1,323 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_DETECT_OS_KERNEL(triplet_name, define_macro_prefix)
# Check target OS kernel.
# triplet_name is target, host or build.
# You must call AX_COMPILER_VENDOR before using this macro.
# If you call
# APP_DETECT_OS_KERNEL([target], [CONFIG_KERNEL])
# you will get CONFIG_KERNEL_LINUX C macro exported to config.h
# (on gcc/linux).
# If no define_macro_prefix is specified, no C macro prefix will be used.
# app_cv_target_os_kernel will be set to kernel name (lowercase).
# app_cv_target_os_kernel_macro will be set to kernel name (all caps).
# TARGET_OS_KERNEL_LINUX automake conditional will be set to true.
# Note: Some operating systems / compilers have built-in defines.
# For gcc, check with
# $ gcc -dM -E - < /dev/null
AC_DEFUN([APP_DETECT_OS_KERNEL], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_MSG_CHECKING([for $1 OS kernel])
app_cv_[]$1[]_os_kernel="";
app_cv_[]$1[]_os_kernel_macro="";
# If vendor is not recognized, it's set to "unknown".
# NOTE: This works only on target compilers!
if test "x${ax_cv_cxx_compiler_vendor}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[ax_cv_cxx_compiler_vendor] not set.])
fi
# "build" - the type of system on which the package is being configured and compiled.
# "host" - the type of system on which the package runs. Specifying it enables the
# cross-compilation mode. "target" defaults to this too.
if test "x$1" != "xbuild" && test "x$1" != "xhost" && test "x$1" != "xtarget"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[Triplet name must be build, host or target.]])
fi
case "$$1" in
*linux*)
# gcc defines __linux__ on linux. Other defines include: __linux, __unix__, __gnu_linux__,
# linux, unix, __i386__, i386.
app_cv_[]$1[]_os_kernel="linux";
app_cv_[]$1[]_os_kernel_macro="LINUX";
;;
*mingw* | *cygwin*)
# mingw defines _WIN32. msvc defines _WIN32 (built-in), and WIN32 via windows.h.
# Other mingw defines include: __WINNT, __WINNT__, __WIN32__, __i386, _X86_,
# i386, __i386__, WIN32, __MINGW32__, WINNT (all equal to 1).
app_cv_[]$1[]_os_kernel="windows";
app_cv_[]$1[]_os_kernel_macro="WINDOWS";
;;
# This includes debian gnu/kfreebsd. Dragonfly is checked separately.
*freebsd*)
# gcc built-in defines (to check for freebsd kernel):
# defined(__FreeBSD__) || defined(__FreeBSD_kernel__).
# See http://glibc-bsd.alioth.debian.org/porting/PORTING .
app_cv_[]$1[]_os_kernel="freebsd";
app_cv_[]$1[]_os_kernel_macro="FREEBSD";
;;
*dragonfly*)
app_cv_[]$1[]_os_kernel="dragonfly";
app_cv_[]$1[]_os_kernel_macro="DRAGONFLY";
;;
*openbsd*)
app_cv_[]$1[]_os_kernel="openbsd";
app_cv_[]$1[]_os_kernel_macro="OPENBSD";
;;
# This includes debian gnu/netbsd.
*netbsd*)
app_cv_[]$1[]_os_kernel="netbsd";
app_cv_[]$1[]_os_kernel_macro="NETBSD";
;;
*solaris*)
app_cv_[]$1[]_os_kernel="solaris";
app_cv_[]$1[]_os_kernel_macro="SOLARIS";
;;
*darwin*)
app_cv_[]$1[]_os_kernel="darwin";
app_cv_[]$1[]_os_kernel_macro="DARWIN";
;;
*qnx*)
app_cv_[]$1[]_os_kernel="qnx";
app_cv_[]$1[]_os_kernel_macro="QNX";
;;
*)
app_cv_[]$1[]_os_kernel="unknown";
app_cv_[]$1[]_os_kernel_macro="UNKNOWN";
;;
esac
# Assign this - we may use this in configure itself.
if test "x$2" != "x"; then
app_cv_[]$1[]_os_kernel_macro="$2[]_${app_cv_[]$1[]_os_kernel_macro}";
fi
# config.h macros (yes, we need this many. otherwise config.h will be incorrect).
if test "x${app_cv_[]$1[]_os_kernel}" = "xlinux"; then
AC_DEFINE($2[]LINUX, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xwindows"; then
AC_DEFINE($2[]WINDOWS, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xfreebsd"; then
AC_DEFINE($2[]FREEBSD, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xdragonfly"; then
AC_DEFINE($2[]DRAGONFLY, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xopenbsd"; then
AC_DEFINE($2[]OPENBSD, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xnetbsd"; then
AC_DEFINE($2[]NETBSD, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xsolaris"; then
AC_DEFINE($2[]SOLARIS, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xdarwin"; then
AC_DEFINE($2[]DARWIN, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xqnx"; then
AC_DEFINE($2[]QNX, 1, [$1 OS kernel])
fi
if test "x${app_cv_[]$1[]_os_kernel}" = "xunknown"; then
AC_DEFINE($2[]UNKNOWN, 1, [$1 OS kernel])
fi
# Export to Makefile.am's.
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_LINUX, [test "x${app_cv_[]$1[]_os_kernel}" = "xlinux"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_WINDOWS, [test "x${app_cv_[]$1[]_os_kernel}" = "xwindows"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_FREEBSD, [test "x${app_cv_[]$1[]_os_kernel}" = "xfreebsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_DRAGONFLY, [test "x${app_cv_[]$1[]_os_kernel}" = "xdragonfly"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_OPENBSD, [test "x${app_cv_[]$1[]_os_kernel}" = "xopenbsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_NETBSD, [test "x${app_cv_[]$1[]_os_kernel}" = "xnetbsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_SOLARIS, [test "x${app_cv_[]$1[]_os_kernel}" = "xsolaris"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_DARWIN, [test "x${app_cv_[]$1[]_os_kernel}" = "xdarwin"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_QNX, [test "x${app_cv_[]$1[]_os_kernel}" = "xqnx"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_KERNEL_UNKNOWN, [test "x${app_cv_[]$1[]_os_kernel}" = "xunknown"])
AC_MSG_RESULT([${app_cv_[]$1[]_os_kernel}])
])
# APP_DETECT_OS_ENV(triplet_name, define_macro_prefix)
# Check target OS userland environment (mainly glibc).
# triplet_name is target, host or build.
# You must call AX_COMPILER_VENDOR before using this macro.
# If you call
# APP_DETECT_OS_ENV([target], [COMPILER], [CONFIG_OS_ENV])
# you will get CONFIG_OS_ENV_LINUX C macro exported to config.h
# (on gcc/linux).
# If no define_macro_prefix is specified, no C macro prefix will be used.
# app_cv_target_os_env will be set to env name (lowercase).
# app_cv_target_os_env_macro will be set to env name (all caps).
# TARGET_OS_ENV_LINUX automake conditional will be set to true.
AC_DEFUN([APP_DETECT_OS_ENV], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_MSG_CHECKING([for $1 OS userland environment])
app_cv_[]$1[]_os_env="";
app_cv_[]$1[]_os_env_macro="";
# If vendor is not recognized, it's set to "unknown".
# NOTE: This works only on target compilers!
if test "x${ax_cv_cxx_compiler_vendor}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[ax_cv_cxx_compiler_vendor] not set.])
fi
# "build" - the type of system on which the package is being configured and compiled.
# "host" - the type of system on which the package runs. Specifying it enables the
# cross-compilation mode. "target" defaults to this too.
if test "x$1" != "xbuild" && test "x$1" != "xhost" && test "x$1" != "xtarget"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[Triplet name must be build, host or target.]])
fi
case "$$1" in
*cygwin*)
app_cv_[]$1[]_os_env="cygwin";
app_cv_[]$1[]_os_env_macro="CYGWIN";
;;
*mingw*)
app_cv_[]$1[]_os_env="mingw";
app_cv_[]$1[]_os_env_macro="MINGW";
;;
# This includes gnu/linux, debian gnu/kfreebsd, debian gnu/netbsd...
*-gnu | gnu*)
app_cv_[]$1[]_os_env="gnu";
app_cv_[]$1[]_os_env_macro="GNU";
;;
# Freebsd libc
*freebsd*)
app_cv_[]$1[]_os_env="freebsd";
app_cv_[]$1[]_os_env_macro="FREEBSD";
;;
*dragonfly*)
app_cv_[]$1[]_os_env="dragonfly";
app_cv_[]$1[]_os_env_macro="DRAGONFLY";
;;
*openbsd*)
app_cv_[]$1[]_os_env="openbsd";
app_cv_[]$1[]_os_env_macro="OPENBSD";
;;
*netbsd*)
app_cv_[]$1[]_os_env="netbsd";
app_cv_[]$1[]_os_env_macro="NETBSD";
;;
*solaris*)
app_cv_[]$1[]_os_env="solaris";
app_cv_[]$1[]_os_env_macro="SOLARIS";
;;
*darwin*)
app_cv_[]$1[]_os_env="darwin";
app_cv_[]$1[]_os_env_macro="DARWIN";
;;
*qnx*)
app_cv_[]$1[]_os_env="qnx";
app_cv_[]$1[]_os_env_macro="QNX";
;;
*)
app_cv_[]$1[]_os_env="unknown";
app_cv_[]$1[]_os_env_macro="UNKNOWN";
;;
esac
# Assign this even if not using flags - we may use this in configure itself.
if test "x$2" != "x"; then
app_cv_[]$1[]_os_env_macro="$2[]_${app_cv_[]$1[]_os_env_macro}";
fi
# config.h macros (yes, we need this many. otherwise config.h will be incorrect).
if test "x${app_cv_[]$1[]_os_env}" = "xcygwin"; then
AC_DEFINE($2[]CYGWIN, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xmingw"; then
AC_DEFINE($2[]MINGW, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xgnu"; then
AC_DEFINE($2[]GNU, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xfreebsd"; then
AC_DEFINE($2[]FREEBSD, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xdragonfly"; then
AC_DEFINE($2[]DRAGONFLY, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xopenbsd"; then
AC_DEFINE($2[]OPENBSD, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xnetbsd"; then
AC_DEFINE($2[]NETBSD, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xsolaris"; then
AC_DEFINE($2[]SOLARIS, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xdarwin"; then
AC_DEFINE($2[]DARWIN, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xqnx"; then
AC_DEFINE($2[]QNX, 1, [$1 OS userspace environment])
fi
if test "x${app_cv_[]$1[]_os_env}" = "xunknown"; then
AC_DEFINE($2[]UNKNOWN, 1, [$1 OS userspace environment])
fi
# Export to Makefile.am's.
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_CYGWIN, [test "x${app_cv_[]$1[]_os_env}" = "xcygwin"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_MINGW, [test "x${app_cv_[]$1[]_os_env}" = "xmingw"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_GNU, [test "x${app_cv_[]$1[]_os_env}" = "xgnu"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_FREEBSD, [test "x${app_cv_[]$1[]_os_env}" = "xfreebsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_DRAGONFLY, [test "x${app_cv_[]$1[]_os_env}" = "xdragonfly"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_OPENBSD, [test "x${app_cv_[]$1[]_os_env}" = "xopenbsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_NETBSD, [test "x${app_cv_[]$1[]_os_env}" = "xnetbsd"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_SOLARIS, [test "x${app_cv_[]$1[]_os_env}" = "xsolaris"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_DARWIN, [test "x${app_cv_[]$1[]_os_env}" = "xdarwin"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_QNX, [test "x${app_cv_[]$1[]_os_env}" = "xqnx"])
AM_CONDITIONAL(m4_toupper($1)[]_OS_ENV_UNKNOWN, [test "x${app_cv_[]$1[]_os_env}" = "xunknown"])
AC_MSG_RESULT([${app_cv_[]$1[]_os_env}])
])
-171
View File
@@ -1,171 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_GET_MT_FLAGS(flags_prefix[, action-if-not-found])
# This macro detects compiler flags which are needed to compile a multi-threaded
# (possibly pthreads-based) applications on target OS. flags_prefixCFLAGS,
# flags_prefixCXXFLAGS and flags_prefixLIBS will be initialized (or appended to)
# with the correct flags.
# You must call AX_COMPILER_VENDOR, APP_DETECT_OS_KERNEL([target], ...)
# and APP_DETECT_OS_ENV([target], ...) before using this macro.
AC_DEFUN([APP_GET_MT_FLAGS], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_REQUIRE([APP_DETECT_OS_KERNEL])
AC_REQUIRE([APP_DETECT_OS_ENV])
AC_MSG_CHECKING([for target thread support flags])
app_cv_target_thread_cflags="";
app_cv_target_thread_cxxflags="";
app_cv_target_thread_libs="";
app_cv_target_thread_found="no";
# If vendor is not recognized, it's set to "unknown".
# NOTE: This works only on target compilers!
if test "x${ax_cv_cxx_compiler_vendor}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[ax_cv_cxx_compiler_vendor] not set.])
fi
if test "x${app_cv_target_os_kernel}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[app_cv_target_os_kernel] not set.])
fi
if test "x${app_cv_target_os_env}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[app_cv_target_os_env] not set.])
fi
# Compilers use at least 3 defines to indicate thread-safe support to standard libs:
# _THREAD_SAFE, _MT, _REENTRANT.
# We use the ones that are required for detected platform.
case "$app_cv_target_os_kernel" in
linux)
# glibc manual says that defining either _REENTRANT or _THREAD_SAFE
# enables some thread-safe implementations of glibc functions.
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "intel" \
|| test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
app_cv_target_thread_cflags="-pthread -D_MT -D_THREAD_SAFE"
app_cv_target_thread_cxxflags="-pthread -D_MT -D_THREAD_SAFE"
app_cv_target_thread_libs="-pthread"
app_cv_target_thread_found="yes";
elif test "$ax_cv_cxx_compiler_vendor" = "sun"; then
# suncc needs -lpthread on posix but not solaris.
# -mt defines _REENTRANT too. Don't use -lthread.
app_cv_target_thread_cflags="-mt"
app_cv_target_thread_cxxflags="-mt"
app_cv_target_thread_libs="-mt -lpthread"
app_cv_target_thread_found="yes";
fi
;;
windows)
# NOTE: Not sure about cygwin.
# NOTE: This only enables multithreaded code generation. For linking
# with pthreads-win32 you need additional flags.
# gcc man page: -mthreads: Support thread-safe exception handling on Mingw32.
# -mthreads defines -D_MT, and links with -lmingwthrd.
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
app_cv_target_thread_cflags="-mthreads -D_THREAD_SAFE"
app_cv_target_thread_cxxflags="-mthreads -D_THREAD_SAFE"
app_cv_target_thread_libs="-mthreads"
app_cv_target_thread_found="yes"
fi
;;
freebsd | dragonfly | netbsd | openbsd)
# NOTE: Not sure about debian gnu/kfreebsd and gnu/netbsd.
# Freebsd had -kthread, but it has been discontinued (afaik).
# For freebsd -pthread already replaces libc with libc_r.
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
app_cv_target_thread_cflags="-pthread -D_MT -D_THREAD_SAFE"
app_cv_target_thread_cxxflags="-pthread -D_MT -D_THREAD_SAFE"
app_cv_target_thread_libs="-pthread"
app_cv_target_thread_found="yes";
fi
;;
solaris)
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
# gnu documentation mentions -threads (and its aliases, -pthreads and -pthread)
app_cv_target_thread_cflags="-pthreads -D_MT -D_THREAD_SAFE"
app_cv_target_thread_cxxflags="-pthreads -D_MT -D_THREAD_SAFE"
app_cv_target_thread_libs="-pthreads"
app_cv_target_thread_found="yes"
elif test "$ax_cv_cxx_compiler_vendor" = "sun"; then
# -mt defines _REENTRANT too. Don't use -lthread.
# http://docs.sun.com/app/docs/doc/816-5175/pthreads-5?a=view
# http://docs.sun.com/app/docs/doc/816-5137/compile-74765?a=view
# There are two threading libraries, selectable via different switches.
app_cv_target_thread_cflags="-mt"
app_cv_target_thread_cxxflags="-mt"
app_cv_target_thread_libs="-mt"
app_cv_target_thread_found="yes"
fi
;;
darwin)
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
# Darwin produces mt code by default, and -pthread is an error.
# gcc/darwin defines __APPLE__. __UNIX__ is not defined.
# -D_THREAD_SAFE
app_cv_target_thread_found="yes"
fi
;;
qnx)
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
# afaik, gcc/qnx produces mt code by default (at least on newer qnx releases),
# so no flags are needed.
app_cv_target_thread_found="yes"
fi
;;
esac
if test "$app_cv_target_thread_found" = "no"; then
AC_MSG_WARN([Cannot detect compiler thread support. Set CFLAGS, CXXFLAGS and LIBS manually.])
m4_ifvaln([$2],[$2])dnl
else
AC_MSG_RESULT([CFLAGS: $app_cv_target_thread_cflags; CXXFLAGS: $app_cv_target_thread_cxxflags; LIBS: $app_cv_target_thread_libs])
if test "x$$1[]CFLAGS" = "x"; then
$1[]CFLAGS="$app_cv_target_thread_cflags";
else
$1[]CFLAGS="$$1[]CFLAGS $app_cv_target_thread_cflags";
fi
if test "x$$1[]CXXFLAGS" = "x"; then
$1[]CXXFLAGS="$app_cv_target_thread_cxxflags";
else
$1[]CXXFLAGS="$$1[]CXXFLAGS $app_cv_target_thread_cxxflags";
fi
if test "x$$1[]LIBS" = "x"; then
$1[]LIBS="$app_cv_target_thread_libs";
else
$1[]LIBS="$$1[]LIBS $app_cv_target_thread_libs";
fi
fi
])
-101
View File
@@ -1,101 +0,0 @@
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# APP_USE_SYSTEM_EXTENSIONS([flags_prefix])
# This macro detects compiler flags which are needed to enable
# system-specific library extensions. For example, on GNU platforms
# it's -D_GNU_SOURCE, on solaris it's -D__EXTENSIONS__, etc...
# Basically, it's the same as AC_USE_SYSTEM_EXTENSIONS,
# but uses compiler flag approach instead of config.h.
# You must call AX_COMPILER_VENDOR
# and APP_DETECT_OS_ENV([target], ...) before using this macro.
# More info:
# http://www.gnu.org/software/autoconf/manual/autoconf.html#Posix-Variants
# http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
# http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.predefined
# http://docs.sun.com/app/docs/doc/817-3946/6mjgmt4o8?l=en&a=view
AC_DEFUN([APP_USE_SYSTEM_EXTENSIONS], [
# These requirements check compile-time presence, not that they were called
AC_REQUIRE([AX_COMPILER_VENDOR])
AC_REQUIRE([APP_DETECT_OS_ENV])
AC_MSG_CHECKING([for target system extension flags])
app_cv_target_extension_cflags="";
app_cv_target_extension_cxxflags="";
app_cv_target_extension_libs="";
# If vendor is not recognized, it's set to "unknown".
# NOTE: This works only on target compilers!
if test "x${ax_cv_cxx_compiler_vendor}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[ax_cv_cxx_compiler_vendor] not set.])
fi
if test "x${app_cv_target_os_kernel}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[app_cv_target_os_kernel] not set.])
fi
if test "x${app_cv_target_os_env}" = "x"; then
# msg_result is needed to print the checking... message.
AC_MSG_RESULT([error])
AC_MSG_ERROR([[app_cv_target_os_env] not set.])
fi
case "$app_cv_target_os_env" in
gnu)
# glibc all-extensions macro: _GNU_SOURCE.
# gcc automatically defines it in later versions.
# suncc needs the flag explicitly.
# http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
app_cv_target_extension_cflags="-D_GNU_SOURCE"
app_cv_target_extension_cxxflags="-D_GNU_SOURCE"
;;
solaris)
# The problem with solaris is that it has too many incompatible
# feature test macros, and there is no enable-all macro. Autoconf
# mistakenly assumes that __EXTENSIONS__ is the one, but
# it should be defined _in addition_ to feature test macros.
# To support some posix macros, additional link objects are also required.
# http://docs.sun.com/app/docs/doc/816-5175/standards-5?a=view
;;
esac
AC_MSG_RESULT([CFLAGS: $app_cv_target_extension_cflags; CXXFLAGS: $app_cv_target_extension_cxxflags; LIBS: $app_cv_target_extension_libs])
if test "x$$1[]CFLAGS" = "x"; then
$1[]CFLAGS="$app_cv_target_extension_cflags";
else
$1[]CFLAGS="$$1[]CFLAGS $app_cv_target_extension_cflags";
fi
if test "x$$1[]CXXFLAGS" = "x"; then
$1[]CXXFLAGS="$app_cv_target_extension_cxxflags";
else
$1[]CXXFLAGS="$$1[]CXXFLAGS $app_cv_target_extension_cxxflags";
fi
if test "x$$1[]LIBS" = "x"; then
$1[]LIBS="$app_cv_target_extension_libs";
else
$1[]LIBS="$$1[]LIBS $app_cv_target_extension_libs";
fi
])
-65
View File
@@ -1,65 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_compiler_vendor.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_COMPILER_VENDOR
#
# DESCRIPTION
#
# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
# watcom, etc. The vendor is returned in the cache variable
# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2008 Matteo Frigo
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_COMPILER_VENDOR],
[
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
# note: don't check for gcc first since some other compilers define __GNUC__
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#if !($vencpp)
thisisanerror;
#endif
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
done
])
])
-56
View File
@@ -1,56 +0,0 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_cxx_gcc_abi_demangle.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CXX_GCC_ABI_DEMANGLE
#
# DESCRIPTION
#
# If the compiler supports GCC C++ ABI name demangling (has header
# cxxabi.h and abi::__cxa_demangle() function), define
# HAVE_GCC_ABI_DEMANGLE
#
# Adapted from AC_CXX_RTTI by Luc Maisonobe
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Neil Ferguson <nferguso@eso.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
[AC_CACHE_CHECK(whether the compiler supports GCC C++ ABI name demangling,
ac_cv_cxx_gcc_abi_demangle,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <typeinfo>
#include <cxxabi.h>
#include <string>
template<typename TYPE>
class A {};
]], [[A<int> instance;
int status = 0;
char* c_name = 0;
c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
std::string name(c_name);
free(c_name);
return name == "A<int>";
]])],[ac_cv_cxx_gcc_abi_demangle=yes],[ac_cv_cxx_gcc_abi_demangle=no])
AC_LANG_POP([])
])
if test "$ac_cv_cxx_gcc_abi_demangle" = yes; then
AC_DEFINE(HAVE_GCC_ABI_DEMANGLE,1,
[define if the compiler supports GCC C++ ABI name demangling])
fi
])
-27
View File
@@ -1,27 +0,0 @@
#! /bin/sh
#echo "Adding libtools..."
#libtoolize --automake --copy
# echo "Running aclocal (builds aclocal.m4)..."
# aclocal -I ./autoconf_m4
# echo "Running autoheader (generates config.h.in)..."
# autoheader
# echo "Running automake..."
# automake --add-missing --copy --foreign
# echo "Running autoconf..."
# autoconf
autoreconf --verbose --install -W all
rm -f config.cache
echo
echo 'run "./configure ; make ; make install"'
echo
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
stamp="../gsmartcontrol-`date +%F`"
echo $stamp
mkdir $stamp
cp -dp * $stamp/
rm -f $stamp/*pcs # kdevelop persistent store files
cp -a autoconf.m4/ $stamp/
cp -a data/ $stamp/
cp -a src/ $stamp/
cp -a templates/ $stamp/
# cp -a test-data/ $stamp/
tar cvf $stamp.tar $stamp
bzip2 -9 $stamp.tar
-57
View File
@@ -1,57 +0,0 @@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
INSTALL = @INSTALL@
host_triplet = @host@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
PACKAGE = @PACKAGE@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__quote = @am__quote@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
install_sh = @install_sh@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
target_alias = @target_alias@
Executable
+160
View File
@@ -0,0 +1,160 @@
#!/bin/bash
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2012 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
# Configure a build directory for development
function print_usage() {
echo -e "Usage:"
echo -e " ${0} [-t <toolchain_name>] [-c <compiler>] [-b <build_type>]"
echo -e " [-s <source_dir>] [-g <generator>] [-o <cmake_options>]"
echo -e "\nDetails:"
echo -e "-t <toolchain_name> - toolchain_name can be e.g. \"win32-mingw64\"."
echo -e " A toolchain file \"toolchains/<toolchain_name>.cmake\" will be used."
echo -e "-c <compiler> - compiler is one of:"
echo -e " gcc, gcc-<version>, clang, intel."
echo -e " The gcc version is the suffix of gcc and g++ executables, e.g. \"4.8\" in"
echo -e " \"gcc-4.8\"."
echo -e " If unspecified, CC and CXX environment variables are used."
echo -e "-b <build_type> - build_type is one of:"
echo -e " Debug, Release, RelWithDebInfo, MinSizeRel, none. The default is Debug."
echo -e "-s <source_dir> - source_dir is \"..\" by default."
echo -e "-g <cmake_generator> - cmake uses \"Unix Makefiles\" by default."
echo -e "-o <cmake_options> - options to pass directly to cmake."
}
compiler=""
build_type="";
source_dir=".."
toolchain_name=""
generator=""
cmake_options=""
while getopts "t:c:b:s:g:o:h:" opt; do
case $opt in
t)
echo "Requested toolchain: $OPTARG"
toolchain_name="$OPTARG";
;;
c)
echo "Requested compiler: $OPTARG"
compiler="$OPTARG";
;;
b)
echo "Requested build type: $OPTARG"
build_type="$OPTARG";
;;
s)
echo "Requested source directory type: $OPTARG"
source_dir="$OPTARG";
;;
g)
echo "Requested generator: $OPTARG"
generator="$OPTARG";
;;
o)
echo "Requested cmake options: $OPTARG"
cmake_options="$OPTARG";
;;
h)
print_usage;
exit 1;
;;
\?)
echo "Invalid option: $opt";
print_usage;
exit 1;
;;
esac
done
if [ "$compiler" != "" ] && [ "$toolchain_name" != "" ]; then
echo "Error: Conflicting options -c and -t specified."
exit 1;
fi
cmake_flags="-Wdev";
if [ "$build_type" = "none" ]; then
build_type="";
fi
if [ "$build_type" != "" ]; then
cmake_flags="$cmake_flags -DCMAKE_BUILD_TYPE=$build_type";
fi
if [ "$generator" != "" ]; then
cmake_flags="$cmake_flags -G${generator}";
fi
status=1
# Toolchain mode
if [ "$toolchain_name" != "" ]; then
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE='${source_dir}/data/cmake/toolchains/${toolchain_name}.cmake'"
echo "Running:"
echo "cmake $cmake_flags $source_dir";
cmake $cmake_flags $cmake_options $source_dir
status=$?
else # Compiler mode
c_compiler="";
cxx_compiler="";
# Detect gcc suffix like "-4.7"
if [ "${compiler:0:4}" = "gcc-" ]; then
suffix=${compiler:4};
c_compiler="gcc-${suffix}";
cxx_compiler="g++-${suffix}";
compiler="gcc";
fi
case $compiler in
gcc)
if [ "$c_compiler" = "" ]; then
c_compiler="gcc${machine_bits_switch}";
cxx_compiler="g++${machine_bits_switch}";
fi
;;
intel)
if [ $machine_bits_precise = "64" ]; then
c_compiler="icc64";
cxx_compiler="icpc64";
else
c_compiler="icc32";
cxx_compiler="icpc32";
fi
;;
clang)
c_compiler="clang${machine_bits_switch}";
cxx_compiler="clang++${machine_bits_switch}";
;;
"")
c_compiler="$CC"
cxx_compiler="$CXX"
;;
*)
echo "Unsupported compiler given; use CC and CXX instead."
exit 1;
;;
esac
echo "Running:"
echo "CC=\"$c_compiler\" CXX=\"$cxx_compiler\" cmake $cmake_flags $source_dir";
CC="$c_compiler" CXX="$cxx_compiler" cmake $cmake_flags $cmake_options $source_dir
status=$?
fi
exit $status
-511
View File
@@ -1,511 +0,0 @@
AC_INIT([GSmartControl], 0.8.4, [], [gsmartcontrol])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2 -Wall])
# Clear *FLAGS, LIBS, LDFLAGS if requested through configure option.
APP_AUTO_CLEAR_FLAGS()
# C compiler, C preprocessor
AC_PROG_CC
#AM_PROG_CC_STDC
#AC_PROG_CPP
# C++ compiler
AC_PROG_CXX
#AC_PROG_CXXCPP
#AM_PROG_LIBTOOL
# C++ support in checks
#AC_LANG([C])
AC_LANG([C++])
# Needed for generating static libs
AC_CHECK_TOOL(RANLIB, ranlib)
# Win32 resource file compilation
AC_CHECK_TOOL(WINDRES, windres)
# Win32 external dll stripping (already detected by autoconf)
# AC_CHECK_TOOL(STRIP, strip)
# Defines LN_S, needed for man page installation.
AC_PROG_LN_S
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# ------------- Detect compiler, OS, environment. Enable system features.
# detect compiler vendor (sets $ax_cv_cxx_compiler_vendor)
AX_COMPILER_VENDOR
# Detect target OS kernel and userspace and export to config.h
# (also define automake conditionals).
APP_DETECT_OS_KERNEL([target], [CONFIG_KERNEL_])
APP_DETECT_OS_ENV([target], [CONFIG_OS_ENV_])
APP_DETECT_OS_KERNEL([build], [CONFIG_HOST_KERNEL_])
# Detect common (warning, debug, optimize) compiler flags and
# export them to C(XX)FLAGS, LDFLAGS.
# We don't use prefix because this way the flags will be used for tests,
# which is important for some compatibility flags (e.g. __func__ visibility, etc...).
APP_COMPILER_OPTIONS([])
# Thread support for known configurations.
APP_GET_MT_FLAGS([])
# Enable _GNU_SOURCE, etc...
APP_USE_SYSTEM_EXTENSIONS([])
# Arrange large file support (define _FILE_OFFSET_BITS 64, etc...)
AC_SYS_LARGEFILE
# ------------- Correct incomplete standard libraries
# define int8_t and friends if the standard doesn't have them
AC_TYPE_INT8_T
AC_TYPE_UINT8_T
AC_TYPE_INT16_T
AC_TYPE_UINT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_TYPE_INTMAX_T
AC_TYPE_UINTMAX_T
AC_TYPE_LONG_LONG_INT
AC_TYPE_UNSIGNED_LONG_LONG_INT
# ------------- Language / Standard Library checks
# detect RTTI (defines HAVE_RTTI)
AC_CXX_RTTI
# detect exception support (defines HAVE_EXCEPTIONS)
AC_CXX_EXCEPTIONS
# detect abi::__cxa_demangle (defines HAVE_GCC_ABI_DEMANGLE)
AX_CXX_GCC_ABI_DEMANGLE
# detect __gnu_cxx::__verbose_terminate_handler (defines HAVE_VERBOSE_TERMINATE_HANDLER.)
AC_CXX_VERBOSE_TERMINATE_HANDLER
# detect __func__ support (defines HAVE_CXX___func__)
APP_CXX___FUNC__
# detect __FUNCTION__ support (defines HAVE_CXX___FUNCTION__)
APP_CXX___FUNCTION__
# detect if the compiler accepts extern "C" function pointer overloads
# (defines HAVE_CXX_EXTERN_C_OVERLOAD)
APP_CXX_EXTERN_C_OVERLOAD
# This may be needed for pch support
AC_CHECK_HEADERS([stdc++.h])
# pcrecpp needs this (break on first function found)
AC_CHECK_FUNCS([strtoll _strtoi64], [break])
# Non-C99 systems don't have strtof and strtold. some have strtodf for strtof,
# but let's ignore it. Note: They may be supported by system libc,
# but not enabled by default (e.g. by glibc feature macros). In that case,
# defining them still leads to undefined symbols at link time, so we don't do it.
# Header check is the best way to determine availability:
AC_CHECK_DECLS([strtof, strtold], [], [], [[#include <stdlib.h>]])
# link check only:
# AC_CHECK_FUNCS([strtof strtold])
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# Non-standard feature checks
# getrawpartition() for netbsd and openbsd in -lutil.
AC_CHECK_LIB(util, getrawpartition, [ LIBS="$LIBS -lutil" ])
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# enable / disable compilation of tests
AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests],
[enable compilation of test programs (default: no)]), [with_tests=${enableval}], [with_tests=no])
# export to automake.am-s
AM_CONDITIONAL([ENABLE_TESTS], [test "$with_tests" = "yes"])
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
AC_ARG_ENABLE(abort-if-no-gtkmm, AS_HELP_STRING([--disable-abort-if-no-gtkmm],
[disable abort if no gtkmm is found (default: configure aborts when gtkmm is not found)]),
[app_cv_abort_if_no_gtkmm=${enableval}], [app_cv_abort_if_no_gtkmm=yes])
AC_MSG_NOTICE([Abort if no gtkmm is found: $app_cv_abort_if_no_gtkmm])
# iconview is available since 2.6.0. gthread is not enabled by default.
pkg_modules="gtkmm-2.4 >= 2.6.0 gthread-2.0 >= 2.0"
# define ENABLE_GLIB and friends if it's found.
gtkmm_found="no"
PKG_CHECK_MODULES([GTKMM], [$pkg_modules], [
AC_DEFINE([ENABLE_GLIB], [1], [Whether GLib is installed])
AC_DEFINE([ENABLE_GLIBMM], [1], [Whether GLibmm is installed])
gtkmm_found="yes"], [gtkmm_found="no"])
if test "x$gtkmm_found" = "xno"; then
if test "x$app_cv_abort_if_no_gtkmm" = "xno"; then
AC_MSG_WARN([$GTKMM_PKG_ERRORS])
AC_MSG_WARN([The program will be unable to compile fully.])
else
AC_MSG_ERROR([$GTKMM_PKG_ERRORS])
fi
fi
# GTK flags must be prepended, or glib_config.h conflict between
# gtk 2.x and 1.2 may occur.
#CFLAGS="$GTKMM_CFLAGS $CFLAGS"
CXXFLAGS="$GTKMM_CFLAGS $CXXFLAGS"
LIBS="$GTKMM_LIBS $LIBS"
# Detect libglade / gtkbuilder support
APP_CHOOSE_GLD_READER([C++], [LIBGLADE_])
if test "$app_cv_gld_reader" = "libglade"; then
CFLAGS="$CFLAGS $LIBGLADE_CFLAGS"
CXXFLAGS="$CXXFLAGS $LIBGLADE_CXXFLAGS"
LIBS="$LIBS $LIBGLADE_LIBS"
fi
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
PCRE_CFLAGS="";
PCRE_LIBS="";
# try pkg-config first
PKG_CHECK_MODULES(PCRE, [libpcre], [pcre_found=yes], [pcre_found=no])
# if not found, try pcre-config (solaris had it but not pkg-config).
if test "x$pcre_found" = "xno"; then
AC_PATH_PROG(pcre_config_binary, [pcre-config])
if test "x$pcre_config_binary" != "x"; then
PCRE_CFLAGS="`pcre-config --cflags`"
PCRE_LIBS="`pcre-config --libs`"
else
# AC_MSG_ERROR([Could not find pcre through pkg-config and pcre-config. Make sure the pcre libraries are installed])
AC_MSG_ERROR([$PCRE_PKG_ERRORS])
fi
fi
CFLAGS="$CFLAGS $PCRE_CFLAGS"
CXXFLAGS="$CXXFLAGS $PCRE_CFLAGS"
LIBS="$LIBS $PCRE_LIBS"
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# Test stuff here...
# <nothing>
#SDL_VERSION=1.2.0
#AM_PATH_SDL($SDL_VERSION, :,
# AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) )
#CFLAGS="$CFLAGS $SDL_CFLAGS"
#CXXFLAGS="$CXXFLAGS $SDL_CFLAGS "
#LIBS="$LIBS $SDL_LIBS"
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# Win32 distribution support (NSIS, zip)
AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis=<location>|auto],
[specify makensis.exe location to support making NSIS packages]
[ (default: "C:\Program Files\NSIS\makensis.exe" for windows, ]
["~/.wine/drive_c/Program Files/NSIS/makensis.exe" for others)])],
[with_nsis=${withval}], [with_nsis=auto])
AC_ARG_ENABLE([nsis-wine], [AS_HELP_STRING([--enable-nsis-wine=yes|no|auto],
[use wine to run makensis.exe when making NSIS packages (default: auto, which is no for windows, yes for others)])],
[with_nsis_wine=${enableval}], [with_nsis_wine=yes])
AC_ARG_WITH([windows-dlls], [AS_HELP_STRING([--with-windows-dlls],
[specify location of Windows dlls when making Windows packages (default: /target/bin)])],
[with_windows_env=${withval}], [win_windows_dlls=auto])
if test "x$with_nsis" = "xauto" || test "x$with_nsis" = "x"; then
if test "x$app_cv_build_os_kernel" = "xwindows"; then
with_nsis="~/\".wine/drive_c/Program Files/NSIS/makensis.exe\"";
else
with_nsis="\"C:\\Program Files\\NSIS\\makensis.exe\"";
fi
fi
if test "x$with_nsis_wine" = "xauto"; then
if test "x$app_cv_build_os_kernel" = "xwindows"; then
with_nsis_wine="no";
else
with_nsis_wine="yes";
fi
fi
NSIS_EXEC="$with_nsis";
if test "x$with_nsis_wine" != "xno"; then
NSIS_EXEC="wine $with_nsis";
fi
if test "x$with_windows_dlls" = "xauto" || test "x$with_windows_dlls" = "x"; then
with_windows_dlls="/target/bin"
fi
WINDOWS_DLLS_LOCATION="$with_windows_dlls";
AC_SUBST(NSIS_EXEC)
AC_SUBST(WINDOWS_DLLS_LOCATION)
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
RES_FILES="src/res/gsc_about_dialog.glade \
src/res/gsc_executor_log_window.glade \
src/res/gsc_help_window.glade \
src/res/gsc_info_window.glade \
src/res/gsc_main_window.glade \
src/res/gsc_preferences_window.glade \
src/res/gsc_text_window.glade \
AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt"
# Unfortunately, _SOURCES can't contain substitutions, so we use LIBADD.
RES_LIBADD="" # .o file to put into .a, libres_a_LIBADD, libres_a_DEPENDENCIES.
RES_DIST="" # only files in "res" directory, EXTRA_DIST
RES_TARGETS="" # entry for each file in makefile
RES_GLD_EXT="glade"
if test "$app_cv_gld_reader" = "gtkbuilder"; then
RES_GLD_EXT="ui"
fi
for RES_FILE in $RES_FILES;
do # on separate line for portability
RES_BASE=`echo "$RES_FILE" | sed 's/.*\///'` # "a/b/c" -> "c", "c" -> "c"
RES_DIR=`AS_DIRNAME(["$RES_FILE"])` # "a/b/c" -> "a/b"
RES_BASE_NOEXT=`expr "$RES_BASE" : '\(.*\)\..*'` # "a.b.c" -> "a.b"
RES_BASE_EXT=`expr "$RES_BASE" : '.*\.\(.*\)'` # "a.b.c" -> "c"
# Add to EXTRA_DIST only if it's in the same directory. Other files should
# be added in their own directories.
RES_FILE_CANON="\$(top_srcdir)/$RES_FILE"
if test "$RES_DIR" = "src/res"; then
RES_DIST="$RES_DIST $RES_BASE"
RES_FILE_CANON="\$(srcdir)/$RES_BASE" # shorter path, better make behaviour
fi
# We use separate source files for gtkbuilder and libglademm, because
# make dist should be able to bundle both of them separately.
if test "$RES_BASE_EXT" = "glade"; then
RES_LIBADD="$RES_LIBADD $RES_BASE_NOEXT.$RES_GLD_EXT.$ac_objext" # file.ui.o or file.glade.o
# Output both glade and ui rules. This way make dist will be able
# to build cpp files of both of them.
RES_TARGETS="$RES_TARGETS
$RES_BASE_NOEXT.ui.cpp: $RES_FILE_CANON
gtk-builder-convert \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT\".tmp_ui
\"\$(top_srcdir)/file2csource.sh\" \"$RES_BASE_NOEXT\".tmp_ui \"$RES_BASE_NOEXT.ui.cpp\" \"$RES_BASE_NOEXT\"_ui
"
RES_TARGETS="$RES_TARGETS
$RES_BASE_NOEXT.glade.cpp: $RES_FILE_CANON
\"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT.glade.cpp\" \"$RES_BASE_NOEXT\"_ui
"
else # txt, etc...
SRC_FILE="$RES_BASE.cpp"
RES_LIBADD="$RES_LIBADD $RES_BASE.$ac_objext" # file.txt.o
RES_TARGETS="$RES_TARGETS
$SRC_FILE: $RES_FILE_CANON
\"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$SRC_FILE\" \"$RES_BASE_NOEXT\"_$RES_BASE_EXT
"
fi
done
# export to makefile.am
AC_SUBST(RES_LIBADD)
AC_SUBST(RES_DIST)
AC_SUBST(RES_TARGETS)
# Don't put this one into Makefile.in by default - it's multiline and causes havoc.
_AM_SUBST_NOTMAKE([RES_TARGETS])
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# Export some configure variables as defines for the source code.
# Note: Autoconf manual says that AC_DEFINE won't work here.
ADDITIONAL_FLAGS="-DPACKAGE_PKGDATA_DIR=\"\\\"\$(pkgdatadir)\\\"\" \
-DPACKAGE_SYSCONF_DIR=\"\\\"\$(sysconfdir)\\\"\" \
-DTOP_SRC_DIR=\"\\\"\$(top_srcdir)\\\"\""
#CFLAGS="$CFLAGS $ADDITIONAL_FLAGS"
CXXFLAGS="$CXXFLAGS $ADDITIONAL_FLAGS"
# Top src dir should always be in include path, before other includes.
# Add global configuration file. Note: It must be searched in top_builddir
# first (that's why -I is the first flag), for precompiled headers to work.
# Add pcrecpp too, because its files use #<file> on each other.
ADDITIONAL_INCLUDES="-I\$(top_builddir) -I\$(top_srcdir)/src -I\$(top_srcdir)/src/pcrecpp"
# -include works with gcc, intel and pathscale, but doesn't work with sun and pgi.
# Note: some gcc-frontend-based compilers may have to be added here
# (e.g. gccfss (gcc frontend / sun backend), etc...).
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "intel" \
|| test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
# This auto-includes this file when compiling any file. Benefits include pch support.
ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -include global_macros.h"
else # sun, pgi, others...
# This forces the file to be included manually.
ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -DHZ_NO_COMPILER_AUTOINCLUDE"
fi
# our flags must be before all the others
#CFLAGS="$ADDITIONAL_INCLUDES $CFLAGS"
CXXFLAGS="$ADDITIONAL_INCLUDES $CXXFLAGS"
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# final setup
# This macro should be defined by ./configure automatically.
# However, sometimes it's not (e.g. win32, why?), so we define it manually.
CXXFLAGS="$CXXFLAGS -DHAVE_CONFIG_H"
#CFLAGS="$CFLAGS $USER_INCLUDES"
#CXXFLAGS="$CXXFLAGS $USER_INCLUDES"
#LIBS="$LIBS $USER_LDFLAGS"
# make them available in Makefile.am
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LDFLAGS)
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
# all_includes="$all_includes $ALL_CXXFLAGS"
# all_libraries="$all_libraries $ALL_LIBS"
#all_includes="$all_includes $USER_INCLUDES"
#all_libraries="$all_libraries $LIBS"
# substitude them in makefile.am-s
#AC_SUBST(all_includes)
#AC_SUBST(all_libraries)
# print them out for debug purposes
AC_MSG_NOTICE([
CXXFLAGS:
$CXXFLAGS
LDFLAGS:
$LDFLAGS
LIBS:
$LIBS
])
# substitude autotools' predefined dir names in makefile.am-s
AC_SUBST(AUTODIRS)
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
AC_CONFIG_FILES([ data/gsmartcontrol.desktop \
data/nsis/distribution.txt data/nsis/gsmartcontrol.nsi \
debian.dist/changelog \
src/gsc_winres.rc \
gsmartcontrol.spec version compilation_flags ])
AC_CONFIG_FILES([data/gsmartcontrol-root], [chmod +x data/gsmartcontrol-root])
# these are all the makefiles to generate
AC_CONFIG_FILES([Makefile src/Makefile src/applib/Makefile src/res/Makefile src/hz/Makefile \
src/libdebug/Makefile src/pcrecpp/Makefile src/rconfig/Makefile src/rmn/Makefile \
data/Makefile data/16/Makefile data/22/Makefile data/24/Makefile data/32/Makefile \
data/48/Makefile data/64/Makefile data/128/Makefile data/256/Makefile data/nsis/Makefile \
debian.dist/Makefile])
AC_OUTPUT
+9
View File
@@ -0,0 +1,9 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
if (NOT WIN32)
install(DIRECTORY "cron-based_noadmin" DESTINATION "${CMAKE_INSTALL_DOCDIR}/contrib/")
endif()
@@ -1,10 +1,10 @@
#!/bin/bash
############################################################################
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2008 - 2009 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_whatever.txt file
############################################################################
# (C) 2008 - 2021 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
# (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
device="$1";
@@ -17,6 +17,6 @@ dev_base="`basename \"$device\"`"
out_file=/var/run/smart-"$dev_base"
# Change the path to smartctl if necessary.
smartctl -a "$device" 2>&1 > "$out_file"
smartctl -x "$device" 2>&1 > "$out_file"
chmod 644 "$out_file"
@@ -1,2 +1,9 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2008 - 2021 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
# (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
*/10 * * * * root /usr/local/bin/cron-smart.sh /dev/sda
*/10 * * * * root /usr/local/bin/cron-smart.sh /dev/sdb
+5 -5
View File
@@ -1,10 +1,10 @@
#!/bin/bash
############################################################################
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2008 - 2009 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_whatever.txt file
############################################################################
# (C) 2008 - 2021 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
# (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
if [ "$1" = "-V" ]; then
smartctl -V 2>&1
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/128x128/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/16x16/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/22x22/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/24x24/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/256x256/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/32x32/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/48x48/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
-4
View File
@@ -1,4 +0,0 @@
appicondir = $(datadir)/icons/hicolor/64x64/apps
appicon_DATA = gsmartcontrol.png
EXTRA_DIST = $(appicon_DATA)
+58
View File
@@ -0,0 +1,58 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
# Generate files
configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY)
configure_file("gsmartcontrol.in.desktop" "gsmartcontrol.desktop" ESCAPE_QUOTES @ONLY)
configure_file("gsmartcontrol-root.in.sh" "gsmartcontrol-root.sh" ESCAPE_QUOTES @ONLY)
configure_file("org.gsmartcontrol.in.policy" "org.gsmartcontrol.policy" ESCAPE_QUOTES @ONLY)
# Install app icons
if (NOT WIN32)
foreach(dir 16 22 24 32 48 64 128 256)
install(FILES "${dir}/gsmartcontrol.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${dir}x${dir}/apps/")
endforeach()
# Don't run update-icon-cache, cpack is mostly for packaging.
# install(CODE "execute_process (COMMAND gtk-update-icon-cache-3.0 -t -f \"@CMAKE_INSTALL_DATADIR@/icons/hicolor\")")
endif()
if (WIN32)
# .ico file
install(FILES gsmartcontrol.ico DESTINATION .)
endif()
# Install internal icons
if (WIN32)
install(FILES icon_cddvd.png icon_hdd.png
DESTINATION .)
else()
install(FILES icon_cddvd.png icon_hdd.png
DESTINATION "${CMAKE_INSTALL_DATADIR}/gsmartcontrol/icons")
endif()
# Desktop file
if (NOT WIN32)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gsmartcontrol.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications/")
# Appdata file
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gsmartcontrol.appdata.xml"
DESTINATION "${CMAKE_INSTALL_DATADIR}/metainfo/")
# PolKit file
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.gsmartcontrol.policy"
DESTINATION "${CMAKE_INSTALL_DATADIR}/polkit-1/actions/")
# Man pages
install(FILES "gsmartcontrol.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1/")
install(FILES "gsmartcontrol.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1/" RENAME "gsmartcontrol-root.1")
# Scripts (this goes to bin, not sbin, as it doesn't require root privileges before running)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gsmartcontrol-root.sh" DESTINATION "${CMAKE_INSTALL_BINDIR}" RENAME "gsmartcontrol-root")
endif()
-57
View File
@@ -1,57 +0,0 @@
SUBDIRS = 16 22 24 32 48 64 128 256 nsis
dist_man_MANS = gsmartcontrol.1
install-extra-mans:
cd $(DESTDIR)$(mandir)/man1 && $(LN_S) -f gsmartcontrol.1 gsmartcontrol-root.1
uninstall-extra-mans:
cd $(DESTDIR)$(mandir)/man1 && rm -f gsmartcontrol-root.1
# This command is needed if installing with make install (the cache
# file is ignored for rpms).
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook: install-extra-mans update-icon-cache
uninstall-hook: uninstall-extra-mans update-icon-cache
update-icon-cache:
@-if test -z "$(DESTDIR)"; then \
echo "Updating GTK icon cache."; \
$(gtk_update_icon_cache); \
else \
echo "*** Icon cache not updated. After (un)install, run this:"; \
echo "*** $(gtk_update_icon_cache)"; \
fi
# Application data, installs to /usr/share/appname
appdatadir = $(pkgdatadir)
appdata_DATA = icon_cddvd.png icon_hdd.png
# pkgdatadir = $(datadir)/gsmartcontrol
# pkgdata_DATA =
# Desktop files
desktopdir = $(datadir)/applications
desktop_DATA = gsmartcontrol.desktop
# Application pixmap (fallback icon for desktop files).
# Same as 48/gsmartcontrol.png.
# Also, xpm for debian menu, 32x32.
pixmapsdir = $(datadir)/pixmaps
pixmaps_DATA = 48/gsmartcontrol.png gsmartcontrol.xpm
# Put everything inside the distribution
EXTRA_DIST = $(appdata_DATA) gsmartcontrol.ico gsmartcontrol.xpm
bin_SCRIPTS = gsmartcontrol-root
CLEANFILES = $(bin_SCRIPTS)
+250
View File
@@ -0,0 +1,250 @@
# From https://github.com/vector-of-bool/CMakeCM/blob/master/modules/FindFilesystem.cmake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindFilesystem
##############
This module supports the C++17 standard library's filesystem utilities. Use the
:imp-target:`std::filesystem` imported target to
Options
*******
The ``COMPONENTS`` argument to this module supports the following values:
.. find-component:: Experimental
:name: fs.Experimental
Allows the module to find the "experimental" Filesystem TS version of the
Filesystem library. This is the library that should be used with the
``std::experimental::filesystem`` namespace.
.. find-component:: Final
:name: fs.Final
Finds the final C++17 standard version of the filesystem library.
If no components are provided, behaves as if the
:find-component:`fs.Final` component was specified.
If both :find-component:`fs.Experimental` and :find-component:`fs.Final` are
provided, first looks for ``Final``, and falls back to ``Experimental`` in case
of failure. If ``Final`` is found, :imp-target:`std::filesystem` and all
:ref:`variables <fs.variables>` will refer to the ``Final`` version.
Imported Targets
****************
.. imp-target:: std::filesystem
The ``std::filesystem`` imported target is defined when any requested
version of the C++ filesystem library has been found, whether it is
*Experimental* or *Final*.
If no version of the filesystem library is available, this target will not
be defined.
.. note::
This target has ``cxx_std_17`` as an ``INTERFACE``
:ref:`compile language standard feature <req-lang-standards>`. Linking
to this target will automatically enable C++17 if no later standard
version is already required on the linking target.
.. _fs.variables:
Variables
*********
.. variable:: CXX_FILESYSTEM_IS_EXPERIMENTAL
Set to ``TRUE`` when the :find-component:`fs.Experimental` version of C++
filesystem library was found, otherwise ``FALSE``.
.. variable:: CXX_FILESYSTEM_HAVE_FS
Set to ``TRUE`` when a filesystem header was found.
.. variable:: CXX_FILESYSTEM_HEADER
Set to either ``filesystem`` or ``experimental/filesystem`` depending on
whether :find-component:`fs.Final` or :find-component:`fs.Experimental` was
found.
.. variable:: CXX_FILESYSTEM_NAMESPACE
Set to either ``std::filesystem`` or ``std::experimental::filesystem``
depending on whether :find-component:`fs.Final` or
:find-component:`fs.Experimental` was found.
Examples
********
Using `find_package(Filesystem)` with no component arguments:
.. code-block:: cmake
find_package(Filesystem REQUIRED)
add_executable(my-program main.cpp)
target_link_libraries(my-program PRIVATE std::filesystem)
#]=======================================================================]
if(TARGET std::filesystem)
# This module has already been processed. Don't do it again.
return()
endif()
cmake_minimum_required(VERSION 3.10)
include(CMakePushCheckState)
include(CheckIncludeFileCXX)
# If we're not cross-compiling, try to run test executables.
# Otherwise, assume that compile + link is a sufficient check.
if(CMAKE_CROSSCOMPILING)
include(CheckCXXSourceCompiles)
macro(_cmcm_check_cxx_source code var)
check_cxx_source_compiles("${code}" ${var})
endmacro()
else()
include(CheckCXXSourceRuns)
macro(_cmcm_check_cxx_source code var)
check_cxx_source_runs("${code}" ${var})
endmacro()
endif()
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${Filesystem_FIND_QUIETLY})
# All of our tests required C++17 or later
set(CMAKE_CXX_STANDARD 17)
# Normalize and check the component list we were given
set(want_components ${Filesystem_FIND_COMPONENTS})
if(Filesystem_FIND_COMPONENTS STREQUAL "")
set(want_components Final)
endif()
# Warn on any unrecognized components
set(extra_components ${want_components})
list(REMOVE_ITEM extra_components Final Experimental)
foreach(component IN LISTS extra_components)
message(WARNING "Extraneous find_package component for Filesystem: ${component}")
endforeach()
# Detect which of Experimental and Final we should look for
set(find_experimental TRUE)
set(find_final TRUE)
if(NOT "Final" IN_LIST want_components)
set(find_final FALSE)
endif()
if(NOT "Experimental" IN_LIST want_components)
set(find_experimental FALSE)
endif()
if(find_final)
check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_HEADER)
if(_CXX_FILESYSTEM_HAVE_HEADER)
# We found the non-experimental header. Don't bother looking for the
# experimental one.
set(find_experimental FALSE)
endif()
else()
set(_CXX_FILESYSTEM_HAVE_HEADER FALSE)
endif()
if(find_experimental)
check_include_file_cxx("experimental/filesystem" _CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
else()
set(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER FALSE)
endif()
if(_CXX_FILESYSTEM_HAVE_HEADER)
set(_have_fs TRUE)
set(_fs_header filesystem)
set(_fs_namespace std::filesystem)
set(_is_experimental FALSE)
elseif(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
set(_have_fs TRUE)
set(_fs_header experimental/filesystem)
set(_fs_namespace std::experimental::filesystem)
set(_is_experimental TRUE)
else()
set(_have_fs FALSE)
endif()
set(CXX_FILESYSTEM_HAVE_FS ${_have_fs} CACHE BOOL "TRUE if we have the C++ filesystem headers")
set(CXX_FILESYSTEM_HEADER ${_fs_header} CACHE STRING "The header that should be included to obtain the filesystem APIs")
set(CXX_FILESYSTEM_NAMESPACE ${_fs_namespace} CACHE STRING "The C++ namespace that contains the filesystem APIs")
set(CXX_FILESYSTEM_IS_EXPERIMENTAL ${_is_experimental} CACHE BOOL "TRUE if the C++ filesystem library is the experimental version")
set(_found FALSE)
if(CXX_FILESYSTEM_HAVE_FS)
# We have some filesystem library available. Do link checks
string(CONFIGURE [[
#include <cstdlib>
#include <@CXX_FILESYSTEM_HEADER@>
int main() {
auto cwd = @CXX_FILESYSTEM_NAMESPACE@::current_path();
printf("%s", cwd.c_str());
return EXIT_SUCCESS;
}
]] code @ONLY)
# Check a simple filesystem program without any linker flags
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
set(can_link ${CXX_FILESYSTEM_NO_LINK_NEEDED})
if(NOT CXX_FILESYSTEM_NO_LINK_NEEDED)
set(prev_libraries ${CMAKE_REQUIRED_LIBRARIES})
# Add the libstdc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lstdc++fs)
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_STDCPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_STDCPPFS_NEEDED})
if(NOT CXX_FILESYSTEM_STDCPPFS_NEEDED)
# Try the libc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lc++fs)
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_CPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_CPPFS_NEEDED})
endif()
endif()
if(can_link)
add_library(std::filesystem INTERFACE IMPORTED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17)
set(_found TRUE)
if(CXX_FILESYSTEM_NO_LINK_NEEDED)
# Nothing to add...
elseif(CXX_FILESYSTEM_STDCPPFS_NEEDED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lstdc++fs)
elseif(CXX_FILESYSTEM_CPPFS_NEEDED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lc++fs)
endif()
endif()
endif()
cmake_pop_check_state()
set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE)
if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND)
message(FATAL_ERROR "Cannot run simple program using std::filesystem")
endif()
-111
View File
@@ -1,111 +0,0 @@
#!/bin/bash
############################################################################
# Copyright:
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
# License: See LICENSE_zlib.txt file
############################################################################
# Run gsmartcontrol with root, asking for root password first.
EXEC_BIN="@prefix@/bin/gsmartcontrol";
prog_name="gsmartcontrol"
DESKTOP="$1";
# This works for --help too
if [ "$DESKTOP" = "" ]; then
DESKTOP="auto"; # default
elif [ "$DESKTOP" != "auto" ] && [ "$DESKTOP" != "kde" ] && \
[ "$DESKTOP" != "gnome" ] && [ "$DESKTOP" != "other" ]; then
echo "Usage: $0 [<auto|kde|gnome|other> [<${prog_name}_options>] ]";
exit 1;
fi
shift; # remove $1
# Auto-detect current desktop if auto was specified.
if [ "$DESKTOP" = "auto" ]; then
# KDE_SESSION_UID is present on kde3 and kde4.
# Note that it may be empty (but still set)
if [ "${KDE_SESSION_UID+set}" = "set" ]; then
DESKTOP="kde";
# same with gnome
elif [ "${GNOME_DESKTOP_SESSION_ID+set}" = "set" ]; then
DESKTOP="gnome";
else
DESKTOP="other";
fi
fi
# echo $DESKTOP;
# They're basically the same, only the order is different.
# sux requires xterm to ask for the password.
# xdg-su is basically like this script, except worse :)
gnome_sus="gnomesu gksu kdesu xdg-su sux";
kde_sus="kdesu gnomesu gksu xdg-su sux";
other_sus="$gnome_sus";
candidates="";
found_su=""
if [ "$DESKTOP" = "gnome" ]; then
candidates="$gnome_sus";
elif [ "$DESKTOP" = "kde" ]; then
candidates="$kde_sus";
elif [ "$DESKTOP" = "other" ]; then
candidates="$other_sus";
fi
for subin in $candidates; do
which $subin &>/dev/null
if [ $? -eq 0 ]; then
found_su="$subin";
break;
fi
done
if [ "$found_su" = "" ]; then
xmessage "Error launching ${prog_name}: No suitable su mechanism found.
Try installing kdesu, gnomesu, gksu or sux first.";
exit 1;
fi
# gnomesu and gksu (but not kdesu, not sure about others) fail to adopt
# root's PATH. Since the user's PATH may not contain /usr/sbin (with smartctl)
# on some distributions (e.g. mandriva), add it manually. We also add
# /usr/local/sbin, since that's the default location of custom-compiled smartctl.
# Add these directories _before_ existing PATH, so that the user is not
# tricked into running it from some other path (we're running as root with
# the user's env after all).
export PATH="/usr/sbin:/usr/local/sbin:$PATH"
# echo $found_su;
# Examples:
# gnomesu -c 'gsmartcontrol --no-scan'
# kdesu -c 'gsmartcontrol --no-scan'
# xterm -e sux -c 'gsmartcontrol --no-scan' # sux asks for password in a terminal
full_cmd=""
if [ "$found_su" = "sux" ]; then
full_cmd="xterm -e sux -c '$EXEC_BIN $@'"
elif [ "$found_su" = "gksu" ]; then
full_cmd="$found_su '$EXEC_BIN $@'"
else # gnomesu, kdesu, xdg-su
full_cmd="$found_su -c '$EXEC_BIN $@'"
fi
eval $full_cmd
+171
View File
@@ -0,0 +1,171 @@
#!/bin/bash
###############################################################################
# License: Zlib
# Copyright:
# (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
# Run gsmartcontrol with root, asking for root password first.
# export GSMARTCONTROL_SU to override a su command (e.g. "kdesu -c").
EXEC_BIN="@CMAKE_INSTALL_FULL_SBINDIR@/gsmartcontrol";
prog_name="gsmartcontrol"
# Preserve quotes in arguments
final_args_quoted="";
for i in "$@";do
final_args_quoted="$final_args_quoted \"${i//\"/\\\"}\"";
done;
DESKTOP="auto";
# Compatibility with old syntax:
# gsmartcontrol-root [<desktop> [program_options]]
if [ "$1" == "auto" ] || [ "$1" == "kde" ] || [ "$1" == "gnome" ] || [ "$1" == "other" ]; then
DESKTOP="$1";
shift; # remove $1
else
# New syntax:
# gsmartcontrol-root [--desktop=<auto|kde|gnome|other>] [program_options]
for arg in $*; do
case $arg in
--desktop=*)
DESKTOP="${arg#*=}";
final_args_quoted="${final_args_quoted/\"$arg\"/}";
;;
*)
# unknown option
;;
esac
done
fi
if [ "$DESKTOP" != "auto" ] && [ "$DESKTOP" != "kde" ] && \
[ "$DESKTOP" != "gnome" ] && [ "$DESKTOP" != "other" ]; then
echo "Usage: $0 [--desktop=<auto|kde|gnome|other>] [<${prog_name}_options>]";
exit 1;
fi
# Auto-detect current desktop if auto was specified.
if [ "$DESKTOP" = "auto" ]; then
# KDE_SESSION_UID is present on kde3 and kde4.
# Note that it may be empty (but still set)
if [ "${KDE_SESSION_UID+set}" = "set" ]; then
DESKTOP="kde";
# same with gnome
elif [ "${GNOME_DESKTOP_SESSION_ID+set}" = "set" ]; then
DESKTOP="gnome";
else
DESKTOP="other";
fi
fi
# echo $DESKTOP;
# They're basically the same, only the order is different.
# pkexec is for PolKit.
# sux requires xterm to ask for the password.
# xdg-su is basically like this script, except worse :)
# su-to-root is a debian/ubuntu official method (although gksu is available).
gnome_sus="pkexec su-to-root gnomesu gksu kdesu beesu xdg-su sux";
kde_sus="pkexec su-to-root kdesu gnomesu gksu beesu xdg-su sux";
other_sus="$gnome_sus";
candidates="";
found_su=""
if [ "$DESKTOP" = "gnome" ]; then
candidates="$gnome_sus";
elif [ "$DESKTOP" = "kde" ]; then
candidates="$kde_sus";
elif [ "$DESKTOP" = "other" ]; then
candidates="$other_sus";
fi
if [ "$GSMARTCONTROL_SU" = "" ]; then
for subin in $candidates; do
which $subin &>/dev/null
if [ $? -eq 0 ]; then
found_su="$subin";
break;
fi
done
if [ "$found_su" = "" ]; then
xmessage "Error launching ${prog_name}: No suitable su mechanism found.
Try installing PolKit, kdesu, gnomesu, gksu, beesu or sux first.";
exit 1;
fi
fi
# gnomesu and gksu (but not kdesu, not sure about others) fail to adopt
# root's PATH. Since the user's PATH may not contain /usr/sbin (with smartctl)
# on some distributions (e.g. mandriva), add it manually. We also add
# /usr/local/sbin, since that's the default location of custom-compiled smartctl.
# Add these directories _before_ existing PATH, so that the user is not
# tricked into running it from some other path (we're running as root with
# the user's env after all).
# Add sbindir as well (freebsd seems to require it).
# Note that beesu won't show a GUI login box if /usr/sbin is before /usr/bin,
# so add it first as well.
EXTRA_PATHS="/usr/bin:/usr/sbin:/usr/local/sbin:@CMAKE_INSTALL_FULL_SBINDIR@";
export PATH="$EXTRA_PATHS:$PATH"
# echo $found_su;
# Examples:
# gnomesu -c 'gsmartcontrol --no-scan'
# kdesu -c 'gsmartcontrol --no-scan'
# beesu -P 'gsmartcontrol --no-scan'
# su-to-root -X -c 'gsmartcontrol --no-scan'
# xterm -e sux -c 'gsmartcontrol --no-scan' # sux asks for password in a terminal
full_cmd="";
if [ "$GSMARTCONTROL_SU" != "" ]; then
full_cmd="$GSMARTCONTROL_SU '$EXEC_BIN $final_args_quoted'";
elif [ "$found_su" = "pkexec" ]; then
if [ "$GDK_SCALE" != "" ]; then
final_args_quoted="$final_args_quoted --gdk-scale='$GDK_SCALE'"
fi
if [ "$GDK_DPI_SCALE" != "" ]; then
final_args_quoted="$final_args_quoted --gdk-dpi-scale='$GDK_DPI_SCALE'"
fi
full_cmd="pkexec --disable-internal-agent $EXEC_BIN $final_args_quoted";
elif [ "$found_su" = "sux" ]; then
full_cmd="xterm -e sux -c '$EXEC_BIN $final_args_quoted'";
elif [ "$found_su" = "gksu" ]; then
full_cmd="$found_su '$EXEC_BIN $final_args_quoted'";
elif [ "$found_su" = "beesu" ]; then
full_cmd="$found_su -P '$EXEC_BIN $final_args_quoted'";
elif [ "$found_su" = "su-to-root" ]; then
full_cmd="$found_su -X -c '$EXEC_BIN $final_args_quoted'";
else # gnomesu, kdesu, xdg-su
full_cmd="$found_su -c '$EXEC_BIN $final_args_quoted'";
fi
# echo $full_cmd
eval $full_cmd
+16 -9
View File
@@ -1,16 +1,16 @@
.TH GSmartControl "1" "" "gsmartcontrol " "User Commands"
.SH NAME
GSmartControl \- Hard disk drive health inspection tool
GSmartControl \- Hard disk drive and SSD health inspection tool
.SH SYNOPSIS
\fBgsmartcontrol\fP [OPTIONS]
\fBgsmartcontrol\-root\fP [\fI<desktop>\fP [OPTIONS]]
\fBgsmartcontrol\-root\fP [--desktop=\fI<desktop>\fP] [OPTIONS]
.SH DESCRIPTION
\fBGSmartControl\fP is a graphical user interface for smartctl (from
smartmontools), which is a tool for querying and controlling SMART
(Self-Monitoring, Analysis, and Reporting Technology) data on modern hard disk
drives. It allows you to inspect the drive's SMART data to determine its
health, as well as run various tests on it.
and solid-state drives. It allows you to inspect the drive's SMART data to
determine its health, as well as run various tests on it.
.PP
This manual page documents briefly the \fBgsmartcontrol\fP and
\fBgsmartcontrol\-root\fP commands.
@@ -37,7 +37,7 @@ Show logging options
.SS "Application Options:"
.TP
\fB\-l\fP, \fB\-\-no\-locale\fP
Disable locale
Don't use system locale
.TP
\fB\-V\fP, \fB\-\-version\fP
Display version information
@@ -49,10 +49,17 @@ Don't scan devices on startup
Don't hide non\-identity tabs when SMART is disabled. Useful for debugging.
.TP
\fB\-\-add\-virtual\fP
Load smartctl data from file, creating a virtual drive
Load smartctl data from file, creating a virtual drive. You
can specify this option multiple times.
.TP
\fB\-\-add\-device\fP
Add this device to device list. Useful with \fB\-\-no\-scan\fP to list certain drives only.
Add this device to device list. The format of the device is
\fI<device>::<type>::<extra_args>\fP, where type and extra_args are optional.
This option is useful with \fB\-\-no\-scan\fP to list certain drives only. You
can specify this option multiple times. Example:\fR
.nf
\-\-add\-device /dev/sda \-\-add\-device /dev/twa0::3ware,2 \-\-add\-device '/dev/sdb::::-T permissive'
.fi
.TP
\fB\-\-display\fP=\fIDISPLAY\fP
X display to use
@@ -67,8 +74,8 @@ Disable logging; same as \fB\-\-verbosity\-level\fP 0
Set verbosity level [0\-5]
.PP
.SH COPYRIGHT
Copyright \(co 2008 \- 2009 Alexander Shaduri <ashaduri \'at\' gmail.com>
Copyright \(co 2008 \- 2021 Alexander Shaduri <ashaduri@gmail.com>
.PP
.SH AUTHOR
This manual page was originally written by Giuseppe Iuculano
<giuseppe@iuculano.it>, for the Debian project.
<giuseppe@iuculano.it> for the Debian project.
+33
View File
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>gsmartcontrol</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>GSmartControl</name>
<summary>Hard Disk and SSD Health Inspection</summary>
<description>
<p>
GSmartControl is a graphical user interface for smartctl, which is a tool for
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
Technology) data in hard disk and solid-state drives. It allows you to inspect
the drive's SMART data to determine its health, as well as run various tests
on it.
</p>
</description>
<launchable type="desktop-id">gsmartcontrol.desktop</launchable>
<url type="homepage">https://gsmartcontrol.shaduri.dev</url>
<screenshots>
<screenshot type="default">
<caption>Main window</caption>
<image>https://gsmartcontrol.sourceforge.io/home/images/main_ok.png</image>
</screenshot>
<screenshot>
<caption>Drive identity information</caption>
<image>https://gsmartcontrol.sourceforge.io/home/images/info_identity.png</image>
</screenshot>
<screenshot>
<caption>Attribute list of a failing drive</caption>
<image>https://gsmartcontrol.sourceforge.io/home/images/info_failing.png</image>
</screenshot>
</screenshots>
</component>
-29
View File
@@ -1,29 +0,0 @@
[Desktop Entry]
# desktop file version
Version=1.0
Type=Application
Categories=System;Monitor;
Name=GSmartControl
# short description, usually shown in parentheses after Name
GenericName=Hard Disk Health Inspection
# tooltip
Comment=Monitor and control SMART data on hard disks
# If it's a name only, it looks for "name.[png|xpm]" file in
# $XDG_DATA_DIRS/icons and /usr/share/pixmaps.
# An absolute file path is also supported.
Icon=gsmartcontrol
# Run with root permissions. This should work with newer GNOME too.
# It _should_ work with kde, but it hangs on mine, so use plain kdesu.
#X-KDE-SubstituteUID=true
#X-KDE-RootOnly=true
# Run with root permissions.
Exec="@prefix@/bin/gsmartcontrol-root"
# Build service rpmlint gives errors without this
X-SuSE-translate=false
+35
View File
@@ -0,0 +1,35 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
[Desktop Entry]
# desktop file version
Version=1.0
Type=Application
Categories=System;Monitor;
Name=GSmartControl
# short description, usually shown in parentheses after Name
GenericName=Hard Disk and SSD Health Inspection
GenericName[fr]=Inspecteur de santé de disque dur et de SSD
# tooltip
Comment=Monitor and control SMART data on hard disk and solid-state drives
Comment[fr]=Surveille et contrôle les données SMART des disques durs et des SSD
# If it's a name only, it looks for "name.[png|xpm]" file in
# $XDG_DATA_DIRS/icons.
# An absolute file path is also supported.
Icon=gsmartcontrol
# Run with root permissions. This should work with newer GNOME too.
# It _should_ work with kde, but it hangs on mine, so use plain kdesu.
#X-KDE-SubstituteUID=true
#X-KDE-RootOnly=true
# Run with root permissions.
Exec="@CMAKE_INSTALL_FULL_BINDIR@/gsmartcontrol-root"
-394
View File
@@ -1,394 +0,0 @@
/* XPM */
static char * gsmartcontrol_xpm[] = {
"32 32 359 2",
" c None",
". c #ABAAAA",
"+ c #CCCCCC",
"@ c #C5C4C4",
"# c #C2C1C1",
"$ c #D2D1D1",
"% c #C8C7C7",
"& c #C8C7C8",
"* c #C9C8C8",
"= c #CAC8C9",
"- c #CAC9C9",
"; c #C8C6C7",
"> c #C7C6C6",
", c #CFCDCE",
"' c #D1D0D0",
") c #C6C5C6",
"! c #CFCECE",
"~ c #B9B7B7",
"{ c #D4D4D4",
"] c #DCDBDC",
"^ c #D8D7D7",
"/ c #D6D5D5",
"( c #D6D5D6",
"_ c #D7D6D6",
": c #D9D8D8",
"< c #DBDADB",
"[ c #DAD9DA",
"} c #D7D7D7",
"| c #D6D6D6",
"1 c #DAD9D9",
"2 c #E2E1E1",
"3 c #B0AFAF",
"4 c #D3D2D2",
"5 c #CDCCCC",
"6 c #CDCDCD",
"7 c #CECDCD",
"8 c #CECECE",
"9 c #CFCFCF",
"0 c #D0CFCF",
"a c #C0BFBF",
"b c #9C9A9B",
"c c #6E6B6B",
"d c #807E7F",
"e c #C8C8C8",
"f c #CAC9CA",
"g c #CACACA",
"h c #CBCACA",
"i c #CCCBCB",
"j c #CCCBCC",
"k c #D0CECF",
"l c #C3C2C2",
"m c #A09E9F",
"n c #B5B4B4",
"o c #AFADAE",
"p c #787576",
"q c #8D8B8B",
"r c #D4D3D3",
"s c #C7C6C7",
"t c #C7C7C7",
"u c #C9C8C9",
"v c #C9C9C9",
"w c #CACAC9",
"x c #BFBEBE",
"y c #A3A1A2",
"z c #A09D9E",
"A c #B4B2B2",
"B c #B6B4B4",
"C c #827F80",
"D c #969595",
"E c #C4C3C3",
"F c #C4C4C4",
"G c #C5C5C5",
"H c #C6C5C5",
"I c #C6C6C6",
"J c #C9C7C8",
"K c #B9B7B8",
"L c #A5A4A4",
"M c #A4A3A3",
"N c #A7A5A5",
"O c #B3B1B2",
"P c #BFBDBD",
"Q c #8D8A8B",
"R c #A09F9F",
"S c #DDDCDC",
"T c #C0C0C0",
"U c #C3C1C2",
"V c #C3C2C3",
"W c #C3C3C3",
"X c #C4C3C4",
"Y c #B2B1B1",
"Z c #A8A7A7",
"` c #ABA9A9",
" . c #CFCECF",
".. c #C2C0C1",
"+. c #989697",
"@. c #A8A6A7",
"#. c #DEDDDD",
"$. c #DEDDDE",
"%. c #C1C0C0",
"&. c #C2C1C2",
"*. c #B1B0B0",
"=. c #ADACAC",
"-. c #AFAEAE",
";. c #BDBCBC",
">. c #B3B2B2",
",. c #B4B3B4",
"'. c #B8B8B8",
"). c #D5D4D4",
"!. c #C0BFBE",
"~. c #C1C0C1",
"{. c #C3C1C1",
"]. c #C4C4C3",
"^. c #B2B0B1",
"/. c #B3B2B3",
"(. c #B4B3B3",
"_. c #A1A0A0",
":. c #B9B8B8",
"<. c #C4C2C3",
"[. c #BDBBBC",
"}. c #B5B4B3",
"|. c #B6B4B5",
"1. c #B7B5B6",
"2. c #B7B6B7",
"3. c #B8B7B7",
"4. c #B8B7B8",
"5. c #BCBABB",
"6. c #BBBABA",
"7. c #BFBEBF",
"8. c #C1C1C1",
"9. c #C1BFC0",
"0. c #BCBBBB",
"a. c #BEBCBD",
"b. c #BEBDBD",
"c. c #9B999A",
"d. c #9D9B9B",
"e. c #C2C2C2",
"f. c #D4D3D4",
"g. c #CECDCE",
"h. c #C7C5C5",
"i. c #A4A2A3",
"j. c #A19F9F",
"k. c #C6C4C5",
"l. c #DCDCDC",
"m. c #D0CFD0",
"n. c #CECCCD",
"o. c #A2A1A1",
"p. c #939292",
"q. c #E1E0E0",
"r. c #E3E3E3",
"s. c #B3B3B3",
"t. c #CCCACB",
"u. c #D2D2D2",
"v. c #D5D3D4",
"w. c #A7A6A6",
"x. c #959494",
"y. c #E3E2E2",
"z. c #DCDBDB",
"A. c #CBC9CA",
"B. c #E1E0E1",
"C. c #DFDEDE",
"D. c #CECCCC",
"E. c #CDCCCD",
"F. c #D2D0D0",
"G. c #D2D0D1",
"H. c #B5B4B5",
"I. c #B1AFB0",
"J. c #EDECEC",
"K. c #D1CFCF",
"L. c #CDCBCC",
"M. c #D5D5D5",
"N. c #DCDADA",
"O. c #C5C4C5",
"P. c #D2D1D2",
"Q. c #D5D4D5",
"R. c #DADADA",
"S. c #DBDADA",
"T. c #DDDCDD",
"U. c #D7D6D7",
"V. c #E8E7E7",
"W. c #D8D8D8",
"X. c #D8D6D6",
"Y. c #D9D8D9",
"Z. c #DBDBDB",
"`. c #DDDDDD",
" + c #474747",
".+ c #ECEBEB",
"++ c #F3F3F3",
"@+ c #E4E3E3",
"#+ c #E0DFDF",
"$+ c #E5E5E5",
"%+ c #EFEFEF",
"&+ c #EBEAEB",
"*+ c #E6E5E5",
"=+ c #E0E0E0",
"-+ c #E4E4E4",
";+ c #E5E4E4",
">+ c #ECECEC",
",+ c #666666",
"'+ c #585757",
")+ c #D9D9DA",
"!+ c #E2E2E2",
"~+ c #E6E5E6",
"{+ c #E1E1E1",
"]+ c #E6E6E6",
"^+ c #E7E7E7",
"/+ c #898989",
"(+ c #767575",
"_+ c #E0DFE0",
":+ c #E9E9E9",
"<+ c #BDBDBD",
"[+ c #B6B6B6",
"}+ c #B0B0B0",
"|+ c #ACACAC",
"1+ c #ACABAC",
"2+ c #A7A7A7",
"3+ c #DFDFDF",
"4+ c #E5E5E4",
"5+ c #E9E8E8",
"6+ c #E8E8E8",
"7+ c #E3E2E3",
"8+ c #D7D5D5",
"9+ c #8E8D8D",
"0+ c #807F7F",
"a+ c #494848",
"b+ c #5A5758",
"c+ c #605E5F",
"d+ c #646262",
"e+ c #555354",
"f+ c #1F1F1F",
"g+ c #282626",
"h+ c #323031",
"i+ c #3D3C3C",
"j+ c #494748",
"k+ c #555353",
"l+ c #5A5959",
"m+ c #3E3D3D",
"n+ c #434242",
"o+ c #444343",
"p+ c #414041",
"q+ c #3E3E3E",
"r+ c #4A4949",
"s+ c #706D6E",
"t+ c #6B6969",
"u+ c #6A6869",
"v+ c #696469",
"w+ c #656065",
"x+ c #595757",
"y+ c #A5A5A5",
"z+ c #767676",
"A+ c #8A8888",
"B+ c #4B4849",
"C+ c #5C5A5A",
"D+ c #686565",
"E+ c #524F50",
"F+ c #000000",
"G+ c #090607",
"H+ c #171415",
"I+ c #262324",
"J+ c #363334",
"K+ c #454343",
"L+ c #4A4748",
"M+ c #212020",
"N+ c #2A292A",
"O+ c #2C2B2B",
"P+ c #272626",
"Q+ c #242424",
"R+ c #242323",
"S+ c #3C3B3B",
"T+ c #726F70",
"U+ c #6C696A",
"V+ c #6B676A",
"W+ c #7A916C",
"X+ c #7B926B",
"Y+ c #605F60",
"Z+ c #9C9B9C",
"`+ c #606060",
" @ c #8F8D8D",
".@ c #494747",
"+@ c #595657",
"@@ c #615E5F",
"#@ c #656162",
"$@ c #525050",
"%@ c #020101",
"&@ c #0C0A0A",
"*@ c #1A1818",
"=@ c #282525",
"-@ c #454243",
";@ c #494647",
">@ c #2A2929",
",@ c #393838",
"'@ c #363536",
")@ c #323131",
"!@ c #2B292A",
"~@ c #282727",
"{@ c #444243",
"]@ c #696666",
"^@ c #666268",
"/@ c #709D48",
"(@ c #7BAD4A",
"_@ c #68686A",
":@ c #8F8E8F",
"<@ c #4E4D4E",
"[@ c #8E8C8D",
"}@ c #484546",
"|@ c #555253",
"1@ c #5D595A",
"2@ c #5F5B5C",
"3@ c #514F50",
"4@ c #0F0D0D",
"5@ c #211E1F",
"6@ c #312E2F",
"7@ c #413D3E",
"8@ c #222121",
"9@ c #2E2D2D",
"0@ c #312F30",
"a@ c #262425",
"b@ c #464344",
"c@ c #696667",
"d@ c #666263",
"e@ c #5F5E5F",
"f@ c #5A5B5B",
"g@ c #797577",
"h@ c #7A7A7A",
"i@ c #4C4A4A",
"j@ c #2A2728",
"k@ c #2C292A",
"l@ c #302D2E",
"m@ c #312F2F",
"n@ c #2E2C2C",
"o@ c #100F0F",
"p@ c #110F10",
"q@ c #141212",
"r@ c #1B1919",
"s@ c #242222",
"t@ c #2D2B2B",
"u@ c #322F30",
"v@ c #2F2D2D",
"w@ c #2B2829",
"x@ c #292728",
"y@ c #363233",
"z@ c #332F30",
"A@ c #312D2F",
"B@ c #2A2627",
"C@ c #424040",
"D@ c #454444",
"E@ c #737373",
"F@ c #828282",
"G@ c #939293",
"H@ c #9C9C9C",
"I@ c #A3A3A3",
"J@ c #A9A9A9",
"K@ c #ADADAD",
"L@ c #B2B2B2",
"M@ c #B5B5B5",
"N@ c #A4A4A4",
"O@ c #959595",
"P@ c #8C8C8C",
"Q@ c #707070",
"R@ c #FFFFFF",
" ",
" . + @ # $ % & * = - ; > * - - - * , ' ) ! ~ ",
" = { ' ] ^ { / / ( _ : < [ ^ ^ } ^ | 1 2 } 3 ",
" - 4 ' ' 5 6 6 6 7 7 8 9 ! ! 9 9 0 0 $ 5 a b c ",
" d 4 [ * e - - f g h h h i i j + 5 5 k l m n o p ",
" q _ r @ > > s s t % % * * u v - w 5 x y z A B C ",
" D 1 7 l E F @ @ G H H I > > > J * K L M N O P Q ",
" R S % T U U l V W E X F @ @ > E Y Z ` > .* ..+. ",
" @.#.$.W %.# # # &.l l V E G T *.=.-.*.5 ;.>.,.Z ",
" n '.).[ !.T ~.# ..{.U l ].x Y ^.>.A /.(.x ;.O _. ",
" :.^.<.h a %.%.# # # &.U [.}.|.1.2.3.4.K K a 5.N ",
" 6.i H 7.%.8.# &.# l * % E 9.[.5.0.[.;.a.b.;., %.c. ",
" d.> 0 a # &.e.V V % ^ f.j g - % %.....&.l V l g.h.i. ",
" j./ i # E E @ k.H l.g.%.# l E H <.b.; > % % % m.n.o. ",
" p.q.7 @ ) > % % - r.) > % * * g f s.5 t.i i i u.v.w. ",
" x.y.z.> u - g A.- B.C.D.E.! 0 7 (.6.$ ' ' F.G.).^ H. ",
" I.7 J.K.L.7 7 ! ! m.S 1 m.- %.3.8./ ).M./ | _ : N.; ",
" O., F.f.P.4 4 4 f.f.r / Q.4 4 ^ R.: : 1 [ S.< S T.U. ",
" 4 V.| ).| _ W._ X.^ : Y.1 S.Z.z.] S S `.#.C.C.2 V.q. + ",
" S..+++@+`.#+$+%+&+*+2 #+=+q.y.-+-+-+;+$+$+*+>+++Z.*+,+ ",
" '+S.# $ >+r.m.e.# 6 )+!+~+*+@+B.=+{+-+]+]+^+]+^+j 5 y./+ ",
" (+b.3 _+! m.#+:+q.r > <+[+}+|+3 '.b.8.> e 5 7 ! ^+j 1+2+ ",
" x.] ! r / ^ W.R.S 3+2 y.@+4+5+6+^+~+*+;+7+#+C.#.S.8+: V ",
" 9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+n+p+q+r+s+t+u+v+w+x+y+ ",
" z+A+B+C+d+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+ ",
" `+ @.@+@@@#@$@%@&@*@=@J+-@;@>@,@'@)@!@~@{@c ]@^@/@(@_@:@ ",
" <@[@}@|@1@2@3@F+%@4@5@6@7@-@8@9@9@0@~@a@b@c@#@d@e@f@g@h@ ",
" i@j@k@l@m@n@o@p@q@r@s@t@u@!@l@v@v@w@x@l@y@z@6@A@B@C@D@ ",
" E@F@G@H@I@J@K@}+L@M@M@M@s.}+|+N@H@O@P@F@Q@ ",
" R@R@R@R@R@R@R@R@R@ ",
" ",
" "};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

-2
View File
@@ -1,2 +0,0 @@
EXTRA_DIST = distribution.txt.in gsmartcontrol.nsi.in nsi_install.ico nsi_uninstall.ico
-32
View File
@@ -1,32 +0,0 @@
GSmartControl - Hard disk drive health inspection tool
Version @VERSION@
The latest version of this distribution, as well as the source code of
GSmartControl, can be found at
http://gsmartcontrol.berlios.de
and
http://developer.berlios.de/project/showfiles.php?group_id=10075
You need GTK+ for Windows Runtime package to use this program. You can get one
at http://gtk-win.sf.net (you must download at least version 2.14.4-2008-11-11
of gtk2-runtime).
This distribution includes:
* GSmartControl binary (gsmartcontrol.exe) and associated resources. The
binary was compiled for 32-bit Windows, and should work on both 32-bit and
64-bit Windows.
* Gtkmm (http://www.gtkmm.org/) dlls.
* PCRE (http://www.pcre.org/) dll.
* Smartctl binaries (from smartmontools 5.38, http://smartmontools.sf.net/) -
smartctl-nc.exe (compiled without console output), smartctl.exe (compiled with
console output).
The combined distribution is multi-licensed under GNU GPL versions 2 and 3.
See LICENSE_gpl2.txt and LICENSE_gpl3.txt for details.
-293
View File
@@ -1,293 +0,0 @@
; NSIS2 Script
; Compatible with NSIS 2.40
!define PRODUCT_VERSION "@VERSION@"
!define PRODUCT_NAME "GSmartControl"
!define PRODUCT_NAME_SMALL "gsmartcontrol"
!define PRODUCT_PUBLISHER "Alexander Shaduri"
!define PRODUCT_WEB_SITE "http://gsmartcontrol.berlios.de"
;!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\AppMainExe.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define REGISTRY_APP_PATHS "Software\Microsoft\Windows\CurrentVersion\App Paths"
; --------------- General Settings
; This compressor gives us the best results
SetCompressor /SOLID lzma
; Do a CRC check before installing
CRCCheck On
; This is used in titles
Name "${PRODUCT_NAME}" ; ${PRODUCT_VERSION}
; Output File Name
OutFile "${PRODUCT_NAME_SMALL}-${PRODUCT_VERSION}.exe"
;The Default Installation Directory
; try to install to the same directory as runtime.
InstallDir "$PROGRAMFILES\${PRODUCT_NAME_SMALL}"
; If already installed, try here
InstallDirRegKey HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory"
ShowInstDetails show
ShowUnInstDetails show
; --------------------- MUI INTERFACE
; MUI 2.0 compatible install
!include "MUI2.nsh"
;Backgound Colors. uncomment to enable fullscreen.
; BGGradient 0000FF 000000 FFFFFF
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "nsi_install.ico"
!define MUI_UNICON "nsi_uninstall.ico"
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression
!insertmacro MUI_RESERVEFILE_LANGDLL
;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
; Pages to show during installation
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "doc\distribution.txt"
;!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
;!define MUI_FINISHPAGE_RUN "$INSTDIR\gsmartcontrol.exe"
;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Example.file"
;!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!insertmacro MUI_PAGE_FINISH
; Uninstaller page
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; --------------- END MUI
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "GSmartControl"
; --------------- START INSTALLATION
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
Push 2 ;F ;22 = number of languages, F = change font
;Language selection
LangDLL::LangDialog "Installer Language" "Please select a language."
Pop $LANGUAGE
StrCmp $LANGUAGE "cancel" 0 +2
Abort
; detect previous installation
ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
StrCmp $R0 "" no_prev
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PRODUCT_NAME} is already installed. $\n$\nClick 'OK' to remove the \
previous version or 'Cancel' to continue anyway." \
IDOK uninst_product
; Abort
goto no_prev ; if cancel was pressed, continue as if no old installation.
;Run the uninstaller
uninst_product:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
IfErrors cannot_uninst_product
;You can either use Delete /REBOOTOK in the uninstaller or add some code
;here to remove the uninstaller. Use a registry key to check
;whether the user has chosen to uninstall. If you are using an uninstaller
;components page, make sure all sections are uninstalled.
cannot_uninst_product:
no_prev: ; no old installation found, all ok
; detect GTK installation (any of available versions)
ReadRegStr $R0 HKLM "SOFTWARE\GTK\2.0" "DllPath"
StrCmp $R0 "" no_gtk
goto have_gtk
no_gtk:
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"GTK2-Runtime is not installed. This product needs it to function properly.$\n\
Please install GTK2-Runtime from http://gtk-win.sf.net/ first.$\n$\n\
Click 'Cancel' to abort the installation \
or 'OK' to continue anyway." \
IDOK have_gtk
Abort
have_gtk:
; do nothing
FunctionEnd
; ----------------- INSTALLATION TYPES
; InstType "Recommended"
InstType "Full"
;InstType "Minimal"
Section "Main" SecMain
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite Off ; don't overwrite the config file
; File "gsmartcontrol.conf"
SetOverwrite On
File gsmartcontrol.exe
File gsmartcontrol.ico
File icon_*.png
File *.dll
File smartctl-nc.exe
File smartctl.exe
File /r doc
; set a special path for this exe, as GTK may not be in a global path.
ReadRegStr $R3 HKLM "SOFTWARE\GTK\2.0" "DllPath"
WriteRegStr HKLM "${REGISTRY_APP_PATHS}\gsmartcontrol.exe" "Path" "$R3"
;Add Shortcuts
CreateShortCut "$SMPROGRAMS\GSmartControl.lnk" "$INSTDIR\gsmartcontrol.exe" "" "$INSTDIR\gsmartcontrol.ico" 0
SectionEnd
; ------------------ POST INSTALL
!define TEMP $R0
Section -post
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory" "$INSTDIR"
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "Vendor" "Alexander Shaduri"
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\gsmartcontrol_uninst.exe"
; We don't need this, MUI takes care for us
WriteRegStr HKCU "Software\${PRODUCT_NAME}" "Installer Language" $LANGUAGE
; uninstall shortcut
; CreateDirectory "$SMPROGRAMS\GSmartControl"
; CreateShortCut "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk" "$INSTDIR\gsmartcontrol_uninst.exe" "" ""
; write out uninstaller
WriteUninstaller "$INSTDIR\gsmartcontrol_uninst.exe"
SectionEnd ; post
; ---------------- UNINSTALL
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Section Uninstall
SetAutoClose false
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\gsmartcontrol_uninst.exe"
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
Delete "$INSTDIR\gsmartcontrol.exe"
Delete "$INSTDIR\gsmartcontrol.ico"
Delete "$INSTDIR\icon_*.png"
Delete "$INSTDIR\*.dll"
Delete "$INSTDIR\smartctl-nc.exe"
Delete "$INSTDIR\smartctl.exe"
RMDir /r "$INSTDIR\doc"
RMDir "$INSTDIR" ; only if empty
DeleteRegKey HKLM "${REGISTRY_APP_PATHS}\gsmartcontrol.exe"
Delete "$SMPROGRAMS\GSmartControl.lnk"
; Delete "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk"
SectionEnd ; end of uninstall section
; eof
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<!--
License: BSD Zero Clause License file
Copyright:
(C) 2008 - 2021 GSmartControl developers
-->
<policyconfig>
<action id="org.gsmartcontrol">
<message>Authentication is required to run GSmartControl</message>
<icon_name>gsmartcontrol</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">@CMAKE_INSTALL_FULL_SBINDIR@/gsmartcontrol</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
-6
View File
@@ -1,6 +0,0 @@
noinst_DATA = changelog.in compat control copyright menu postinst postrm rules
# include the generated file too
EXTRA_DIST=changelog.in changelog compat control copyright menu postinst \
postrm rules
-5
View File
@@ -1,5 +0,0 @@
gsmartcontrol (@VERSION@+nmu1) unstable; urgency=low
* Permanently Initial Release.
-- Alexander Shaduri <ashaduriREMOVETHIS@gmail.com> Sat, 15 Nov 2008 00:12:04 +0400
-21
View File
@@ -1,21 +0,0 @@
Source: gsmartcontrol
Section: utils
Priority: extra
Homepage: http://gsmartcontrol.berlios.de/
Maintainer: Alexander Shaduri <ashaduriREMOVETHIS@gmail.com>
# technically, we don't need libglademm if gtkmm >= 2.12, but it won't get
# into Depends if it's not needed, so let's leave it here.
Build-Depends: debhelper (>= 5), autotools-dev,
libpcre3-dev, libgtkmm-2.4-dev (>= 2.6.0), libglademm-2.4-dev
Standards-Version: 3.7.3
Package: gsmartcontrol
Architecture: any
#Depends: ${shlibs:Depends}, ${misc:Depends}, smartmontools
Depends: ${shlibs:Depends}, smartmontools
Description: Hard disk drive health inspection tool
GSmartControl is a graphical user interface for smartctl (from smartmontools
package), which is a tool for querying and controlling SMART
(Self-Monitoring, Analysis, and Reporting Technology) data on modern hard
disk drives. It allows you to inspect the drive's SMART data to determine its
health, as well as run various tests on it.
-32
View File
@@ -1,32 +0,0 @@
This package was debianized by Alexander Shaduri <ashaduri 'at' gmail.com> on
Sat, 15 Nov 2008 00:12:04 +0400.
It was downloaded from <http://gsmartcontrol.berlios.de/>
Copyright:
Copyright (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
License:
This product is multi-licensed under GNU GPL versions 2 and 3.
You are free to choose which one you use.
This program is free software: you can redistribute it and/or modify it under
the terms of either version 2 or (at your option) version 3 of the GNU General
Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public Licenses for more details.
You should have received copies of these licenses along with this program.
If not, see <http://www.gnu.org/licenses/>.
On Debian systems, the complete text of the GNU General
Public Licenses can be found in `/usr/share/common-licenses/GPL-2' and
`/usr/share/common-licenses/GPL-3'.
The Debian packaging is (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com> and
is licensed under the GPLv2 and GPLv3, see above.
-4
View File
@@ -1,4 +0,0 @@
?package(gsmartcontrol):needs="X11" section="Applications/System/Hardware"\
title="GSmartControl" command="/usr/bin/gsmartcontrol-root"\
longtitle="Hard Disk Health Inspection"\
icon="/usr/share/pixmaps/gsmartcontrol.xpm"
-102
View File
@@ -1,102 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
config.status: configure
dh_testdir
# Add here commands to configure the package.
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
./configure --host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
# Add --enable-optimize-options=auto to configure line
# for optimized build (may not work on older gcc versions).
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/gsmartcontrol.sgml > gsmartcontrol.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/gsmartcontrol.
$(MAKE) DESTDIR=$(CURDIR)/debian/gsmartcontrol install-strip
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
# dh_installexamples
# dh_install
dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
+84
View File
@@ -0,0 +1,84 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 - 2022 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
# Disable all warnings
if (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang
OR ${CMAKE_CXX_COMPILER_ID} STREQUAL GNU
OR ${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
add_compile_options(-w)
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
add_compile_options(/w)
endif()
find_package(PkgConfig REQUIRED) # pkg_check_modules()
# Gtkmm.
# Don't make it REQUIRED, we may want to build only the parsers.
pkg_check_modules(Gtkmm IMPORTED_TARGET GLOBAL "gtkmm-3.0>=3.0")
add_library(app_gtkmm_interface INTERFACE)
target_link_libraries(app_gtkmm_interface
INTERFACE
PkgConfig::Gtkmm
)
target_compile_definitions(app_gtkmm_interface
INTERFACE
ENABLE_GLIB=1
ENABLE_GLIBMM=1
# For porting to GTK4
GTK_DISABLE_DEPRECATED=1
GDK_DISABLE_DEPRECATED=1
GTKMM_DISABLE_DEPRECATED=1
GDKMM_DISABLE_DEPRECATED=1
GLIBMM_DISABLE_DEPRECATED=1
GIOMM_DISABLE_DEPRECATED=1
)
# Don't forget to set the following environment variable to catch deprecated properties and signals at runtime:
#G_ENABLE_DIAGNOSTIC=1
# Support pre-C++17 glibmm with throw(...) exception specifications
pkg_check_modules(Glibmm "glibmm-2.4")
if ("${Glibmm_VERSION}" VERSION_LESS "2.50.1")
target_compile_definitions(app_gtkmm_interface INTERFACE "APP_GLIBMM_USES_THROW")
message(STATUS "Enabling old glibmm throw(...) workaround")
endif()
# pcrecpp from pcre1
pkg_check_modules(Pcrecpp REQUIRED IMPORTED_TARGET GLOBAL libpcrecpp)
add_library(app_pcrecpp_interface INTERFACE)
target_link_libraries(app_pcrecpp_interface
INTERFACE
PkgConfig::Pcrecpp
)
# Gettext libintl
find_package(Intl REQUIRED)
add_library(app_gettext_interface INTERFACE)
if (Intl_INCLUDE_DIRS)
target_include_directories(app_gettext_interface
INTERFACE
${Intl_INCLUDE_DIRS}
)
endif()
if (Intl_LIBRARIES)
target_link_libraries(app_gettext_interface
INTERFACE
${Intl_LIBRARIES}
)
endif()
# Gettext binaries and macros.
# See https://cmake.org/cmake/help/v3.15/module/FindGettext.html
find_package(Gettext REQUIRED)
add_subdirectory(catch2)
add_subdirectory(nlohmann_json)
add_subdirectory(whereami)
+11
View File
@@ -0,0 +1,11 @@
###############################################################################
# License: BSD Zero Clause License file
# Copyright:
# (C) 2021 Alexander Shaduri <ashaduri@gmail.com>
###############################################################################
#set(CATCH_INSTALL_DOCS OFF CACHE INTERNAL "")
#set(CATCH_INSTALL_EXTRAS OFF CACHE INTERNAL "")
#set(CATCH_DEVELOPMENT_BUILD OFF CACHE INTERNAL "")
add_subdirectory(Catch2)
+25
View File
@@ -0,0 +1,25 @@
---
AccessModifierOffset: '-4'
AlignEscapedNewlines: Left
AllowAllConstructorInitializersOnNextLine: 'true'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakConstructorInitializers: AfterColon
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: 'false'
IndentPPDirectives: AfterHash
IndentWidth: '4'
Language: Cpp
NamespaceIndentation: All
PointerAlignment: Left
SpaceBeforeCtorInitializerColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesInParentheses: 'true'
Standard: Cpp11
TabWidth: '4'
UseTab: Never
...
+22
View File
@@ -0,0 +1,22 @@
# This sets the default behaviour, overriding core.autocrlf
* text=auto
# All source files should have unix line-endings in the repository,
# but convert to native line-endings on checkout
*.cpp text
*.h text
*.hpp text
# Windows specific files should retain windows line-endings
*.sln text eol=crlf
# Keep executable scripts with LFs so they can be run after being
# checked out on Windows
*.py text eol=lf
# Keep the single include header with LFs to make sure it is uploaded,
# hashed etc with LF
single_include/**/*.hpp eol=lf
# Also keep the LICENCE file with LFs for the same reason
LICENCE.txt eol=lf
+33
View File
@@ -0,0 +1,33 @@
*.build
*.pbxuser
*.mode1v3
*.ncb
*.suo
Debug
Release
*.user
*.xcuserstate
.DS_Store
xcuserdata
CatchSelfTest.xcscheme
Breakpoints.xcbkptlist
projects/VS2010/TestCatch/_UpgradeReport_Files/
projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters
projects/VisualStudio/TestCatch/UpgradeLog.XML
projects/CMake/.idea
projects/CMake/cmake-build-debug
UpgradeLog.XML
Resources/DWARF
projects/Generated
*.pyc
DerivedData
*.xccheckout
Build
.idea
.vs
cmake-build-*
benchmark-dir
.conan/test_package/build
bazel-*
build-fuzzers
debug-build
+10
View File
@@ -0,0 +1,10 @@
@PACKAGE_INIT@
# Avoid repeatedly including the targets
if(NOT TARGET Catch2::Catch2)
# Provide path for scripts
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
include(${CMAKE_CURRENT_LIST_DIR}/Catch2Targets.cmake)
endif()
+157
View File
@@ -0,0 +1,157 @@
# This file is part of CMake-codecov.
#
# Copyright (c)
# 2015-2017 RWTH Aachen University, Federal Republic of Germany
#
# See the LICENSE file in the package base directory for details
#
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
#
# include required Modules
include(FindPackageHandleStandardArgs)
# Search for gcov binary.
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
foreach (LANG ${ENABLED_LANGUAGES})
# Gcov evaluation is dependent on the used compiler. Check gcov support for
# each compiler that is used. If gcov binary was already found for this
# compiler, do not try to find it again.
if (NOT GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN)
get_filename_component(COMPILER_PATH "${CMAKE_${LANG}_COMPILER}" PATH)
if ("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "GNU")
# Some distributions like OSX (homebrew) ship gcov with the compiler
# version appended as gcov-x. To find this binary we'll build the
# suggested binary name with the compiler version.
string(REGEX MATCH "^[0-9]+" GCC_VERSION
"${CMAKE_${LANG}_COMPILER_VERSION}")
find_program(GCOV_BIN NAMES gcov-${GCC_VERSION} gcov
HINTS ${COMPILER_PATH})
elseif ("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Clang")
# Some distributions like Debian ship llvm-cov with the compiler
# version appended as llvm-cov-x.y. To find this binary we'll build
# the suggested binary name with the compiler version.
string(REGEX MATCH "^[0-9]+.[0-9]+" LLVM_VERSION
"${CMAKE_${LANG}_COMPILER_VERSION}")
# llvm-cov prior version 3.5 seems to be not working with coverage
# evaluation tools, but these versions are compatible with the gcc
# gcov tool.
if(LLVM_VERSION VERSION_GREATER 3.4)
find_program(LLVM_COV_BIN NAMES "llvm-cov-${LLVM_VERSION}"
"llvm-cov" HINTS ${COMPILER_PATH})
mark_as_advanced(LLVM_COV_BIN)
if (LLVM_COV_BIN)
find_program(LLVM_COV_WRAPPER "llvm-cov-wrapper" PATHS
${CMAKE_MODULE_PATH})
if (LLVM_COV_WRAPPER)
set(GCOV_BIN "${LLVM_COV_WRAPPER}" CACHE FILEPATH "")
# set additional parameters
set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_ENV
"LLVM_COV_BIN=${LLVM_COV_BIN}" CACHE STRING
"Environment variables for llvm-cov-wrapper.")
mark_as_advanced(GCOV_${CMAKE_${LANG}_COMPILER_ID}_ENV)
endif ()
endif ()
endif ()
if (NOT GCOV_BIN)
# Fall back to gcov binary if llvm-cov was not found or is
# incompatible. This is the default on OSX, but may crash on
# recent Linux versions.
find_program(GCOV_BIN gcov HINTS ${COMPILER_PATH})
endif ()
endif ()
if (GCOV_BIN)
set(GCOV_${CMAKE_${LANG}_COMPILER_ID}_BIN "${GCOV_BIN}" CACHE STRING
"${LANG} gcov binary.")
if (NOT CMAKE_REQUIRED_QUIET)
message("-- Found gcov evaluation for "
"${CMAKE_${LANG}_COMPILER_ID}: ${GCOV_BIN}")
endif()
unset(GCOV_BIN CACHE)
endif ()
endif ()
endforeach ()
# Add a new global target for all gcov targets. This target could be used to
# generate the gcov files for the whole project instead of calling <TARGET>-gcov
# for each target.
if (NOT TARGET gcov)
add_custom_target(gcov)
endif (NOT TARGET gcov)
# This function will add gcov evaluation for target <TNAME>. Only sources of
# this target will be evaluated and no dependencies will be added. It will call
# Gcov on any source file of <TNAME> once and store the gcov file in the same
# directory.
function (add_gcov_target TNAME)
set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
# We don't have to check, if the target has support for coverage, thus this
# will be checked by add_coverage_target in Findcoverage.cmake. Instead we
# have to determine which gcov binary to use.
get_target_property(TSOURCES ${TNAME} SOURCES)
set(SOURCES "")
set(TCOMPILER "")
foreach (FILE ${TSOURCES})
codecov_path_of_source(${FILE} FILE)
if (NOT "${FILE}" STREQUAL "")
codecov_lang_of_source(${FILE} LANG)
if (NOT "${LANG}" STREQUAL "")
list(APPEND SOURCES "${FILE}")
set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
endif ()
endif ()
endforeach ()
# If no gcov binary was found, coverage data can't be evaluated.
if (NOT GCOV_${TCOMPILER}_BIN)
message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
return()
endif ()
set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
set(BUFFER "")
foreach(FILE ${SOURCES})
get_filename_component(FILE_PATH "${TDIR}/${FILE}" PATH)
# call gcov
add_custom_command(OUTPUT ${TDIR}/${FILE}.gcov
COMMAND ${GCOV_ENV} ${GCOV_BIN} ${TDIR}/${FILE}.gcno > /dev/null
DEPENDS ${TNAME} ${TDIR}/${FILE}.gcno
WORKING_DIRECTORY ${FILE_PATH}
)
list(APPEND BUFFER ${TDIR}/${FILE}.gcov)
endforeach()
# add target for gcov evaluation of <TNAME>
add_custom_target(${TNAME}-gcov DEPENDS ${BUFFER})
# add evaluation target to the global gcov target.
add_dependencies(gcov ${TNAME}-gcov)
endfunction (add_gcov_target)
+354
View File
@@ -0,0 +1,354 @@
# This file is part of CMake-codecov.
#
# Copyright (c)
# 2015-2017 RWTH Aachen University, Federal Republic of Germany
#
# See the LICENSE file in the package base directory for details
#
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
#
# configuration
set(LCOV_DATA_PATH "${CMAKE_BINARY_DIR}/lcov/data")
set(LCOV_DATA_PATH_INIT "${LCOV_DATA_PATH}/init")
set(LCOV_DATA_PATH_CAPTURE "${LCOV_DATA_PATH}/capture")
set(LCOV_HTML_PATH "${CMAKE_BINARY_DIR}/lcov/html")
# Search for Gcov which is used by Lcov.
find_package(Gcov)
# This function will add lcov evaluation for target <TNAME>. Only sources of
# this target will be evaluated and no dependencies will be added. It will call
# geninfo on any source file of <TNAME> once and store the info file in the same
# directory.
#
# Note: This function is only a wrapper to define this function always, even if
# coverage is not supported by the compiler or disabled. This function must
# be defined here, because the module will be exited, if there is no coverage
# support by the compiler or it is disabled by the user.
function (add_lcov_target TNAME)
if (LCOV_FOUND)
# capture initial coverage data
lcov_capture_initial_tgt(${TNAME})
# capture coverage data after execution
lcov_capture_tgt(${TNAME})
endif ()
endfunction (add_lcov_target)
# include required Modules
include(FindPackageHandleStandardArgs)
# Search for required lcov binaries.
find_program(LCOV_BIN lcov)
find_program(GENINFO_BIN geninfo)
find_program(GENHTML_BIN genhtml)
find_package_handle_standard_args(lcov
REQUIRED_VARS LCOV_BIN GENINFO_BIN GENHTML_BIN
)
# enable genhtml C++ demangeling, if c++filt is found.
set(GENHTML_CPPFILT_FLAG "")
find_program(CPPFILT_BIN c++filt)
if (NOT CPPFILT_BIN STREQUAL "")
set(GENHTML_CPPFILT_FLAG "--demangle-cpp")
endif (NOT CPPFILT_BIN STREQUAL "")
# enable no-external flag for lcov, if available.
if (GENINFO_BIN AND NOT DEFINED GENINFO_EXTERN_FLAG)
set(FLAG "")
execute_process(COMMAND ${GENINFO_BIN} --help OUTPUT_VARIABLE GENINFO_HELP)
string(REGEX MATCH "external" GENINFO_RES "${GENINFO_HELP}")
if (GENINFO_RES)
set(FLAG "--no-external")
endif ()
set(GENINFO_EXTERN_FLAG "${FLAG}"
CACHE STRING "Geninfo flag to exclude system sources.")
endif ()
# If Lcov was not found, exit module now.
if (NOT LCOV_FOUND)
return()
endif (NOT LCOV_FOUND)
# Create directories to be used.
file(MAKE_DIRECTORY ${LCOV_DATA_PATH_INIT})
file(MAKE_DIRECTORY ${LCOV_DATA_PATH_CAPTURE})
set(LCOV_REMOVE_PATTERNS "")
# This function will merge lcov files to a single target file. Additional lcov
# flags may be set with setting LCOV_EXTRA_FLAGS before calling this function.
function (lcov_merge_files OUTFILE ...)
# Remove ${OUTFILE} from ${ARGV} and generate lcov parameters with files.
list(REMOVE_AT ARGV 0)
# Generate merged file.
string(REPLACE "${CMAKE_BINARY_DIR}/" "" FILE_REL "${OUTFILE}")
add_custom_command(OUTPUT "${OUTFILE}.raw"
COMMAND cat ${ARGV} > ${OUTFILE}.raw
DEPENDS ${ARGV}
COMMENT "Generating ${FILE_REL}"
)
add_custom_command(OUTPUT "${OUTFILE}"
COMMAND ${LCOV_BIN} --quiet -a ${OUTFILE}.raw --output-file ${OUTFILE}
--base-directory ${PROJECT_SOURCE_DIR} ${LCOV_EXTRA_FLAGS}
COMMAND ${LCOV_BIN} --quiet -r ${OUTFILE} ${LCOV_REMOVE_PATTERNS}
--output-file ${OUTFILE} ${LCOV_EXTRA_FLAGS}
DEPENDS ${OUTFILE}.raw
COMMENT "Post-processing ${FILE_REL}"
)
endfunction ()
# Add a new global target to generate initial coverage reports for all targets.
# This target will be used to generate the global initial info file, which is
# used to gather even empty report data.
if (NOT TARGET lcov-capture-init)
add_custom_target(lcov-capture-init)
set(LCOV_CAPTURE_INIT_FILES "" CACHE INTERNAL "")
endif (NOT TARGET lcov-capture-init)
# This function will add initial capture of coverage data for target <TNAME>,
# which is needed to get also data for objects, which were not loaded at
# execution time. It will call geninfo for every source file of <TNAME> once and
# store the info file in the same directory.
function (lcov_capture_initial_tgt TNAME)
# We don't have to check, if the target has support for coverage, thus this
# will be checked by add_coverage_target in Findcoverage.cmake. Instead we
# have to determine which gcov binary to use.
get_target_property(TSOURCES ${TNAME} SOURCES)
set(SOURCES "")
set(TCOMPILER "")
foreach (FILE ${TSOURCES})
codecov_path_of_source(${FILE} FILE)
if (NOT "${FILE}" STREQUAL "")
codecov_lang_of_source(${FILE} LANG)
if (NOT "${LANG}" STREQUAL "")
list(APPEND SOURCES "${FILE}")
set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
endif ()
endif ()
endforeach ()
# If no gcov binary was found, coverage data can't be evaluated.
if (NOT GCOV_${TCOMPILER}_BIN)
message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
return()
endif ()
set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
set(GENINFO_FILES "")
foreach(FILE ${SOURCES})
# generate empty coverage files
set(OUTFILE "${TDIR}/${FILE}.info.init")
list(APPEND GENINFO_FILES ${OUTFILE})
add_custom_command(OUTPUT ${OUTFILE} COMMAND ${GCOV_ENV} ${GENINFO_BIN}
--quiet --base-directory ${PROJECT_SOURCE_DIR} --initial
--gcov-tool ${GCOV_BIN} --output-filename ${OUTFILE}
${GENINFO_EXTERN_FLAG} ${TDIR}/${FILE}.gcno
DEPENDS ${TNAME}
COMMENT "Capturing initial coverage data for ${FILE}"
)
endforeach()
# Concatenate all files generated by geninfo to a single file per target.
set(OUTFILE "${LCOV_DATA_PATH_INIT}/${TNAME}.info")
set(LCOV_EXTRA_FLAGS "--initial")
lcov_merge_files("${OUTFILE}" ${GENINFO_FILES})
add_custom_target(${TNAME}-capture-init ALL DEPENDS ${OUTFILE})
# add geninfo file generation to global lcov-geninfo target
add_dependencies(lcov-capture-init ${TNAME}-capture-init)
set(LCOV_CAPTURE_INIT_FILES "${LCOV_CAPTURE_INIT_FILES}"
"${OUTFILE}" CACHE INTERNAL ""
)
endfunction (lcov_capture_initial_tgt)
# This function will generate the global info file for all targets. It has to be
# called after all other CMake functions in the root CMakeLists.txt file, to get
# a full list of all targets that generate coverage data.
function (lcov_capture_initial)
# Skip this function (and do not create the following targets), if there are
# no input files.
if ("${LCOV_CAPTURE_INIT_FILES}" STREQUAL "")
return()
endif ()
# Add a new target to merge the files of all targets.
set(OUTFILE "${LCOV_DATA_PATH_INIT}/all_targets.info")
lcov_merge_files("${OUTFILE}" ${LCOV_CAPTURE_INIT_FILES})
add_custom_target(lcov-geninfo-init ALL DEPENDS ${OUTFILE}
lcov-capture-init
)
endfunction (lcov_capture_initial)
# Add a new global target to generate coverage reports for all targets. This
# target will be used to generate the global info file.
if (NOT TARGET lcov-capture)
add_custom_target(lcov-capture)
set(LCOV_CAPTURE_FILES "" CACHE INTERNAL "")
endif (NOT TARGET lcov-capture)
# This function will add capture of coverage data for target <TNAME>, which is
# needed to get also data for objects, which were not loaded at execution time.
# It will call geninfo for every source file of <TNAME> once and store the info
# file in the same directory.
function (lcov_capture_tgt TNAME)
# We don't have to check, if the target has support for coverage, thus this
# will be checked by add_coverage_target in Findcoverage.cmake. Instead we
# have to determine which gcov binary to use.
get_target_property(TSOURCES ${TNAME} SOURCES)
set(SOURCES "")
set(TCOMPILER "")
foreach (FILE ${TSOURCES})
codecov_path_of_source(${FILE} FILE)
if (NOT "${FILE}" STREQUAL "")
codecov_lang_of_source(${FILE} LANG)
if (NOT "${LANG}" STREQUAL "")
list(APPEND SOURCES "${FILE}")
set(TCOMPILER ${CMAKE_${LANG}_COMPILER_ID})
endif ()
endif ()
endforeach ()
# If no gcov binary was found, coverage data can't be evaluated.
if (NOT GCOV_${TCOMPILER}_BIN)
message(WARNING "No coverage evaluation binary found for ${TCOMPILER}.")
return()
endif ()
set(GCOV_BIN "${GCOV_${TCOMPILER}_BIN}")
set(GCOV_ENV "${GCOV_${TCOMPILER}_ENV}")
set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
set(GENINFO_FILES "")
foreach(FILE ${SOURCES})
# Generate coverage files. If no .gcda file was generated during
# execution, the empty coverage file will be used instead.
set(OUTFILE "${TDIR}/${FILE}.info")
list(APPEND GENINFO_FILES ${OUTFILE})
add_custom_command(OUTPUT ${OUTFILE}
COMMAND test -f "${TDIR}/${FILE}.gcda"
&& ${GCOV_ENV} ${GENINFO_BIN} --quiet --base-directory
${PROJECT_SOURCE_DIR} --gcov-tool ${GCOV_BIN}
--output-filename ${OUTFILE} ${GENINFO_EXTERN_FLAG}
${TDIR}/${FILE}.gcda
|| cp ${OUTFILE}.init ${OUTFILE}
DEPENDS ${TNAME} ${TNAME}-capture-init
COMMENT "Capturing coverage data for ${FILE}"
)
endforeach()
# Concatenate all files generated by geninfo to a single file per target.
set(OUTFILE "${LCOV_DATA_PATH_CAPTURE}/${TNAME}.info")
lcov_merge_files("${OUTFILE}" ${GENINFO_FILES})
add_custom_target(${TNAME}-geninfo DEPENDS ${OUTFILE})
# add geninfo file generation to global lcov-capture target
add_dependencies(lcov-capture ${TNAME}-geninfo)
set(LCOV_CAPTURE_FILES "${LCOV_CAPTURE_FILES}" "${OUTFILE}" CACHE INTERNAL
""
)
# Add target for generating html output for this target only.
file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/${TNAME})
add_custom_target(${TNAME}-genhtml
COMMAND ${GENHTML_BIN} --quiet --sort --prefix ${PROJECT_SOURCE_DIR}
--baseline-file ${LCOV_DATA_PATH_INIT}/${TNAME}.info
--output-directory ${LCOV_HTML_PATH}/${TNAME}
--title "${CMAKE_PROJECT_NAME} - target ${TNAME}"
${GENHTML_CPPFILT_FLAG} ${OUTFILE}
DEPENDS ${TNAME}-geninfo ${TNAME}-capture-init
)
endfunction (lcov_capture_tgt)
# This function will generate the global info file for all targets. It has to be
# called after all other CMake functions in the root CMakeLists.txt file, to get
# a full list of all targets that generate coverage data.
function (lcov_capture)
# Skip this function (and do not create the following targets), if there are
# no input files.
if ("${LCOV_CAPTURE_FILES}" STREQUAL "")
return()
endif ()
# Add a new target to merge the files of all targets.
set(OUTFILE "${LCOV_DATA_PATH_CAPTURE}/all_targets.info")
lcov_merge_files("${OUTFILE}" ${LCOV_CAPTURE_FILES})
add_custom_target(lcov-geninfo DEPENDS ${OUTFILE} lcov-capture)
# Add a new global target for all lcov targets. This target could be used to
# generate the lcov html output for the whole project instead of calling
# <TARGET>-geninfo and <TARGET>-genhtml for each target. It will also be
# used to generate a html site for all project data together instead of one
# for each target.
if (NOT TARGET lcov)
file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/all_targets)
add_custom_target(lcov
COMMAND ${GENHTML_BIN} --quiet --sort
--baseline-file ${LCOV_DATA_PATH_INIT}/all_targets.info
--output-directory ${LCOV_HTML_PATH}/all_targets
--title "${CMAKE_PROJECT_NAME}" --prefix "${PROJECT_SOURCE_DIR}"
${GENHTML_CPPFILT_FLAG} ${OUTFILE}
DEPENDS lcov-geninfo-init lcov-geninfo
)
endif ()
endfunction (lcov_capture)
# Add a new global target to generate the lcov html report for the whole project
# instead of calling <TARGET>-genhtml for each target (to create an own report
# for each target). Instead of the lcov target it does not require geninfo for
# all targets, so you have to call <TARGET>-geninfo to generate the info files
# the targets you'd like to have in your report or lcov-geninfo for generating
# info files for all targets before calling lcov-genhtml.
file(MAKE_DIRECTORY ${LCOV_HTML_PATH}/selected_targets)
if (NOT TARGET lcov-genhtml)
add_custom_target(lcov-genhtml
COMMAND ${GENHTML_BIN}
--quiet
--output-directory ${LCOV_HTML_PATH}/selected_targets
--title \"${CMAKE_PROJECT_NAME} - targets `find
${LCOV_DATA_PATH_CAPTURE} -name \"*.info\" ! -name
\"all_targets.info\" -exec basename {} .info \\\;`\"
--prefix ${PROJECT_SOURCE_DIR}
--sort
${GENHTML_CPPFILT_FLAG}
`find ${LCOV_DATA_PATH_CAPTURE} -name \"*.info\" ! -name
\"all_targets.info\"`
)
endif (NOT TARGET lcov-genhtml)
+258
View File
@@ -0,0 +1,258 @@
# This file is part of CMake-codecov.
#
# Copyright (c)
# 2015-2017 RWTH Aachen University, Federal Republic of Germany
#
# See the LICENSE file in the package base directory for details
#
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
#
# Add an option to choose, if coverage should be enabled or not. If enabled
# marked targets will be build with coverage support and appropriate targets
# will be added. If disabled coverage will be ignored for *ALL* targets.
option(ENABLE_COVERAGE "Enable coverage build." OFF)
set(COVERAGE_FLAG_CANDIDATES
# gcc and clang
"-O0 -g -fprofile-arcs -ftest-coverage"
# gcc and clang fallback
"-O0 -g --coverage"
)
# Add coverage support for target ${TNAME} and register target for coverage
# evaluation. If coverage is disabled or not supported, this function will
# simply do nothing.
#
# Note: This function is only a wrapper to define this function always, even if
# coverage is not supported by the compiler or disabled. This function must
# be defined here, because the module will be exited, if there is no coverage
# support by the compiler or it is disabled by the user.
function (add_coverage TNAME)
# only add coverage for target, if coverage is support and enabled.
if (ENABLE_COVERAGE)
foreach (TNAME ${ARGV})
add_coverage_target(${TNAME})
endforeach ()
endif ()
endfunction (add_coverage)
# Add global target to gather coverage information after all targets have been
# added. Other evaluation functions could be added here, after checks for the
# specific module have been passed.
#
# Note: This function is only a wrapper to define this function always, even if
# coverage is not supported by the compiler or disabled. This function must
# be defined here, because the module will be exited, if there is no coverage
# support by the compiler or it is disabled by the user.
function (coverage_evaluate)
# add lcov evaluation
if (LCOV_FOUND)
lcov_capture_initial()
lcov_capture()
endif (LCOV_FOUND)
endfunction ()
# Exit this module, if coverage is disabled. add_coverage is defined before this
# return, so this module can be exited now safely without breaking any build-
# scripts.
if (NOT ENABLE_COVERAGE)
return()
endif ()
# Find the reuired flags foreach language.
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
set(CMAKE_REQUIRED_QUIET ${codecov_FIND_QUIETLY})
get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
foreach (LANG ${ENABLED_LANGUAGES})
# Coverage flags are not dependent on language, but the used compiler. So
# instead of searching flags foreach language, search flags foreach compiler
# used.
set(COMPILER ${CMAKE_${LANG}_COMPILER_ID})
if (NOT COVERAGE_${COMPILER}_FLAGS)
foreach (FLAG ${COVERAGE_FLAG_CANDIDATES})
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Try ${COMPILER} code coverage flag = [${FLAG}]")
endif()
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(COVERAGE_FLAG_DETECTED CACHE)
if (${LANG} STREQUAL "C")
include(CheckCCompilerFlag)
check_c_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
elseif (${LANG} STREQUAL "CXX")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("${FLAG}" COVERAGE_FLAG_DETECTED)
elseif (${LANG} STREQUAL "Fortran")
# CheckFortranCompilerFlag was introduced in CMake 3.x. To be
# compatible with older Cmake versions, we will check if this
# module is present before we use it. Otherwise we will define
# Fortran coverage support as not available.
include(CheckFortranCompilerFlag OPTIONAL
RESULT_VARIABLE INCLUDED)
if (INCLUDED)
check_fortran_compiler_flag("${FLAG}"
COVERAGE_FLAG_DETECTED)
elseif (NOT CMAKE_REQUIRED_QUIET)
message("-- Performing Test COVERAGE_FLAG_DETECTED")
message("-- Performing Test COVERAGE_FLAG_DETECTED - Failed"
" (Check not supported)")
endif ()
endif()
if (COVERAGE_FLAG_DETECTED)
set(COVERAGE_${COMPILER}_FLAGS "${FLAG}"
CACHE STRING "${COMPILER} flags for code coverage.")
mark_as_advanced(COVERAGE_${COMPILER}_FLAGS)
break()
else ()
message(WARNING "Code coverage is not available for ${COMPILER}"
" compiler. Targets using this compiler will be "
"compiled without it.")
endif ()
endforeach ()
endif ()
endforeach ()
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
# Helper function to get the language of a source file.
function (codecov_lang_of_source FILE RETURN_VAR)
get_filename_component(FILE_EXT "${FILE}" EXT)
string(TOLOWER "${FILE_EXT}" FILE_EXT)
string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT)
get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
foreach (LANG ${ENABLED_LANGUAGES})
list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP)
if (NOT ${TEMP} EQUAL -1)
set(${RETURN_VAR} "${LANG}" PARENT_SCOPE)
return()
endif ()
endforeach()
set(${RETURN_VAR} "" PARENT_SCOPE)
endfunction ()
# Helper function to get the relative path of the source file destination path.
# This path is needed by FindGcov and FindLcov cmake files to locate the
# captured data.
function (codecov_path_of_source FILE RETURN_VAR)
string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _source ${FILE})
# If expression was found, SOURCEFILE is a generator-expression for an
# object library. Currently we found no way to call this function automatic
# for the referenced target, so it must be called in the directoryso of the
# object library definition.
if (NOT "${_source}" STREQUAL "")
set(${RETURN_VAR} "" PARENT_SCOPE)
return()
endif ()
string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" FILE "${FILE}")
if(IS_ABSOLUTE ${FILE})
file(RELATIVE_PATH FILE ${CMAKE_CURRENT_SOURCE_DIR} ${FILE})
endif()
# get the right path for file
string(REPLACE ".." "__" PATH "${FILE}")
set(${RETURN_VAR} "${PATH}" PARENT_SCOPE)
endfunction()
# Add coverage support for target ${TNAME} and register target for coverage
# evaluation.
function(add_coverage_target TNAME)
# Check if all sources for target use the same compiler. If a target uses
# e.g. C and Fortran mixed and uses different compilers (e.g. clang and
# gfortran) this can trigger huge problems, because different compilers may
# use different implementations for code coverage.
get_target_property(TSOURCES ${TNAME} SOURCES)
set(TARGET_COMPILER "")
set(ADDITIONAL_FILES "")
foreach (FILE ${TSOURCES})
# If expression was found, FILE is a generator-expression for an object
# library. Object libraries will be ignored.
string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE})
if ("${_file}" STREQUAL "")
codecov_lang_of_source(${FILE} LANG)
if (LANG)
list(APPEND TARGET_COMPILER ${CMAKE_${LANG}_COMPILER_ID})
list(APPEND ADDITIONAL_FILES "${FILE}.gcno")
list(APPEND ADDITIONAL_FILES "${FILE}.gcda")
endif ()
endif ()
endforeach ()
list(REMOVE_DUPLICATES TARGET_COMPILER)
list(LENGTH TARGET_COMPILER NUM_COMPILERS)
if (NUM_COMPILERS GREATER 1)
message(WARNING "Can't use code coverage for target ${TNAME}, because "
"it will be compiled by incompatible compilers. Target will be "
"compiled without code coverage.")
return()
elseif (NUM_COMPILERS EQUAL 0)
message(WARNING "Can't use code coverage for target ${TNAME}, because "
"it uses an unknown compiler. Target will be compiled without "
"code coverage.")
return()
elseif (NOT DEFINED "COVERAGE_${TARGET_COMPILER}_FLAGS")
# A warning has been printed before, so just return if flags for this
# compiler aren't available.
return()
endif()
# enable coverage for target
set_property(TARGET ${TNAME} APPEND_STRING
PROPERTY COMPILE_FLAGS " ${COVERAGE_${TARGET_COMPILER}_FLAGS}")
set_property(TARGET ${TNAME} APPEND_STRING
PROPERTY LINK_FLAGS " ${COVERAGE_${TARGET_COMPILER}_FLAGS}")
# Add gcov files generated by compiler to clean target.
set(CLEAN_FILES "")
foreach (FILE ${ADDITIONAL_FILES})
codecov_path_of_source(${FILE} FILE)
list(APPEND CLEAN_FILES "CMakeFiles/${TNAME}.dir/${FILE}")
endforeach()
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${CLEAN_FILES}")
add_gcov_target(${TNAME})
add_lcov_target(${TNAME})
endfunction(add_coverage_target)
# Include modules for parsing the collected data and output it in a readable
# format (like gcov and lcov).
find_package(Gcov)
find_package(Lcov)
+79
View File
@@ -0,0 +1,79 @@
include(CheckCXXCompilerFlag)
function(add_cxx_flag_if_supported_to_targets flagname targets)
check_cxx_compiler_flag("${flagname}" HAVE_FLAG_${flagname})
if (HAVE_FLAG_${flagname})
foreach(target ${targets})
target_compile_options(${target} PUBLIC ${flagname})
endforeach()
endif()
endfunction()
# Assumes that it is only called for development builds, where warnings
# and Werror is desired, so it also enables Werror.
function(add_warnings_to_targets targets)
LIST(LENGTH targets TARGETS_LEN)
# For now we just assume 2 possibilities: msvc and msvc-like compilers,
# and other.
if (MSVC)
foreach(target ${targets})
# Force MSVC to consider everything as encoded in utf-8
target_compile_options( ${target} PRIVATE /utf-8 )
# Enable Werror equivalent
if (CATCH_ENABLE_WERROR)
target_compile_options( ${target} PRIVATE /WX )
endif()
# MSVC is currently handled specially
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
STRING(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # override default warning level
target_compile_options( ${target} PRIVATE /w44265 /w44061 /w44062 /w45038 )
endif()
endforeach()
endif()
if (NOT MSVC)
set(CHECKED_WARNING_FLAGS
"-Wall"
"-Wextra"
"-Wpedantic"
"-Wweak-vtables"
"-Wunreachable-code"
"-Wmissing-declarations"
"-Wexit-time-destructors"
"-Wglobal-constructors"
"-Wmissing-noreturn"
"-Wparentheses"
"-Wextra-semi-stmt"
"-Wunreachable-code"
"-Wstrict-aliasing"
"-Wreturn-std-move"
"-Wmissing-braces"
"-Wdeprecated"
"-Wvla"
"-Wundef"
"-Wmisleading-indentation"
"-Wcatch-value"
"-Wabsolute-value"
"-Wreturn-std-move"
"-Wunused-parameter"
"-Wunused-function"
"-Wcall-to-pure-virtual-from-ctor-dtor"
"-Wdeprecated-register"
"-Wsuggest-override"
"-Wshadow"
"-Wold-style-cast"
)
foreach(warning ${CHECKED_WARNING_FLAGS})
add_cxx_flag_if_supported_to_targets(${warning} "${targets}")
endforeach()
if (CATCH_ENABLE_WERROR)
foreach(target ${targets})
# Enable Werror equivalent
target_compile_options( ${target} PRIVATE -Werror )
endforeach()
endif()
endif()
endfunction()
+10
View File
@@ -0,0 +1,10 @@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
pkg_version=@Catch2_VERSION@
Name: Catch2-With-Main
Description: A modern, C++-native test framework for C++14 and above (links in default main)
Version: ${pkg_version}
Requires: catch2 = ${pkg_version}
Cflags: -I${includedir}
Libs: -L${libdir} -lCatch2WithMain
+9
View File
@@ -0,0 +1,9 @@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
Name: Catch2
Description: A modern, C++-native, test framework for C++14 and above
URL: https://github.com/catchorg/Catch2
Version: @Catch2_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lCatch2
+56
View File
@@ -0,0 +1,56 @@
#!/bin/sh
# This file is part of CMake-codecov.
#
# Copyright (c)
# 2015-2017 RWTH Aachen University, Federal Republic of Germany
#
# See the LICENSE file in the package base directory for details
#
# Written by Alexander Haase, alexander.haase@rwth-aachen.de
#
if [ -z "$LLVM_COV_BIN" ]
then
echo "LLVM_COV_BIN not set!" >& 2
exit 1
fi
# Get LLVM version to find out.
LLVM_VERSION=$($LLVM_COV_BIN -version | grep -i "LLVM version" \
| sed "s/^\([A-Za-z ]*\)\([0-9]\).\([0-9]\).*$/\2.\3/g")
if [ "$1" = "-v" ]
then
echo "llvm-cov-wrapper $LLVM_VERSION"
exit 0
fi
if [ -n "$LLVM_VERSION" ]
then
MAJOR=$(echo $LLVM_VERSION | cut -d'.' -f1)
MINOR=$(echo $LLVM_VERSION | cut -d'.' -f2)
if [ $MAJOR -eq 3 ] && [ $MINOR -le 4 ]
then
if [ -f "$1" ]
then
filename=$(basename "$1")
extension="${filename##*.}"
case "$extension" in
"gcno") exec $LLVM_COV_BIN --gcno="$1" ;;
"gcda") exec $LLVM_COV_BIN --gcda="$1" ;;
esac
fi
fi
if [ $MAJOR -eq 3 ] && [ $MINOR -le 5 ]
then
exec $LLVM_COV_BIN $@
fi
fi
exec $LLVM_COV_BIN gcov $@
+208
View File
@@ -0,0 +1,208 @@
cmake_minimum_required(VERSION 3.5)
# detect if Catch is being bundled,
# disable testsuite in that case
if(NOT DEFINED PROJECT_NAME)
set(NOT_SUBPROJECT ON)
endif()
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
option(CATCH_INSTALL_EXTRAS "Install extras alongside library" ON)
option(CATCH_DEVELOPMENT_BUILD "Build tests, enable warnings, enable Werror, etc" OFF)
include(CMakeDependentOption)
cmake_dependent_option(CATCH_BUILD_TESTING "Build the SelfTest project" ON "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_BUILD_EXAMPLES "Build code examples" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_BUILD_EXTRA_TESTS "Build extra tests" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_BUILD_FUZZERS "Build fuzzers" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_ENABLE_COVERAGE "Generate coverage for codecov.io" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_ENABLE_WERROR "Enables Werror during build" ON "CATCH_DEVELOPMENT_BUILD" OFF)
cmake_dependent_option(CATCH_BUILD_SURROGATES "Enable generating and building surrogate TUs for the main headers" OFF "CATCH_DEVELOPMENT_BUILD" OFF)
# Catch2's build breaks if done in-tree. You probably should not build
# things in tree anyway, but we can allow projects that include Catch2
# as a subproject to build in-tree as long as it is not in our tree.
if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()
if(CMAKE_VERSION VERSION_GREATER 3.8)
# Enable IPO for CMake versions that support it
cmake_policy(SET CMP0069 NEW)
endif()
project(Catch2 LANGUAGES CXX VERSION 3.0.0)
# Provide path for scripts
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CTest)
# This variable is used in some subdirectories, so we need it here, rather
# than later in the install block
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
# We have some Windows builds that test `wmain` entry point,
# and we need this change to be present in all binaries that
# are built during these tests, so this is required here, before
# the subdirectories are added.
if(CATCH_TEST_USE_WMAIN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
endif()
# Basic paths
set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SOURCES_DIR ${CATCH_DIR}/src/catch2)
set(SELF_TEST_DIR ${CATCH_DIR}/tests/SelfTest)
set(BENCHMARK_DIR ${CATCH_DIR}/tests/Benchmark)
set(EXAMPLES_DIR ${CATCH_DIR}/examples)
# We need to bring-in the variables defined there to this scope
add_subdirectory(src)
# Build tests only if requested
if (BUILD_TESTING AND CATCH_BUILD_TESTING AND NOT_SUBPROJECT)
find_package(PythonInterp 3 REQUIRED)
if (NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python not found, but required for tests")
endif()
add_subdirectory(tests)
endif()
if(CATCH_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(CATCH_BUILD_EXTRA_TESTS)
add_subdirectory(tests/ExtraTests)
endif()
if(CATCH_BUILD_FUZZERS)
add_subdirectory(fuzzing)
endif()
if (CATCH_DEVELOPMENT_BUILD)
add_warnings_to_targets("${CATCH_WARNING_TARGETS}")
endif()
#option(CATCH_USE_VALGRIND "Perform SelfTests with Valgrind" OFF)
#option(CATCH_ENABLE_WERROR "Enable all warnings as errors" ON)
#
#set_property(GLOBAL PROPERTY USE_FOLDERS ON)
#
#
#
#
#
# Only perform the installation steps when Catch is not being used as
# a subproject via `add_subdirectory`, or the destinations will break,
# see https://github.com/catchorg/Catch2/issues/1373
if (NOT_SUBPROJECT)
configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/CMake/Catch2Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake
INSTALL_DESTINATION
${CATCH_CMAKE_CONFIG_DESTINATION}
)
## TODO: Catch2 main target?
## Install some cpp file as well?
# By default, FooConfigVersion is tied to architecture that it was
# generated on. Because Catch2 is header-only, it is arch-independent
# and thus Catch2ConfigVersion should not be tied to the architecture
# it was generated on.
#
# CMake does not provide a direct customization point for this in
# `write_basic_package_version_file`, but it can be accomplished
# indirectly by temporarily redefining `CMAKE_SIZEOF_VOID_P` to an
# empty string. Note that just undefining the variable could be
# insufficient in cases where the variable was already in CMake cache
set(CATCH2_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(CMAKE_SIZEOF_VOID_P "")
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
COMPATIBILITY
SameMajorVersion
)
set(CMAKE_SIZEOF_VOID_P ${CATCH2_CMAKE_SIZEOF_VOID_P})
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Catch2ConfigVersion.cmake"
DESTINATION
${CATCH_CMAKE_CONFIG_DESTINATION}
)
# Install documentation
if(CATCH_INSTALL_DOCS)
install(
DIRECTORY
docs/
DESTINATION
"${CMAKE_INSTALL_DOCDIR}"
)
endif()
if(CATCH_INSTALL_EXTRAS)
# Install CMake scripts
install(
FILES
"extras/ParseAndAddCatchTests.cmake"
"extras/Catch.cmake"
"extras/CatchAddTests.cmake"
DESTINATION
${CATCH_CMAKE_CONFIG_DESTINATION}
)
# Install debugger helpers
install(
FILES
"extras/gdbinit"
"extras/lldbinit"
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/Catch2
)
endif()
## Provide some pkg-config integration
set(PKGCONFIG_INSTALL_DIR
"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
CACHE PATH "Path where catch2.pc is installed"
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2.pc.in
${CMAKE_CURRENT_BINARY_DIR}/catch2.pc
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2-with-main.pc.in
${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc
@ONLY
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
"${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc"
DESTINATION
${PKGCONFIG_INSTALL_DIR}
)
# CPack/CMake started taking the package version from project version 3.12
# So we need to set the version manually for older CMake versions
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
endif()
set(CPACK_PACKAGE_CONTACT "https://github.com/catchorg/Catch2/")
include( CPack )
endif(NOT_SUBPROJECT)
+49
View File
@@ -0,0 +1,49 @@
<a id="top"></a>
![Catch2 logo](data/artwork/catch2-logo-small.png)
[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=devel)](https://travis-ci.org/catchorg/Catch2)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true&branch=devel)](https://ci.appveyor.com/project/catchorg/catch2)
[![Code Coverage](https://codecov.io/gh/catchorg/Catch2/branch/devel/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://godbolt.org/z/9x9qoM)
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
## Catch2 v3 is being developed!
You are on the `devel` branch, where the next major version, v3, of
Catch2 is being developed. As it is a significant rework, you will
find that parts of this documentation are likely still stuck on v2.
For stable (and documentation-matching) version of Catch2, [go to the
`v2.x` branch](https://github.com/catchorg/Catch2/tree/v2.x).
For migrating from the v2 releases to v3, you should look at [our
documentation](docs/migrate-v2-to-v3.md#top). It provides a simple
guidelines on getting started, and collects most common migration
problems.
## What's the Catch2?
Catch2 is mainly a unit testing framework for C++, but it also
provides basic micro-benchmarking features, and simple BDD macros.
Catch2's main advantage is that using it is both simple and natural.
Tests autoregister themselves and do not have to be named with valid
identifiers, assertions look like normal C++ code, and sections provide
a nice way to share set-up and tear-down code in tests.
## How to use it
This documentation comprises these three parts:
* [Why do we need yet another C++ Test Framework?](docs/why-catch.md#top)
* [Tutorial](docs/tutorial.md#top) - getting started
* [Reference section](docs/Readme.md#top) - all the details
## More
* Issues and bugs can be raised on the [Issue tracker on GitHub](https://github.com/catchorg/Catch2/issues)
* For discussion or questions please use [the dedicated Google Groups forum](https://groups.google.com/forum/?fromgroups#!forum/catch-forum) or our [Discord](https://discord.gg/4CWS9zD)
* See [who else is using Catch2](docs/opensource-users.md#top)
+205
View File
@@ -0,0 +1,205 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
Catch
-----
This module defines a function to help use the Catch test framework.
The :command:`catch_discover_tests` discovers tests by asking the compiled test
executable to enumerate its tests. This does not require CMake to be re-run
when tests change. However, it may not work in a cross-compiling environment,
and setting test properties is less convenient.
This command is intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Catch test case. Note
that this is in some cases less efficient, as common set-up and tear-down logic
cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: catch_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
catch_discover_tests(target
[TEST_SPEC arg1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[PROPERTIES name1 value1...]
[TEST_LIST var]
[REPORTER reporter]
[OUTPUT_DIR dir]
[OUTPUT_PREFIX prefix}
[OUTPUT_SUFFIX suffix]
)
``catch_discover_tests`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--list-test-names-only`` argument. This ensures that the full
list of tests is obtained. Since test discovery occurs at build time, it is
not necessary to re-run CMake when the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Catch executable, which must be a known CMake executable
target. CMake will substitute the location of the built executable when
running the test.
``TEST_SPEC arg1...``
Specifies test cases, wildcarded test cases, tags and tag expressions to
pass to the Catch executable with the ``--list-test-names-only`` argument.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``catch_discover_tests()`` but with different
``TEST_SPEC`` or ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``catch_discover_tests``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``catch_discover_tests()``.
Note that this variable is only available in CTest.
``REPORTER reporter``
Use the specified reporter when running the test case. The reporter will
be passed to the Catch executable as ``--reporter reporter``.
``OUTPUT_DIR dir``
If specified, the parameter is passed along as
``--out dir/<test_name>`` to Catch executable. The actual file name is the
same as the test name. This should be used instead of
``EXTRA_ARGS --out foo`` to avoid race conditions writing the result output
when using parallel test execution.
``OUTPUT_PREFIX prefix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``prefix`` is added to each output file name, like so
``--out dir/prefix<test_name>``.
``OUTPUT_SUFFIX suffix``
May be used in conjunction with ``OUTPUT_DIR``.
If specified, ``suffix`` is added to each output file name, like so
``--out dir/<test_name>suffix``. This can be used to add a file extension to
the output e.g. ".xml".
#]=======================================================================]
#------------------------------------------------------------------------------
function(catch_discover_tests TARGET)
cmake_parse_arguments(
""
""
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX"
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
${ARGN}
)
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
## Generate a unique name based on the extra arguments
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS} ${_REPORTER} ${_OUTPUT_DIR} ${_OUTPUT_PREFIX} ${_OUTPUT_SUFFIX}")
string(SUBSTRING ${args_hash} 0 7 args_hash)
# Define rule to generate test list for aforementioned test executable
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
get_property(crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
add_custom_command(
TARGET ${TARGET} POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_SPEC=${_TEST_SPEC}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
-D "TEST_LIST=${_TEST_LIST}"
-D "TEST_REPORTER=${_REPORTER}"
-D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}"
-D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}"
-D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}"
-D "CTEST_FILE=${ctest_tests_file}"
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
VERBATIM
)
file(WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n"
" include(\"${ctest_tests_file}\")\n"
"else()\n"
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
"endif()\n"
)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
)
else()
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
if (NOT ${test_include_file_set})
set_property(DIRECTORY
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
)
else()
message(FATAL_ERROR
"Cannot set more than one TEST_INCLUDE_FILE"
)
endif()
endif()
endfunction()
###############################################################################
set(_CATCH_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
)
+123
View File
@@ -0,0 +1,123 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(spec ${TEST_SPEC})
set(extra_args ${TEST_EXTRA_ARGS})
set(properties ${TEST_PROPERTIES})
set(reporter ${TEST_REPORTER})
set(output_dir ${TEST_OUTPUT_DIR})
set(output_prefix ${TEST_OUTPUT_PREFIX})
set(output_suffix ${TEST_OUTPUT_SUFFIX})
set(script)
set(suite)
set(tests)
function(add_command NAME)
set(_args "")
foreach(_arg ${ARGN})
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
else()
set(_args "${_args} ${_arg}")
endif()
endforeach()
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
)
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-tests --verbosity quiet
OUTPUT_VARIABLE output
RESULT_VARIABLE result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
if(NOT ${result} EQUAL 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${result}\n"
" Output: ${output}\n"
)
endif()
string(REPLACE "\n" ";" output "${output}")
# Run test executable to get list of available reporters
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-reporters
OUTPUT_VARIABLE reporters_output
RESULT_VARIABLE reporters_result
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
)
if(NOT ${reporters_result} EQUAL 0)
message(FATAL_ERROR
"Error running test executable '${TEST_EXECUTABLE}':\n"
" Result: ${reporters_result}\n"
" Output: ${reporters_output}\n"
)
endif()
string(FIND "${reporters_output}" "${reporter}" reporter_is_valid)
if(reporter AND ${reporter_is_valid} EQUAL -1)
message(FATAL_ERROR
"\"${reporter}\" is not a valid reporter!\n"
)
endif()
# Prepare reporter
if(reporter)
set(reporter_arg "--reporter ${reporter}")
endif()
# Prepare output dir
if(output_dir AND NOT IS_ABSOLUTE ${output_dir})
set(output_dir "${TEST_WORKING_DIR}/${output_dir}")
if(NOT EXISTS ${output_dir})
file(MAKE_DIRECTORY ${output_dir})
endif()
endif()
# Parse output
foreach(line ${output})
set(test ${line})
# Escape characters in test case names that would be parsed by Catch2
set(test_name ${test})
foreach(char , [ ])
string(REPLACE ${char} "\\${char}" test_name ${test_name})
endforeach(char)
# ...add output dir
if(output_dir)
string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean ${test_name})
set(output_dir_arg "--out ${output_dir}/${output_prefix}${test_name_clean}${output_suffix}")
endif()
# ...and add to script
add_command(add_test
"${prefix}${test}${suffix}"
${TEST_EXECUTOR}
"${TEST_EXECUTABLE}"
"${test_name}"
${extra_args}
"${reporter_arg}"
"${output_dir_arg}"
)
add_command(set_tests_properties
"${prefix}${test}${suffix}"
PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
)
list(APPEND tests "${prefix}${test}${suffix}")
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
file(WRITE "${CTEST_FILE}" "${script}")
@@ -0,0 +1,251 @@
#==================================================================================================#
# supported macros #
# - TEST_CASE, #
# - TEMPLATE_TEST_CASE #
# - SCENARIO, #
# - TEST_CASE_METHOD, #
# - CATCH_TEST_CASE, #
# - CATCH_TEMPLATE_TEST_CASE #
# - CATCH_SCENARIO, #
# - CATCH_TEST_CASE_METHOD. #
# #
# Usage #
# 1. make sure this module is in the path or add this otherwise: #
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
# 2. make sure that you've enabled testing option for the project by the call: #
# enable_testing() #
# 3. add the lines to the script for testing target (sample CMakeLists.txt): #
# project(testing_target) #
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
# enable_testing() #
# #
# find_path(CATCH_INCLUDE_DIR "catch.hpp") #
# include_directories(${INCLUDE_DIRECTORIES} ${CATCH_INCLUDE_DIR}) #
# #
# file(GLOB SOURCE_FILES "*.cpp") #
# add_executable(${PROJECT_NAME} ${SOURCE_FILES}) #
# #
# include(ParseAndAddCatchTests) #
# ParseAndAddCatchTests(${PROJECT_NAME}) #
# #
# The following variables affect the behavior of the script: #
# #
# PARSE_CATCH_TESTS_VERBOSE (Default OFF) #
# -- enables debug messages #
# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
# -- excludes tests marked with [!hide], [.] or [.foo] tags #
# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
# -- adds fixture class name to the test name #
# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
# -- adds cmake target name to the test name #
# PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF) #
# -- causes CMake to rerun when file with tests changes so that new tests will be discovered #
# #
# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way #
# a test should be run. For instance to use test MPI, one can write #
# set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) #
# just before calling this ParseAndAddCatchTests function #
# #
# The AdditionalCatchParameters optional variable can be used to pass extra argument to the test #
# command. For example, to include successful tests in the output, one can write #
# set(AdditionalCatchParameters --success) #
# #
# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source #
# file in the target is set, and contains the list of the tests extracted from that target, or #
# from that file. This is useful, for example to add further labels or properties to the tests. #
# #
#==================================================================================================#
if (CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
message(FATAL_ERROR "ParseAndAddCatchTests requires CMake 2.8.8 or newer")
endif()
option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
function(ParseAndAddCatchTests_PrintDebugMessage)
if(PARSE_CATCH_TESTS_VERBOSE)
message(STATUS "ParseAndAddCatchTests: ${ARGV}")
endif()
endfunction()
# This removes the contents between
# - block comments (i.e. /* ... */)
# - full line comments (i.e. // ... )
# contents have been read into '${CppCode}'.
# !keep partial line comments
function(ParseAndAddCatchTests_RemoveComments CppCode)
string(ASCII 2 CMakeBeginBlockComment)
string(ASCII 3 CMakeEndBlockComment)
string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}")
string(REGEX REPLACE "\\*/" "${CMakeEndBlockComment}" ${CppCode} "${${CppCode}}")
string(REGEX REPLACE "${CMakeBeginBlockComment}[^${CMakeEndBlockComment}]*${CMakeEndBlockComment}" "" ${CppCode} "${${CppCode}}")
string(REGEX REPLACE "\n[ \t]*//+[^\n]+" "\n" ${CppCode} "${${CppCode}}")
set(${CppCode} "${${CppCode}}" PARENT_SCOPE)
endfunction()
# Worker function
function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
# If SourceFile is an object library, do not scan it (as it is not a file). Exit without giving a warning about a missing file.
if(SourceFile MATCHES "\\\$<TARGET_OBJECTS:.+>")
ParseAndAddCatchTests_PrintDebugMessage("Detected OBJECT library: ${SourceFile} this will not be scanned for tests.")
return()
endif()
# According to CMake docs EXISTS behavior is well-defined only for full paths.
get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
if(NOT EXISTS ${SourceFile})
message(WARNING "Cannot find source file: ${SourceFile}")
return()
endif()
ParseAndAddCatchTests_PrintDebugMessage("parsing ${SourceFile}")
file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME)
# Remove block and fullline comments
ParseAndAddCatchTests_RemoveComments(Contents)
# Find definition of test names
# https://regex101.com/r/JygOND/1
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([ \t\n]*\"[^\"]*\"[ \t\n]*(,[ \t\n]*\"[^\"]*\")?(,[ \t\n]*[^\,\)]*)*\\)[ \t\n]*\{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
set_property(
DIRECTORY
APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS ${SourceFile}
)
endif()
# check CMP0110 policy for new add_test() behavior
if(POLICY CMP0110)
cmake_policy(GET CMP0110 _cmp0110_value) # new add_test() behavior
else()
# just to be thorough explicitly set the variable
set(_cmp0110_value)
endif()
foreach(TestName ${Tests})
# Strip newlines
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
# Get test type and fixture if applicable
string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
string(REGEX MATCH "(CATCH_)?(TEMPLATE_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
# Get string parts of test definition
string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")
# Strip wrapping quotation marks
string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")
# Validate that a test name and tags have been provided
list(LENGTH TestStrings TestStringsLength)
if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
endif()
# Assign name and tags
list(GET TestStrings 0 Name)
if("${TestType}" STREQUAL "SCENARIO")
set(Name "Scenario: ${Name}")
endif()
if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture )
set(CTestName "${TestFixture}:${Name}")
else()
set(CTestName "${Name}")
endif()
if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
set(CTestName "${TestTarget}:${CTestName}")
endif()
# add target to labels to enable running all tests added from this target
set(Labels ${TestTarget})
if(TestStringsLength EQUAL 2)
list(GET TestStrings 1 Tags)
string(TOLOWER "${Tags}" Tags)
# remove target from labels if the test is hidden
if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
list(REMOVE_ITEM Labels ${TestTarget})
endif()
string(REPLACE "]" ";" Tags "${Tags}")
string(REPLACE "[" "" Tags "${Tags}")
else()
# unset tags variable from previous loop
unset(Tags)
endif()
list(APPEND Labels ${Tags})
set(HiddenTagFound OFF)
foreach(label ${Labels})
string(REGEX MATCH "^!hide|^\\." result ${label})
if(result)
set(HiddenTagFound ON)
break()
endif(result)
endforeach(label)
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
else()
ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
if(Labels)
ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
endif()
# Escape commas in the test spec
string(REPLACE "," "\\," Name ${Name})
# Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were neccessary,
# only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1
# And properly introduced in 3.19 with the CMP0110 policy
if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18")
ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to NEW, no need for add_test(\"\") workaround")
else()
ParseAndAddCatchTests_PrintDebugMessage("CMP0110 set to OLD adding \"\" for add_test() workaround")
set(CTestName "\"${CTestName}\"")
endif()
# Handle template test cases
if("${TestTypeAndFixture}" MATCHES ".*TEMPLATE_.*")
set(Name "${Name} - *")
endif()
# Add the test and set its properties
add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
set_tests_properties("${CTestName}" PROPERTIES DISABLED ON)
else()
set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
LABELS "${Labels}")
endif()
set_property(
TARGET ${TestTarget}
APPEND
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
set_property(
SOURCE ${SourceFile}
APPEND
PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}")
endif()
endforeach()
endfunction()
# entry point
function(ParseAndAddCatchTests TestTarget)
ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
get_target_property(SourceFiles ${TestTarget} SOURCES)
ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
foreach(SourceFile ${SourceFiles})
ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
endforeach()
ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
endfunction()
+368
View File
@@ -0,0 +1,368 @@
include(MiscFunctions)
# Please keep these ordered alphabetically
set(BENCHMARK_HEADERS
${SOURCES_DIR}/benchmark/catch_benchmark.hpp
${SOURCES_DIR}/benchmark/catch_benchmark_all.hpp
${SOURCES_DIR}/benchmark/catch_chronometer.hpp
${SOURCES_DIR}/benchmark/catch_clock.hpp
${SOURCES_DIR}/benchmark/catch_constructor.hpp
${SOURCES_DIR}/benchmark/catch_environment.hpp
${SOURCES_DIR}/benchmark/catch_estimate.hpp
${SOURCES_DIR}/benchmark/catch_execution_plan.hpp
${SOURCES_DIR}/benchmark/catch_optimizer.hpp
${SOURCES_DIR}/benchmark/catch_outlier_classification.hpp
${SOURCES_DIR}/benchmark/catch_sample_analysis.hpp
${SOURCES_DIR}/benchmark/detail/catch_analyse.hpp
${SOURCES_DIR}/benchmark/detail/catch_benchmark_function.hpp
${SOURCES_DIR}/benchmark/detail/catch_complete_invoke.hpp
${SOURCES_DIR}/benchmark/detail/catch_estimate_clock.hpp
${SOURCES_DIR}/benchmark/detail/catch_measure.hpp
${SOURCES_DIR}/benchmark/detail/catch_repeat.hpp
${SOURCES_DIR}/benchmark/detail/catch_run_for_at_least.hpp
${SOURCES_DIR}/benchmark/detail/catch_stats.hpp
${SOURCES_DIR}/benchmark/detail/catch_timing.hpp
)
set(BENCHMARK_SOURCES
${SOURCES_DIR}/benchmark/internal/catch_benchmark_combined_tu.cpp
${SOURCES_DIR}/benchmark/detail/catch_stats.cpp
)
SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
set(INTERNAL_HEADERS
${SOURCES_DIR}/catch_all.hpp
${SOURCES_DIR}/matchers/catch_matchers_all.hpp
${SOURCES_DIR}/generators/catch_generators_all.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp
${SOURCES_DIR}/matchers/internal/catch_matchers_impl.hpp
${SOURCES_DIR}/internal/catch_console_width.hpp
${SOURCES_DIR}/internal/catch_container_nonmembers.hpp
${SOURCES_DIR}/internal/catch_noncopyable.hpp
${SOURCES_DIR}/catch_approx.hpp
${SOURCES_DIR}/internal/catch_assertion_handler.hpp
${SOURCES_DIR}/catch_assertion_info.hpp
${SOURCES_DIR}/catch_assertion_result.hpp
${SOURCES_DIR}/internal/catch_test_macro_impl.hpp
${SOURCES_DIR}/internal/catch_test_failure_exception.hpp
${SOURCES_DIR}/internal/catch_case_sensitive.hpp
${SOURCES_DIR}/internal/catch_clara.hpp
${SOURCES_DIR}/internal/catch_commandline.hpp
${SOURCES_DIR}/internal/catch_source_line_info.hpp
${SOURCES_DIR}/internal/catch_compiler_capabilities.hpp
${SOURCES_DIR}/catch_config.hpp
${SOURCES_DIR}/internal/catch_config_android_logwrite.hpp
${SOURCES_DIR}/internal/catch_config_counter.hpp
${SOURCES_DIR}/internal/catch_config_uncaught_exceptions.hpp
${SOURCES_DIR}/internal/catch_config_wchar.hpp
${SOURCES_DIR}/internal/catch_console_colour.hpp
${SOURCES_DIR}/internal/catch_context.hpp
${SOURCES_DIR}/internal/catch_debug_console.hpp
${SOURCES_DIR}/internal/catch_debugger.hpp
${SOURCES_DIR}/internal/catch_decomposer.hpp
${SOURCES_DIR}/internal/catch_enforce.hpp
${SOURCES_DIR}/internal/catch_enum_values_registry.hpp
${SOURCES_DIR}/internal/catch_errno_guard.hpp
${SOURCES_DIR}/internal/catch_exception_translator_registry.hpp
${SOURCES_DIR}/internal/catch_fatal_condition_handler.hpp
${SOURCES_DIR}/internal/catch_unique_name.hpp
${SOURCES_DIR}/generators/catch_generator_exception.hpp
${SOURCES_DIR}/generators/catch_generators.hpp
${SOURCES_DIR}/generators/catch_generators_adapters.hpp
${SOURCES_DIR}/generators/catch_generators_random.hpp
${SOURCES_DIR}/generators/catch_generators_range.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_capture.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_config.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_enum_values_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_exception.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_runner.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
${SOURCES_DIR}/internal/catch_lazy_expr.hpp
${SOURCES_DIR}/internal/catch_leak_detector.hpp
${SOURCES_DIR}/internal/catch_list.hpp
${SOURCES_DIR}/matchers/catch_matchers.hpp
${SOURCES_DIR}/matchers/catch_matchers_container_properties.hpp
${SOURCES_DIR}/matchers/catch_matchers_contains.hpp
${SOURCES_DIR}/matchers/catch_matchers_exception.hpp
${SOURCES_DIR}/matchers/catch_matchers_floating_point.hpp
${SOURCES_DIR}/matchers/catch_matchers_predicate.hpp
${SOURCES_DIR}/matchers/catch_matchers_quantifiers.hpp
${SOURCES_DIR}/matchers/catch_matchers_string.hpp
${SOURCES_DIR}/matchers/catch_matchers_templated.hpp
${SOURCES_DIR}/matchers/catch_matchers_vector.hpp
${SOURCES_DIR}/catch_message.hpp
${SOURCES_DIR}/internal/catch_message_info.hpp
${SOURCES_DIR}/internal/catch_meta.hpp
${SOURCES_DIR}/internal/catch_option.hpp
${SOURCES_DIR}/internal/catch_output_redirect.hpp
${SOURCES_DIR}/internal/catch_platform.hpp
${SOURCES_DIR}/internal/catch_polyfills.hpp
${SOURCES_DIR}/internal/catch_preprocessor.hpp
${SOURCES_DIR}/internal/catch_random_number_generator.hpp
${SOURCES_DIR}/catch_reporter_registrars.hpp
${SOURCES_DIR}/internal/catch_reporter_registry.hpp
${SOURCES_DIR}/internal/catch_result_type.hpp
${SOURCES_DIR}/internal/catch_run_context.hpp
${SOURCES_DIR}/internal/catch_section.hpp
${SOURCES_DIR}/catch_section_info.hpp
${SOURCES_DIR}/catch_session.hpp
${SOURCES_DIR}/internal/catch_singletons.hpp
${SOURCES_DIR}/internal/catch_startup_exception_registry.hpp
${SOURCES_DIR}/internal/catch_stream.hpp
${SOURCES_DIR}/internal/catch_stream_end_stop.hpp
${SOURCES_DIR}/internal/catch_string_manip.hpp
${SOURCES_DIR}/internal/catch_stringref.hpp
${SOURCES_DIR}/catch_tag_alias.hpp
${SOURCES_DIR}/catch_tag_alias_autoregistrar.hpp
${SOURCES_DIR}/internal/catch_tag_alias_registry.hpp
${SOURCES_DIR}/catch_test_case_info.hpp
${SOURCES_DIR}/internal/catch_test_case_registry_impl.hpp
${SOURCES_DIR}/internal/catch_test_case_tracker.hpp
${SOURCES_DIR}/catch_template_test_macros.hpp
${SOURCES_DIR}/catch_test_macros.hpp
${SOURCES_DIR}/internal/catch_template_test_registry.hpp
${SOURCES_DIR}/internal/catch_test_registry.hpp
${SOURCES_DIR}/catch_test_spec.hpp
${SOURCES_DIR}/internal/catch_test_spec_parser.hpp
${SOURCES_DIR}/internal/catch_textflow.hpp
${SOURCES_DIR}/catch_timer.hpp
${SOURCES_DIR}/internal/catch_to_string.hpp
${SOURCES_DIR}/catch_tostring.hpp
${SOURCES_DIR}/catch_totals.hpp
${SOURCES_DIR}/catch_translate_exception.hpp
${SOURCES_DIR}/internal/catch_uncaught_exceptions.hpp
${SOURCES_DIR}/internal/catch_unique_ptr.hpp
${SOURCES_DIR}/catch_version.hpp
${SOURCES_DIR}/catch_version_macros.hpp
${SOURCES_DIR}/internal/catch_wildcard_pattern.hpp
${SOURCES_DIR}/internal/catch_windows_h_proxy.hpp
${SOURCES_DIR}/internal/catch_xmlwriter.hpp
)
set(IMPL_SOURCES
${SOURCES_DIR}/catch_approx.cpp
${SOURCES_DIR}/internal/catch_assertion_handler.cpp
${SOURCES_DIR}/catch_assertion_result.cpp
${SOURCES_DIR}/matchers/internal/catch_matchers_combined_tu.cpp
${SOURCES_DIR}/internal/catch_clara.cpp
${SOURCES_DIR}/internal/catch_commandline.cpp
${SOURCES_DIR}/internal/catch_source_line_info.cpp
${SOURCES_DIR}/catch_config.cpp
${SOURCES_DIR}/internal/catch_console_colour.cpp
${SOURCES_DIR}/internal/catch_context.cpp
${SOURCES_DIR}/internal/catch_debug_console.cpp
${SOURCES_DIR}/internal/catch_debugger.cpp
${SOURCES_DIR}/internal/catch_enforce.cpp
${SOURCES_DIR}/internal/catch_enum_values_registry.cpp
${SOURCES_DIR}/internal/catch_exception_translator_registry.cpp
${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp
${SOURCES_DIR}/generators/internal/catch_generators_combined_tu.cpp
${SOURCES_DIR}/interfaces/catch_interfaces_combined_tu.cpp
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.cpp
${SOURCES_DIR}/internal/catch_list.cpp
${SOURCES_DIR}/matchers/catch_matchers_floating_point.cpp
${SOURCES_DIR}/matchers/catch_matchers_string.cpp
${SOURCES_DIR}/matchers/catch_matchers_templated.cpp
${SOURCES_DIR}/catch_message.cpp
${SOURCES_DIR}/internal/catch_output_redirect.cpp
${SOURCES_DIR}/catch_registry_hub.cpp
${SOURCES_DIR}/internal/catch_combined_tu.cpp
${SOURCES_DIR}/internal/catch_random_number_generator.cpp
${SOURCES_DIR}/internal/catch_reporter_registry.cpp
${SOURCES_DIR}/internal/catch_result_type.cpp
${SOURCES_DIR}/internal/catch_run_context.cpp
${SOURCES_DIR}/internal/catch_section.cpp
${SOURCES_DIR}/catch_session.cpp
${SOURCES_DIR}/internal/catch_singletons.cpp
${SOURCES_DIR}/internal/catch_stream.cpp
${SOURCES_DIR}/internal/catch_stringref.cpp
${SOURCES_DIR}/internal/catch_string_manip.cpp
${SOURCES_DIR}/internal/catch_tag_alias_registry.cpp
${SOURCES_DIR}/catch_test_case_info.cpp
${SOURCES_DIR}/internal/catch_test_case_registry_impl.cpp
${SOURCES_DIR}/internal/catch_test_case_tracker.cpp
${SOURCES_DIR}/internal/catch_test_registry.cpp
${SOURCES_DIR}/internal/catch_textflow.cpp
${SOURCES_DIR}/catch_test_spec.cpp
${SOURCES_DIR}/internal/catch_test_spec_parser.cpp
${SOURCES_DIR}/catch_timer.cpp
${SOURCES_DIR}/catch_tostring.cpp
${SOURCES_DIR}/catch_totals.cpp
${SOURCES_DIR}/catch_version.cpp
${SOURCES_DIR}/internal/catch_wildcard_pattern.cpp
${SOURCES_DIR}/internal/catch_xmlwriter.cpp
)
set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS})
# Please keep these ordered alphabetically
set(REPORTER_HEADERS
${SOURCES_DIR}/reporters/catch_reporters_all.hpp
${SOURCES_DIR}/reporters/catch_reporter_automake.hpp
${SOURCES_DIR}/reporters/catch_reporter_compact.hpp
${SOURCES_DIR}/reporters/catch_reporter_console.hpp
${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.hpp
${SOURCES_DIR}/reporters/catch_reporter_event_listener.hpp
${SOURCES_DIR}/reporters/catch_reporter_helpers.hpp
${SOURCES_DIR}/reporters/catch_reporter_junit.hpp
${SOURCES_DIR}/reporters/catch_reporter_listening.hpp
${SOURCES_DIR}/reporters/catch_reporter_sonarqube.hpp
${SOURCES_DIR}/reporters/catch_reporter_streaming_base.hpp
${SOURCES_DIR}/reporters/catch_reporter_tap.hpp
${SOURCES_DIR}/reporters/catch_reporter_teamcity.hpp
${SOURCES_DIR}/reporters/catch_reporter_xml.hpp
)
set(REPORTER_SOURCES
${SOURCES_DIR}/reporters/catch_reporter_automake.cpp
${SOURCES_DIR}/reporters/catch_reporter_combined_tu.cpp
${SOURCES_DIR}/reporters/catch_reporter_compact.cpp
${SOURCES_DIR}/reporters/catch_reporter_console.cpp
${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.cpp
${SOURCES_DIR}/reporters/catch_reporter_junit.cpp
${SOURCES_DIR}/reporters/catch_reporter_listening.cpp
${SOURCES_DIR}/reporters/catch_reporter_sonarqube.cpp
${SOURCES_DIR}/reporters/catch_reporter_streaming_base.cpp
${SOURCES_DIR}/reporters/catch_reporter_tap.cpp
${SOURCES_DIR}/reporters/catch_reporter_teamcity.cpp
${SOURCES_DIR}/reporters/catch_reporter_xml.cpp
)
set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES})
# Fixme: STATIC because for dynamic, we would need to handle visibility
# and I don't want to do the annotations right now
add_library(Catch2 STATIC
${REPORTER_FILES}
${INTERNAL_FILES}
${BENCHMARK_HEADERS}
${BENCHMARK_SOURCES}
)
add_library(Catch2::Catch2 ALIAS Catch2)
if (ANDROID)
target_link_libraries(Catch2 INTERFACE log)
endif()
# depend on bunch of C++11 and C++14 features to have C++14 enabled by default
target_compile_features(Catch2
PUBLIC
cxx_alignas
cxx_alignof
cxx_attributes
cxx_auto_type
cxx_constexpr
cxx_defaulted_functions
cxx_deleted_functions
cxx_final
cxx_lambdas
cxx_noexcept
cxx_override
cxx_range_for
cxx_rvalue_references
cxx_static_assert
cxx_strong_enums
cxx_trailing_return_types
cxx_unicode_literals
cxx_user_literals
cxx_variable_templates
cxx_variadic_macros
)
if (NOT_SUBPROJECT)
target_include_directories(Catch2
PUBLIC
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
else()
target_include_directories(Catch2
SYSTEM PUBLIC
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
endif()
add_library(Catch2WithMain STATIC
${SOURCES_DIR}/internal/catch_main.cpp
)
add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain)
target_link_libraries(Catch2WithMain PUBLIC Catch2)
set_target_properties(Catch2WithMain
PROPERTIES
OUTPUT_NAME "Catch2Main"
)
if (NOT_SUBPROJECT)
# create and install an export set for catch target as Catch2::Catch
install(
TARGETS
Catch2
Catch2WithMain
EXPORT
Catch2Targets
DESTINATION
${CMAKE_INSTALL_LIBDIR}
)
install(
EXPORT
Catch2Targets
NAMESPACE
Catch2::
DESTINATION
${CATCH_CMAKE_CONFIG_DESTINATION}
)
# Install the headers
install(DIRECTORY ${SOURCES_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h*")
endif()
# Some tests require a full recompilation of Catch2 lib with different
# compilation flags. They can link against this target to recompile all
# the sources into the binary.
if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
add_library(Catch2_buildall_interface INTERFACE)
target_sources(Catch2_buildall_interface INTERFACE
${REPORTER_FILES}
${INTERNAL_FILES}
${BENCHMARK_HEADERS}
${BENCHMARK_SOURCES}
# Also include main entry point
${SOURCES_DIR}/internal/catch_main.cpp
)
target_include_directories(Catch2_buildall_interface
INTERFACE
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(Catch2_buildall_interface
INTERFACE
cxx_alignas
cxx_alignof
cxx_attributes
cxx_auto_type
cxx_constexpr
cxx_defaulted_functions
cxx_deleted_functions
cxx_final
cxx_lambdas
cxx_noexcept
cxx_override
cxx_range_for
cxx_rvalue_references
cxx_static_assert
cxx_strong_enums
cxx_trailing_return_types
cxx_unicode_literals
cxx_user_literals
cxx_variable_templates
cxx_variadic_macros
)
endif()
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain)
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)

Some files were not shown because too many files have changed in this diff Show More