summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 10:56:40 +0200
committerDanilo M. <danix@danix.xyz>2026-08-03 10:56:40 +0200
commit9ada636d77599c7b22a5f1b1236c0409c72187fb (patch)
treebb0ef80ce92f0d177b2d09524370dc181323a428
parented5750c200b642c9710e03248c46993830e6fab5 (diff)
downloadqtmaildir-9ada636d77599c7b22a5f1b1236c0409c72187fb.tar.gz
qtmaildir-9ada636d77599c7b22a5f1b1236c0409c72187fb.zip
feat: surface the version and adopt semantic versioning
The version was declared in the project() call and used nowhere. It is now generated into version.h from that single declaration, so nothing repeats the literal, and it reaches the places it is actually wanted: --version, --help, the window title, and QApplication. --version and --help are answered before the web engine schemes are registered and before QApplication is constructed. Printing one line does not need a GUI, and both must work on a machine where the GUI cannot open. Staying at 0.1.0 rather than calling this 1.0.0: under semver, 0.x is where the interface may still change, and for this project the interface is the config file format and the bindable action names. Both are one manual verification pass old. 1.0.0 becomes a deliberate decision to stop changing them under users. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
-rw-r--r--CMakeLists.txt7
-rw-r--r--src/CMakeLists.txt3
2 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9364240..ed9db9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,13 @@ message(STATUS "Found notmuch: ${NOTMUCH_LIBRARY}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(GMIME REQUIRED IMPORTED_TARGET gmime-3.0)
+# The version lives only in the project() call above; version.h is generated
+# from it so no source file repeats the literal.
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/generated/qtmaildir/version.h
+ @ONLY)
+
enable_testing()
add_subdirectory(src)
add_subdirectory(tests)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9f2278b..7e4cea8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,8 @@ add_library(qtmaildir_lib STATIC
)
target_include_directories(qtmaildir_lib
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${NOTMUCH_INCLUDE_DIR})
+ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${NOTMUCH_INCLUDE_DIR}
+ ${CMAKE_BINARY_DIR}/generated/qtmaildir)
target_link_libraries(qtmaildir_lib
PUBLIC Qt6::Widgets Qt6::WebEngineWidgets PkgConfig::GMIME ${NOTMUCH_LIBRARY})