Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
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
libcifpp
Commits
238c8811
Unverified
Commit
238c8811
authored
Jan 25, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dependencies, version string
parent
49dc7335
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
65 deletions
+12
-65
CMakeLists.txt
+5
-31
Config.cmake.in
+2
-1
src/CifUtils.cpp
+5
-33
No files found.
CMakeLists.txt
View file @
238c8811
...
@@ -121,20 +121,6 @@ if(MSVC)
...
@@ -121,20 +121,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
()
# for mrc, just in case
list
(
APPEND CMAKE_PREFIX_PATH
"$ENV{LOCALAPPDATA}/mrc"
)
endif
()
endif
()
if
(
UNIX AND NOT APPLE AND NOT BUILD_FOR_CCP4 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
if
(
UNIX AND NOT APPLE AND NOT BUILD_FOR_CCP4 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
)
...
@@ -184,21 +170,8 @@ include(FindAtomic)
...
@@ -184,21 +170,8 @@ include(FindAtomic)
list
(
APPEND CIFPP_REQUIRED_LIBRARIES
${
STDCPPATOMIC_LIBRARY
}
)
list
(
APPEND CIFPP_REQUIRED_LIBRARIES
${
STDCPPATOMIC_LIBRARY
}
)
# Create a revision file, containing the current git version info
# Create a revision file, containing the current git version info
include
(
VersionString
)
include
(
GetGitRevisionDescription
)
write_version_header
(
"LibCIFPP"
)
option
(
GENERATE_CUSTOM_VERSION
"Generate a custom version string"
OFF
)
if
(
GIT-NOTFOUND OR HEAD-HASH-NOTFOUND OR NOT GENERATE_CUSTOM_VERSION
)
get_git_head_revision
(
REFSPEC COMMITHASH
)
# Generate our own version string
git_describe_working_tree
(
BUILD_VERSION_STRING --match=build --dirty
)
else
()
SET
(
BUILD_VERSION_STRING
${
PROJECT_VERSION
}
)
endif
()
# generate version.h
string
(
TIMESTAMP BUILD_DATE_TIME
"%Y-%m-%dT%H:%M:%SZ"
UTC
)
configure_file
(
"
${
CMAKE_SOURCE_DIR
}
/src/revision.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/revision.hpp"
@ONLY
)
# SymOp data table
# SymOp data table
if
(
CIFPP_RECREATE_SYMOP_DATA
)
if
(
CIFPP_RECREATE_SYMOP_DATA
)
...
@@ -277,7 +250,8 @@ target_include_directories(cifpp
...
@@ -277,7 +250,8 @@ target_include_directories(cifpp
${
CMAKE_BINARY_DIR
}
${
CMAKE_BINARY_DIR
}
)
)
target_link_libraries
(
cifpp Threads::Threads
${
Boost_LIBRARIES
}
${
CIFPP_REQUIRED_LIBRARIES
}
)
target_link_libraries
(
cifpp PUBLIC Threads::Threads Boost::regex Boost::iostreams
${
CIFPP_REQUIRED_LIBRARIES
}
)
# target_link_libraries(cifpp PRIVATE)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
...
@@ -434,7 +408,7 @@ if(CIFPP_BUILD_TESTS)
...
@@ -434,7 +408,7 @@ if(CIFPP_BUILD_TESTS)
${
CMAKE_CURRENT_BINARY_DIR
}
# for config.h
${
CMAKE_CURRENT_BINARY_DIR
}
# for config.h
)
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp
${
Boost_LIBRARIES
}
${
CIFPP_REQUIRED_LIBRARIES
}
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp
Boost::program_options
${
CIFPP_REQUIRED_LIBRARIES
}
)
if
(
CIFPP_USE_RSRC
)
if
(
CIFPP_USE_RSRC
)
mrc_target_resources
(
${
CIFPP_TEST
}
${
CMAKE_SOURCE_DIR
}
/rsrc/mmcif_pdbx_v50.dic
)
mrc_target_resources
(
${
CIFPP_TEST
}
${
CMAKE_SOURCE_DIR
}
/rsrc/mmcif_pdbx_v50.dic
)
...
...
Config.cmake.in
View file @
238c8811
@PACKAGE_INIT@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
include(CMakeFindDependencyMacro)
find_dependency(Boost 1.70.0 REQUIRED COMPONENTS system iostreams regex program_options)
find_dependency(Threads)
find_dependency(Boost 1.70.0 REQUIRED COMPONENTS system iostreams regex)
if(NOT WIN32)
if(NOT WIN32)
find_dependency(ZLIB)
find_dependency(ZLIB)
endif()
endif()
...
...
src/CifUtils.cpp
View file @
238c8811
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
#include "cif++/CifUtils.hpp"
#include "cif++/CifUtils.hpp"
#include "revision.hpp"
namespace
ba
=
boost
::
algorithm
;
namespace
ba
=
boost
::
algorithm
;
namespace
fs
=
std
::
filesystem
;
namespace
fs
=
std
::
filesystem
;
...
@@ -57,39 +59,9 @@ extern int VERBOSE;
...
@@ -57,39 +59,9 @@ extern int VERBOSE;
std
::
string
get_version_nr
()
std
::
string
get_version_nr
()
{
{
const
std
::
regex
std
::
ostringstream
s
;
rxVersionNr1
(
R"(build-(\d+)-g[0-9a-f]{7}(-dirty)?)"
),
write_version_string
(
s
,
false
);
rxVersionNr2
(
R"(libcifpp-version: (\d+\.\d+\.\d+))"
);
return
s
.
str
();
#include "revision.hpp"
struct
membuf
:
public
std
::
streambuf
{
membuf
(
char
*
data
,
size_t
length
)
{
this
->
setg
(
data
,
data
,
data
+
length
);
}
}
buffer
(
const_cast
<
char
*>
(
kRevision
),
sizeof
(
kRevision
));
std
::
istream
is
(
&
buffer
);
std
::
string
line
,
result
;
while
(
getline
(
is
,
line
))
{
std
::
smatch
m
;
if
(
std
::
regex_match
(
line
,
m
,
rxVersionNr1
))
{
result
=
m
[
1
];
if
(
m
[
2
].
matched
)
result
+=
'*'
;
break
;
}
// always the first, replace with more specific if followed by the other info
if
(
std
::
regex_match
(
line
,
m
,
rxVersionNr2
))
result
=
m
[
1
];
}
return
result
;
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
...
...
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