Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dssp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
dssp
Commits
a6281bc0
Unverified
Commit
a6281bc0
authored
Mar 13, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'trunk' into develop
parents
068b315e
81938398
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
136 deletions
+147
-136
CMakeLists.txt
+2
-1
README.md
+1
-2
changelog
+7
-1
cmake/VersionString.cmake
+11
-131
cmake/revision.hpp.in
+121
-0
libdssp/src/dssp-io.cpp
+1
-1
libdssp/src/dssp.cpp
+4
-0
No files found.
CMakeLists.txt
View file @
a6281bc0
...
@@ -41,7 +41,7 @@ endif()
...
@@ -41,7 +41,7 @@ endif()
# Optionally build a version to be installed inside CCP4
# Optionally build a version to be installed inside CCP4
option
(
BUILD_FOR_CCP4
"Build a version to be installed in CCP4"
OFF
)
option
(
BUILD_FOR_CCP4
"Build a version to be installed in CCP4"
OFF
)
option
(
GENERATE
_DOCUMENTATION
"Generate the documentation files using pandoc"
OFF
)
option
(
BUILD
_DOCUMENTATION
"Generate the documentation files using pandoc"
OFF
)
if
(
BUILD_FOR_CCP4
)
if
(
BUILD_FOR_CCP4
)
if
(
"$ENV{CCP4}"
STREQUAL
""
OR NOT EXISTS $ENV{CCP4}
)
if
(
"$ENV{CCP4}"
STREQUAL
""
OR NOT EXISTS $ENV{CCP4}
)
...
@@ -60,6 +60,7 @@ endif()
...
@@ -60,6 +60,7 @@ endif()
if
(
MSVC
)
if
(
MSVC
)
# make msvc standards compliant...
# make msvc standards compliant...
add_compile_options
(
/permissive-
)
add_compile_options
(
/permissive-
)
add_link_options
(
/NODEFAULTLIB:library
)
macro
(
get_WIN32_WINNT version
)
macro
(
get_WIN32_WINNT version
)
if
(
WIN32 AND CMAKE_SYSTEM_VERSION
)
if
(
WIN32 AND CMAKE_SYSTEM_VERSION
)
...
...
README.md
View file @
a6281bc0
...
@@ -32,8 +32,7 @@ automatically. So in theory, building is as simple as:
...
@@ -32,8 +32,7 @@ automatically. So in theory, building is as simple as:
```
console
```
console
git clone https://github.com/PDB-REDO/dssp.git
git clone https://github.com/PDB-REDO/dssp.git
cd dssp
cd dssp
mkdir build
cmake -S . -B build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --build build
cmake --install build
cmake --install build
```
```
...
...
changelog
View file @
a6281bc0
Version 4.4.
4
Version 4.4.
6
- Update dependency on libcifpp to version 7
- Update dependency on libcifpp to version 7
Version 4.4.5
- Changes required for building on Windows
Version 4.4.4
- Fix unit test
Version 4.4.3
Version 4.4.3
- Split the code in a sub project for libdssp and the main
- Split the code in a sub project for libdssp and the main
code for the executable.
code for the executable.
...
...
cmake/VersionString.cmake
View file @
a6281bc0
...
@@ -54,6 +54,10 @@ cmake_minimum_required(VERSION 3.15)
...
@@ -54,6 +54,10 @@ cmake_minimum_required(VERSION 3.15)
variables contained in the revision file.
variables contained in the revision file.
#]=======================================================================]
#]=======================================================================]
# Record the location of this module now, not at the time the CMakeLists.txt
# is being processed
get_filename_component
(
_current_cmake_module_dir
${
CMAKE_CURRENT_LIST_FILE
}
PATH
)
# First locate a .git file or directory.
# First locate a .git file or directory.
function
(
_get_git_dir _start_dir _variable
)
function
(
_get_git_dir _start_dir _variable
)
...
@@ -233,7 +237,11 @@ function(write_version_header dir)
...
@@ -233,7 +237,11 @@ function(write_version_header dir)
if
(
res EQUAL 0
)
if
(
res EQUAL 0
)
set
(
REVISION_STRING
"
${
out
}
"
)
set
(
REVISION_STRING
"
${
out
}
"
)
else
()
message
(
STATUS
"Git hash not found, does this project has a 'build' tag?"
)
endif
()
endif
()
else
()
message
(
STATUS
"Git hash not found"
)
endif
()
endif
()
# Check the revision string, if it matches we fill in the required info
# Check the revision string, if it matches we fill in the required info
...
@@ -255,141 +263,13 @@ function(write_version_header dir)
...
@@ -255,141 +263,13 @@ function(write_version_header dir)
if
(
VERSION_STRING_OPTION_LIB_NAME
)
if
(
VERSION_STRING_OPTION_LIB_NAME
)
set
(
VAR_PREFIX
"
${
VERSION_STRING_OPTION_LIB_NAME
}
"
)
set
(
VAR_PREFIX
"
${
VERSION_STRING_OPTION_LIB_NAME
}
"
)
set
(
IDENT_PREFIX
"
${
VERSION_STRING_OPTION_LIB_NAME
}
_"
)
set
(
IDENT_PREFIX
"
${
VERSION_STRING_OPTION_LIB_NAME
}
_"
)
set
(
BOOL_IS_MAIN
"false"
)
else
()
else
()
set
(
VAR_PREFIX
""
)
set
(
VAR_PREFIX
""
)
set
(
IDENT_PREFIX
""
)
set
(
IDENT_PREFIX
""
)
set
(
BOOL_IS_MAIN
"true"
)
endif
()
endif
()
# And finally, write out the header file
configure_file
(
"
${
_current_cmake_module_dir
}
/revision.hpp.in"
"
${
dir
}
/
${
file_name
}
"
@ONLY
)
file
(
WRITE
"
${
VERSION_STRING_DATA
}
/
${
file_name
}
.in"
[[// This file was generated by VersionString.cmake
#pragma once
#include <ostream>
constexpr const char k@VAR_PREFIX@ProjectName[] = "@PROJECT_NAME@";
constexpr const char k@VAR_PREFIX@VersionNumber[] = "@PROJECT_VERSION@";
constexpr int k@VAR_PREFIX@BuildNumber = @BUILD_NUMBER@;
constexpr const char k@VAR_PREFIX@RevisionGitTag[] = "@REVISION_GIT_TAGREF@";
constexpr const char k@VAR_PREFIX@RevisionDate[] = "@REVISION_DATE_TIME@";
#ifndef VERSION_INFO_DEFINED
#define VERSION_INFO_DEFINED 1
namespace version_info_v1
{
class version_info_base
{
public:
static void write(std::ostream &os, bool verbose)
{
auto &s_head = head();
if (s_head != nullptr)
write(s_head, os, verbose);
}
protected:
version_info_base(const char *name, const char *version, int build_number, const char *git_tag, const char *revision_date)
: m_name(name)
, m_version(version)
, m_build_number(build_number)
, m_git_tag(git_tag)
, m_revision_date(revision_date)
{
auto &s_head = head();
m_next = s_head;
s_head = this;
}
static void write(const version_info_base *inst, std::ostream &os, bool verbose)
{
if (inst->m_next)
{
write(inst->m_next, os, verbose);
if (not verbose)
return;
os << '-' << std::endl;
}
os << inst->m_name << " version " << inst->m_version << std::endl;
if (verbose)
{
if (inst->m_build_number != 0)
{
os << "build: " << inst->m_build_number << ' ' << inst->m_revision_date << std::endl;
if (inst->m_git_tag[0] != 0)
os << "git tag: " << inst->m_git_tag << std::endl;
}
}
}
using version_info_ptr = version_info_base *;
static version_info_ptr &head()
{
static version_info_ptr s_head = nullptr;
return s_head;
}
const char *m_name;
const char *m_version;
int m_build_number;
const char *m_git_tag;
const char *m_revision_date;
version_info_base *m_next = nullptr;
};
template<typename T>
class version_info : public version_info_base
{
public:
using implementation_type = T;
version_info(const char *name, const char *version, int build_number, const char *git_tag, const char *revision_date)
: version_info_base(name, version, build_number, git_tag, revision_date)
{
}
struct register_object
{
register_object()
{
static implementation_type s_instance;
}
};
template<register_object&> struct reference_object;
static register_object s_registered_object;
static reference_object<s_registered_object> s_referenced_object;
};
template<typename T> typename version_info<T>::register_object version_info<T>::s_registered_object;
}
inline void write_version_string(std::ostream &os, bool verbose)
{
version_info_v1::version_info_base::write(os, verbose);
}
#endif
class version_info_@IDENT_PREFIX@impl : public version_info_v1::version_info<version_info_@IDENT_PREFIX@impl>
{
public:
version_info_@IDENT_PREFIX@impl()
: version_info(k@VAR_PREFIX@ProjectName, k@VAR_PREFIX@VersionNumber, k@VAR_PREFIX@BuildNumber, k@VAR_PREFIX@RevisionGitTag, k@VAR_PREFIX@RevisionDate)
{
}
};
]]
)
configure_file
(
"
${
VERSION_STRING_DATA
}
/
${
file_name
}
.in"
"
${
dir
}
/
${
file_name
}
"
@ONLY
)
endfunction
()
endfunction
()
cmake/revision.hpp.in
0 → 100644
View file @
a6281bc0
// This file was generated by VersionString.cmake
#pragma once
#include <ostream>
constexpr const char k@VAR_PREFIX@ProjectName[] = "@PROJECT_NAME@";
constexpr const char k@VAR_PREFIX@VersionNumber[] = "@PROJECT_VERSION@";
constexpr int k@VAR_PREFIX@BuildNumber = @BUILD_NUMBER@;
constexpr const char k@VAR_PREFIX@RevisionGitTag[] = "@REVISION_GIT_TAGREF@";
constexpr const char k@VAR_PREFIX@RevisionDate[] = "@REVISION_DATE_TIME@";
#ifndef VERSION_INFO_DEFINED
#define VERSION_INFO_DEFINED 1
namespace version_info_v1_1
{
class version_info_base
{
public:
static void write_version_string(std::ostream &os, bool verbose)
{
auto s_main = registered_main();
if (s_main != nullptr)
s_main->write(os, verbose);
if (verbose)
{
for (auto lib = registered_libraries(); lib != nullptr; lib = lib->m_next)
{
os << "-\n";
lib->write(os, verbose);
}
}
}
protected:
version_info_base(const char *name, const char *version, int build_number, const char *git_tag, const char *revision_date, bool is_main)
: m_name(name)
, m_version(version)
, m_build_number(build_number)
, m_git_tag(git_tag)
, m_revision_date(revision_date)
{
if (is_main)
registered_main() = this;
else
{
auto &s_head = registered_libraries();
m_next = s_head;
s_head = this;
}
}
void write(std::ostream &os, bool verbose)
{
os << m_name << " version " << m_version << '\n';
if (verbose)
{
if (m_build_number != 0)
{
os << "build: " << m_build_number << ' ' << m_revision_date << '\n';
if (m_git_tag[0] != 0)
os << "git tag: " << m_git_tag << '\n';
}
}
}
using version_info_ptr = version_info_base *;
static version_info_ptr ®istered_main()
{
static version_info_ptr s_main = nullptr;
return s_main;
}
static version_info_ptr ®istered_libraries()
{
static version_info_ptr s_head = nullptr;
return s_head;
}
const char *m_name;
const char *m_version;
int m_build_number;
const char *m_git_tag;
const char *m_revision_date;
version_info_base *m_next = nullptr;
};
template <typename T>
class version_info : public version_info_base
{
public:
using implementation_type = T;
version_info(const char *name, const char *version, int build_number, const char *git_tag, const char *revision_date, bool is_main)
: version_info_base(name, version, build_number, git_tag, revision_date, is_main)
{
}
};
} // namespace version_info_v1_1
inline void write_version_string(std::ostream &os, bool verbose)
{
version_info_v1_1::version_info_base::write_version_string(os, verbose);
}
#endif
const class version_info_@IDENT_PREFIX@impl : public version_info_v1_1::version_info<version_info_@IDENT_PREFIX@impl>
{
public:
version_info_@IDENT_PREFIX@impl()
: version_info(k@VAR_PREFIX@ProjectName, k@VAR_PREFIX@VersionNumber, k@VAR_PREFIX@BuildNumber, k@VAR_PREFIX@RevisionGitTag, k@VAR_PREFIX@RevisionDate, @BOOL_IS_MAIN@)
{
}
} s_version_info_@IDENT_PREFIX@instance;
libdssp/src/dssp-io.cpp
View file @
a6281bc0
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "dssp-io.hpp"
#include "dssp-io.hpp"
#include "revision.hpp"
#include "revision.hpp"
#include <cif++
/pdb
.hpp>
#include <cif++.hpp>
#include <cif++/dictionary_parser.hpp>
#include <cif++/dictionary_parser.hpp>
#include <exception>
#include <exception>
...
...
libdssp/src/dssp.cpp
View file @
a6281bc0
...
@@ -35,6 +35,10 @@
...
@@ -35,6 +35,10 @@
#include <numeric>
#include <numeric>
#include <thread>
#include <thread>
#ifdef near
#undef near
#endif
using
residue
=
dssp
::
residue
;
using
residue
=
dssp
::
residue
;
using
statistics
=
dssp
::
statistics
;
using
statistics
=
dssp
::
statistics
;
using
structure_type
=
dssp
::
structure_type
;
using
structure_type
=
dssp
::
structure_type
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment