From f30c6fa2bdf49b0a920ef5645cf46495e71dfff0 Mon Sep 17 00:00:00 2001 From: "Maarten L. Hekkelman" Date: Mon, 7 Oct 2024 09:00:52 +0200 Subject: [PATCH] Fix writing version info --- CMakeLists.txt | 2 +- changelog | 3 +++ libdssp/CMakeLists.txt | 10 ++++++++++ libdssp/src/dssp-io.cpp | 6 +++--- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 110c513..614fa67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.23) # set the project name -project(mkdssp VERSION 4.4.7 LANGUAGES CXX) +project(mkdssp VERSION 4.4.8 LANGUAGES CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/changelog b/changelog index 966afc5..a42c07a 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +Version 4.4.8 +- Fix writing version numbers + Version 4.4.7 - Fix cmakefile to use system installed libraries by default diff --git a/libdssp/CMakeLists.txt b/libdssp/CMakeLists.txt index d151d52..6b426eb 100644 --- a/libdssp/CMakeLists.txt +++ b/libdssp/CMakeLists.txt @@ -1,8 +1,18 @@ +# Use the version of the parent list file, if any. May need a fix someday. +if(NOT CMAKE_PARENT_LIST_FILE) + set(PROJECT_VERSION 4.4.8) +endif() + +project(libdssp VERSION ${PROJECT_VERSION}) + include(CMakePackageConfigHelpers) # We do not want to write an export file for all our symbols... set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +# Create a revision file, containing the current git version info +write_version_header("${CMAKE_CURRENT_SOURCE_DIR}/src" LIB_NAME libdssp) + # The DSSP code is in a separate library, optionally to be used by others add_library(dssp) add_library(dssp::dssp ALIAS dssp) diff --git a/libdssp/src/dssp-io.cpp b/libdssp/src/dssp-io.cpp index 540321d..e68f278 100644 --- a/libdssp/src/dssp-io.cpp +++ b/libdssp/src/dssp-io.cpp @@ -157,7 +157,7 @@ void writeDSSP(const dssp &dssp, std::ostream &os) std::time_t today = system_clock::to_time_t(system_clock::now()); std::tm *tm = std::gmtime(&today); - std::string version = kVersionNumber; + std::string version = klibdsspVersionNumber; if (version.length() < 10) version.insert(version.end(), 10 - version.length(), ' '); @@ -879,8 +879,8 @@ void annotateDSSP(cif::datablock &db, const dssp &dssp, bool writeOther, bool wr software.emplace({ { "pdbx_ordinal", software.get_unique_id("") }, { "name", "dssp" }, - { "version", kVersionNumber }, - { "date", kRevisionDate }, + { "version", klibdsspVersionNumber }, + { "date", klibdsspRevisionDate }, { "classification", "model annotation" } }); }