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
fb3b7bda
Unverified
Commit
fb3b7bda
authored
Oct 10, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made data dir options more visible in cmake config
better error reporting in file::load
parent
6d5efe1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
CMakeLists.txt
+8
-5
src/file.cpp
+4
-4
No files found.
CMakeLists.txt
View file @
fb3b7bda
...
...
@@ -37,6 +37,7 @@ include(CMakePackageConfigHelpers)
include
(
CheckCXXSourceCompiles
)
include
(
GenerateExportHeader
)
include
(
CTest
)
include
(
CMakeDependentOption
)
set
(
CXX_EXTENSIONS OFF
)
set
(
CMAKE_CXX_STANDARD 20
)
...
...
@@ -50,9 +51,6 @@ elseif(MSVC)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/W4"
)
endif
()
# Building shared libraries?
option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
)
# Build documentation?
option
(
BUILD_DOCUMENTATION
"Build the documentation"
OFF
)
...
...
@@ -62,6 +60,10 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Optionally build a version to be installed inside CCP4
option
(
BUILD_FOR_CCP4
"Build a version to be installed in CCP4"
OFF
)
# Building shared libraries?
cmake_policy
(
SET CMP0127 NEW
)
cmake_dependent_option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
"NOT (BUILD_FOR_CCP4 AND WIN32)"
ON
)
# Lots of code depend on the availability of the components.cif file
option
(
CIFPP_DOWNLOAD_CCD
"Download the CCD file components.cif during installation"
ON
)
...
...
@@ -317,11 +319,12 @@ if(CIFPP_DOWNLOAD_CCD)
endif
()
# Installation directories
set
(
CIFPP_DATA_DIR
"
${
CMAKE_INSTALL_FULL_DATADIR
}
/libcifpp"
)
set
(
CIFPP_DATA_DIR
"
${
CMAKE_INSTALL_FULL_DATADIR
}
/libcifpp"
CACHE PATH
"The directory where dictionary files are stored"
)
target_compile_definitions
(
cifpp PUBLIC DATA_DIR=
"
${
CIFPP_DATA_DIR
}
"
)
if
(
UNIX
)
set
(
CIFPP_CACHE_DIR
"
${
CMAKE_INSTALL_FULL_LOCALSTATEDIR
}
/cache/libcifpp"
)
set
(
CIFPP_CACHE_DIR
"
${
CMAKE_INSTALL_FULL_LOCALSTATEDIR
}
/cache/libcifpp"
CACHE PATH
"The directory where the update script stores new dictionary files"
)
target_compile_definitions
(
cifpp PUBLIC CACHE_DIR=
"
${
CIFPP_CACHE_DIR
}
"
)
set
(
CIFPP_ETC_DIR
"
${
CMAKE_INSTALL_FULL_SYSCONFDIR
}
"
)
...
...
src/file.cpp
View file @
fb3b7bda
...
...
@@ -182,17 +182,17 @@ std::tuple<file::iterator, bool> file::emplace(std::string_view name)
void
file
::
load
(
const
std
::
filesystem
::
path
&
p
)
{
try
{
gzio
::
ifstream
in
(
p
);
if
(
not
in
.
is_open
())
throw
std
::
runtime_error
(
"Could not open file "
+
p
.
string
()
);
throw
std
::
runtime_error
(
"Could not open file '"
+
p
.
string
()
+
'\''
);
try
{
load
(
in
);
}
catch
(
const
std
::
exception
&
)
{
throw_with_nested
(
std
::
runtime_error
(
"Error reading file
"
+
p
.
string
()
));
throw_with_nested
(
std
::
runtime_error
(
"Error reading file
'"
+
p
.
string
()
+
'\''
));
}
}
...
...
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