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
7492b795
Unverified
Commit
7492b795
authored
Dec 08, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed installing in CCP4 context
Fixed unit-test
parent
f192ea59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
64 deletions
+32
-64
CMakeLists.txt
+20
-39
test/unit-test.cpp
+12
-25
No files found.
CMakeLists.txt
View file @
7492b795
...
@@ -55,7 +55,7 @@ if(NOT "$ENV{CCP4}" STREQUAL "")
...
@@ -55,7 +55,7 @@ if(NOT "$ENV{CCP4}" STREQUAL "")
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CCP4
}
/Lib"
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CCP4
}
/Lib"
)
list
(
APPEND CMAKE_PREFIX_PATH
${
CCP4
}
)
list
(
APPEND CMAKE_PREFIX_PATH
${
CCP4
}
)
if
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
if
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
set
(
CMAKE_
PREFIX_PATH
${
CCP4
}
)
set
(
CMAKE_
INSTALL_PREFIX
${
CCP4
}
)
endif
()
endif
()
endif
()
endif
()
...
@@ -81,19 +81,6 @@ if(MSVC)
...
@@ -81,19 +81,6 @@ if(MSVC)
message
(
STATUS
"The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/
${
PROJECT_NAME
}
"
)
message
(
STATUS
"The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/
${
PROJECT_NAME
}
"
)
set
(
CMAKE_INSTALL_PREFIX
"$ENV{LOCALAPPDATA}/
${
PROJECT_NAME
}
"
CACHE PATH
"..."
FORCE
)
set
(
CMAKE_INSTALL_PREFIX
"$ENV{LOCALAPPDATA}/
${
PROJECT_NAME
}
"
CACHE PATH
"..."
FORCE
)
endif
()
endif
()
# Find out the processor type for the target
if
(
${
CMAKE_SYSTEM_PROCESSOR
}
STREQUAL
"AMD64"
)
set
(
COFF_TYPE
"x64"
)
elseif
(
${
CMAKE_SYSTEM_PROCESSOR
}
STREQUAL
"i386"
)
set
(
COFF_TYPE
"x86"
)
elseif
(
${
CMAKE_SYSTEM_PROCESSOR
}
STREQUAL
"ARM64"
)
set
(
COFF_TYPE
"arm64"
)
else
()
message
(
FATAL_ERROR
"Unsupported or unknown processor type
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
endif
()
set
(
COFF_SPEC
"--coff=
${
COFF_TYPE
}
"
)
endif
()
endif
()
if
(
UNIX AND NOT APPLE
)
if
(
UNIX AND NOT APPLE
)
...
@@ -106,34 +93,32 @@ endif()
...
@@ -106,34 +93,32 @@ endif()
# Create a revision file, containing the current git version info
# Create a revision file, containing the current git version info
find_package
(
Git
)
include
(
GetGitRevisionDescription
)
if
(
GIT_FOUND AND EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
option
(
GENERATE_CUSTOM_VERSION
"Generate a custom version string"
OFF
)
include
(
GetGitRevisionDescription
)
if
(
GIT-NOTFOUND OR HEAD-HASH-NOTFOUND OR NOT GENERATE_CUSTOM_VERSION
)
get_git_head_revision
(
REFSPEC COMMITHASH
)
get_git_head_revision
(
REFSPEC COMMITHASH
)
# Generate our own version string
# Generate our own version string
git_describe_working_tree
(
BUILD_VERSION_STRING --match=build --dirty
)
git_describe_working_tree
(
BUILD_VERSION_STRING --match=build --dirty
)
else
()
else
()
message
(
WARNING
"Git not found, cannot set version info"
)
SET
(
BUILD_VERSION_STRING
${
PROJECT_VERSION
}
)
SET
(
BUILD_VERSION_STRING
${
PROJECT_VERSION
}
)
endif
()
endif
()
# generate version.h
# generate version.h
include_directories
(
${
CMAKE_BINARY_DIR
}
PRIVATE
)
include_directories
(
${
CMAKE_BINARY_DIR
}
PRIVATE
)
string
(
TIMESTAMP BUILD_DATE_TIME
"%Y-%m-%d"
UTC
)
string
(
TIMESTAMP BUILD_DATE_TIME
"%Y-%m-%d
T%H:%M:%SZ
"
UTC
)
configure_file
(
"
${
CMAKE_SOURCE_DIR
}
/src/revision.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/revision.hpp"
@ONLY
)
configure_file
(
"
${
CMAKE_SOURCE_DIR
}
/src/revision.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/revision.hpp"
@ONLY
)
# Optionally use mrc to create resources
# Optionally use mrc to create resources
find_p
rogram
(
MRC mrc HINTS
"$ENV{LOCALAPPDATA}/bin"
"$ENV{LOCALAPPDATA}/mrc"
"
${
CMAKE_INSTALL_PREFIX
}
/../mrc"
"/usr/local/bin"
)
find_p
ackage
(
Mrc
)
if
(
MRC
)
if
(
MRC
_FOUND
)
option
(
USE_RSRC
"Use mrc to create resources"
ON
)
option
(
USE_RSRC
"Use mrc to create resources"
ON
)
else
()
else
()
message
(
WARNING
"Not using resources since mrc was not found"
)
message
(
WARNING
"Not using resources since mrc was not found"
)
endif
()
endif
()
if
(
USE_RSRC
STREQUAL
"ON"
)
if
(
USE_RSRC
)
set
(
USE_RSRC 1
)
set
(
USE_RSRC 1
)
message
(
"Using resources compiled with
${
MRC
}
"
)
message
(
"Using resources compiled with
${
MRC
}
"
)
...
@@ -144,30 +129,22 @@ set(CMAKE_THREAD_PREFER_PTHREAD)
...
@@ -144,30 +129,22 @@ set(CMAKE_THREAD_PREFER_PTHREAD)
set
(
THREADS_PREFER_PTHREAD_FLAG
)
set
(
THREADS_PREFER_PTHREAD_FLAG
)
find_package
(
Threads
)
find_package
(
Threads
)
set
(
Boost_DETAILED_FAILURE_MSG ON
)
# Note: use -DBoost_USE_STATIC_LIBS=ON to use boost static libraries
if
(
NOT BUILD_SHARED_LIBS
)
set
(
Boost_USE_STATIC_LIBS ON
)
endif
()
find_package
(
cifpp 2.0.0 REQUIRED
)
find_package
(
cifpp 2.0.0 REQUIRED
)
find_package
(
Boost COMPONENTS date_time
)
find_package
(
Boost COMPONENTS date_time
)
if
(
USE_RSRC
)
add_custom_command
(
OUTPUT mkdssp_rsrc.obj
COMMAND
${
MRC
}
-o mkdssp_rsrc.obj
${
CIFPP_SHARE_DIR
}
/mmcif_pdbx_v50.dic
${
COFF_SPEC
}
)
set
(
DSSP_RESOURCE mkdssp_rsrc.obj
)
endif
()
add_executable
(
mkdssp
add_executable
(
mkdssp
${
PROJECT_SOURCE_DIR
}
/src/dssp.cpp
${
PROJECT_SOURCE_DIR
}
/src/dssp.cpp
${
PROJECT_SOURCE_DIR
}
/src/dssp.hpp
${
PROJECT_SOURCE_DIR
}
/src/dssp.hpp
${
PROJECT_SOURCE_DIR
}
/src/mkdssp.cpp
${
PROJECT_SOURCE_DIR
}
/src/mkdssp.cpp
)
${
DSSP_RESOURCE
}
)
target_include_directories
(
mkdssp PRIVATE cifpp::cifpp
${
CMAKE_SOURCE_DIR
}
/include
${
cifpp_INCLUDE_DIRS
}
${
Boost_INCLUDE_DIRS
}
${
CMAKE_BINARY_DIR
}
)
target_include_directories
(
mkdssp PRIVATE cifpp::cifpp
${
CMAKE_SOURCE_DIR
}
/include
${
cifpp_INCLUDE_DIRS
}
${
Boost_INCLUDE_DIRS
}
${
CMAKE_BINARY_DIR
}
)
target_link_libraries
(
mkdssp PRIVATE cifpp::cifpp Boost::date_time
${
CMAKE_THREAD_LIBS_INIT
}
)
target_link_libraries
(
mkdssp PRIVATE cifpp::cifpp Boost::date_time Threads::Threads
)
if
(
USE_RSRC
)
mrc_target_resources
(
mkdssp
${
CIFPP_SHARE_DIR
}
/mmcif_pdbx_v50.dic
)
endif
()
install
(
TARGETS
${
PROJECT_NAME
}
install
(
TARGETS
${
PROJECT_NAME
}
RUNTIME DESTINATION
${
BIN_INSTALL_DIR
}
RUNTIME DESTINATION
${
BIN_INSTALL_DIR
}
...
@@ -187,7 +164,11 @@ endif()
...
@@ -187,7 +164,11 @@ endif()
# test
# test
add_executable
(
unit-test
${
PROJECT_SOURCE_DIR
}
/test/unit-test.cpp
${
PROJECT_SOURCE_DIR
}
/src/dssp.cpp
${
DSSP_RESOURCE
}
)
add_executable
(
unit-test
${
PROJECT_SOURCE_DIR
}
/test/unit-test.cpp
${
PROJECT_SOURCE_DIR
}
/src/dssp.cpp
)
if
(
USE_RSRC
)
mrc_target_resources
(
unit-test
${
CIFPP_SHARE_DIR
}
/mmcif_pdbx_v50.dic
)
endif
()
target_include_directories
(
unit-test PRIVATE
target_include_directories
(
unit-test PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
...
...
test/unit-test.cpp
View file @
7492b795
...
@@ -86,12 +86,14 @@ BOOST_AUTO_TEST_CASE(ut_dssp)
...
@@ -86,12 +86,14 @@ BOOST_AUTO_TEST_CASE(ut_dssp)
BOOST_CHECK
(
reference
.
eof
());
BOOST_CHECK
(
reference
.
eof
());
}
}
BOOST_AUTO_TEST_CASE
(
ut_mmcif_2
)
BOOST_AUTO_TEST_CASE
(
ut_mmcif
)
{
{
using
namespace
std
::
literals
;
using
namespace
std
::
literals
;
using
namespace
cif
::
literals
;
mmcif
::
File
f
(
"1cbs.cif.gz"
);
mmcif
::
File
f
(
"1cbs.cif.gz"
);
f
.
file
().
loadDictionary
(
"mmcif_pdbx_v50"
);
mmcif
::
Structure
structure
(
f
,
1
,
mmcif
::
StructureOpenOptions
::
SkipHydrogen
);
mmcif
::
Structure
structure
(
f
,
1
,
mmcif
::
StructureOpenOptions
::
SkipHydrogen
);
mmcif
::
DSSP
dssp
(
structure
,
3
,
true
);
mmcif
::
DSSP
dssp
(
structure
,
3
,
true
);
...
@@ -100,29 +102,14 @@ BOOST_AUTO_TEST_CASE(ut_mmcif)
...
@@ -100,29 +102,14 @@ BOOST_AUTO_TEST_CASE(ut_mmcif)
annotateDSSP
(
structure
,
dssp
,
true
,
test
);
annotateDSSP
(
structure
,
dssp
,
true
,
test
);
std
::
ifstream
reference
(
"1cbs-dssp.cif"
);
mmcif
::
File
rf
(
"1cbs-dssp.cif"
);
mmcif
::
Structure
rs
(
rf
,
1
,
mmcif
::
StructureOpenOptions
::
SkipHydrogen
);
BOOST_ASSERT
(
reference
.
is_open
());
std
::
string
line_t
,
line_r
;
for
(
int
line_nr
=
1
;
;
++
line_nr
)
{
bool
done_t
=
not
std
::
getline
(
test
,
line_t
);
bool
done_r
=
not
std
::
getline
(
reference
,
line_r
);
BOOST_CHECK_EQUAL
(
done_r
,
done_t
);
if
(
done_r
)
break
;
if
(
line_t
!=
line_r
)
std
::
cerr
<<
line_nr
<<
std
::
endl
<<
line_t
<<
std
::
endl
<<
line_r
<<
std
::
endl
;
BOOST_CHECK
(
line_t
==
line_r
);
structure
.
datablock
()[
"software"
].
erase
(
"name"
_key
==
"dssp"
);
}
rs
.
datablock
()[
"software"
].
erase
(
"name"
_key
==
"dssp"
);
// generate some output on different files:
cif
::
VERBOSE
=
2
;
BOOST_CHECK
(
test
.
eof
());
BOOST_CHECK
(
structure
.
datablock
()
==
rs
.
datablock
());
BOOST_CHECK
(
reference
.
eof
());
}
}
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