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
b36988e6
Unverified
Commit
b36988e6
authored
Jan 03, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update changelog
parent
393aefce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
416 additions
and
415 deletions
+416
-415
CMakeLists.txt
+415
-415
changelog
+1
-0
No files found.
CMakeLists.txt
View file @
b36988e6
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
# modification, are permitted provided that the following conditions are met:
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# 1. Redistributions of source code must retain the above copyright notice, this
#
list of conditions and the following disclaimer
# list of conditions and the following disclaimer
# 2. Redistributions in binary form must reproduce the above copyright notice,
# 2. Redistributions in binary form must reproduce the above copyright notice,
#
this list of conditions and the following disclaimer in the documentation
# this list of conditions and the following disclaimer in the documentation
#
and/or other materials provided with the distribution.
# and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
...
@@ -26,9 +26,9 @@ cmake_minimum_required(VERSION 3.16)
...
@@ -26,9 +26,9 @@ cmake_minimum_required(VERSION 3.16)
# set the project name
# set the project name
project
(
project
(
libcifpp
libcifpp
VERSION 6.0.1
VERSION 6.0.1
LANGUAGES CXX
)
LANGUAGES CXX
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
@@ -48,16 +48,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
...
@@ -48,16 +48,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# When building with ninja-multiconfig, build both debug and release by default
# When building with ninja-multiconfig, build both debug and release by default
if
(
CMAKE_GENERATOR STREQUAL
"Ninja Multi-Config"
)
if
(
CMAKE_GENERATOR STREQUAL
"Ninja Multi-Config"
)
set
(
CMAKE_CROSS_CONFIGS
"Debug;Release"
)
set
(
CMAKE_CROSS_CONFIGS
"Debug;Release"
)
set
(
CMAKE_DEFAULT_CONFIGS
"Debug;Release"
)
set
(
CMAKE_DEFAULT_CONFIGS
"Debug;Release"
)
endif
()
endif
()
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
)
set
(
CMAKE_CXX_FLAGS
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
)
)
elseif
(
MSVC
)
elseif
(
MSVC
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/W4"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/W4"
)
endif
()
endif
()
# Build documentation?
# Build documentation?
...
@@ -67,81 +67,81 @@ option(BUILD_DOCUMENTATION "Build the documentation" OFF)
...
@@ -67,81 +67,81 @@ option(BUILD_DOCUMENTATION "Build the documentation" OFF)
option
(
BUILD_FOR_CCP4
"Build a version to be installed in CCP4"
)
option
(
BUILD_FOR_CCP4
"Build a version to be installed in CCP4"
)
# Building shared libraries?
# Building shared libraries?
if
(
NOT
(
BUILD_FOR_CCP4 AND WIN32
))
if
(
NOT
(
BUILD_FOR_CCP4 AND WIN32
))
option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
)
option
(
BUILD_SHARED_LIBS
"Build a shared library instead of a static one"
OFF
)
endif
()
endif
()
if
(
BUILD_FOR_CCP4
)
if
(
BUILD_FOR_CCP4
)
unset
(
CIFPP_DOWNLOAD_CCD
)
unset
(
CIFPP_DOWNLOAD_CCD
)
unset
(
CIFPP_INSTALL_UPDATE_SCRIPT
)
unset
(
CIFPP_INSTALL_UPDATE_SCRIPT
)
else
()
else
()
# Lots of code depend on the availability of the components.cif file
# Lots of code depend on the availability of the components.cif file
option
(
CIFPP_DOWNLOAD_CCD
option
(
CIFPP_DOWNLOAD_CCD
"Download the CCD file components.cif during installation"
ON
)
"Download the CCD file components.cif during installation"
ON
)
# An optional cron script can be installed to keep the data files up-to-date
# An optional cron script can be installed to keep the data files up-to-date
if
(
UNIX AND NOT APPLE
)
if
(
UNIX AND NOT APPLE
)
option
(
CIFPP_INSTALL_UPDATE_SCRIPT
option
(
CIFPP_INSTALL_UPDATE_SCRIPT
"Install the script to update CCD and dictionary files"
ON
)
"Install the script to update CCD and dictionary files"
ON
)
endif
()
endif
()
endif
()
endif
()
# When CCP4 is sourced in the environment, we can recreate the symmetry
# When CCP4 is sourced in the environment, we can recreate the symmetry
# operations table
# operations table
if
(
EXISTS
"$ENV{CCP4}/lib/data/syminfo.lib"
)
if
(
EXISTS
"$ENV{CCP4}/lib/data/syminfo.lib"
)
option
(
CIFPP_RECREATE_SYMOP_DATA
option
(
CIFPP_RECREATE_SYMOP_DATA
"Recreate SymOp data table in case it is out of date"
ON
)
"Recreate SymOp data table in case it is out of date"
ON
)
endif
()
endif
()
# CCP4 build
# CCP4 build
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}
)
message
(
FATAL_ERROR
"A CCP4 built was requested but CCP4 was not sourced"
)
message
(
FATAL_ERROR
"A CCP4 built was requested but CCP4 was not sourced"
)
else
()
else
()
list
(
PREPEND CMAKE_MODULE_PATH
"$ENV{CCP4}"
)
list
(
PREPEND CMAKE_MODULE_PATH
"$ENV{CCP4}"
)
list
(
PREPEND CMAKE_PREFIX_PATH
"$ENV{CCP4}"
)
list
(
PREPEND CMAKE_PREFIX_PATH
"$ENV{CCP4}"
)
set
(
CMAKE_INSTALL_PREFIX
"$ENV{CCP4}"
)
set
(
CMAKE_INSTALL_PREFIX
"$ENV{CCP4}"
)
if
(
WIN32
)
if
(
WIN32
)
set
(
BUILD_SHARED_LIBS ON
)
set
(
BUILD_SHARED_LIBS ON
)
endif
()
endif
()
endif
()
endif
()
endif
()
endif
()
# Now include the GNUInstallDirs module
# Now include the GNUInstallDirs module
include
(
GNUInstallDirs
)
include
(
GNUInstallDirs
)
if
(
WIN32
)
if
(
WIN32
)
if
(
${
CMAKE_SYSTEM_VERSION
}
GREATER_EQUAL 10
)
# Windows 10
if
(
${
CMAKE_SYSTEM_VERSION
}
GREATER_EQUAL 10
)
# Windows 10
add_definitions
(
-D _WIN32_WINNT=0x0A00
)
add_definitions
(
-D _WIN32_WINNT=0x0A00
)
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.3
)
# Windows 8.1
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.3
)
# Windows 8.1
add_definitions
(
-D _WIN32_WINNT=0x0603
)
add_definitions
(
-D _WIN32_WINNT=0x0603
)
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.2
)
# Windows 8
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.2
)
# Windows 8
add_definitions
(
-D _WIN32_WINNT=0x0602
)
add_definitions
(
-D _WIN32_WINNT=0x0602
)
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.1
)
# Windows 7
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.1
)
# Windows 7
add_definitions
(
-D _WIN32_WINNT=0x0601
)
add_definitions
(
-D _WIN32_WINNT=0x0601
)
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.0
)
# Windows Vista
elseif
(
${
CMAKE_SYSTEM_VERSION
}
EQUAL 6.0
)
# Windows Vista
add_definitions
(
-D _WIN32_WINNT=0x0600
)
add_definitions
(
-D _WIN32_WINNT=0x0600
)
else
()
# Windows XP (5.1)
else
()
# Windows XP (5.1)
add_definitions
(
-D _WIN32_WINNT=0x0501
)
add_definitions
(
-D _WIN32_WINNT=0x0501
)
endif
()
endif
()
add_definitions
(
-DNOMINMAX
)
add_definitions
(
-DNOMINMAX
)
# We do not want to write an export file for all our symbols...
# We do not want to write an export file for all our symbols...
set
(
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON
)
set
(
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON
)
endif
()
endif
()
if
(
MSVC
)
if
(
MSVC
)
# make msvc standards compliant...
# make msvc standards compliant...
add_compile_options
(
/permissive- /bigobj
)
add_compile_options
(
/permissive- /bigobj
)
add_link_options
(
/NODEFAULTLIB:library
)
add_link_options
(
/NODEFAULTLIB:library
)
if
(
BUILD_SHARED_LIBS
)
if
(
BUILD_SHARED_LIBS
)
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
)
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
)
else
()
else
()
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
endif
()
endif
()
endif
()
# Libraries
# Libraries
...
@@ -150,43 +150,43 @@ endif()
...
@@ -150,43 +150,43 @@ endif()
# implementation in GCC is not acceptable, it crashes on long lines. The
# implementation in GCC is not acceptable, it crashes on long lines. The
# implementation in libc++ (clang) and MSVC seem to be OK.
# implementation in libc++ (clang) and MSVC seem to be OK.
check_cxx_source_compiles
(
check_cxx_source_compiles
(
"
"
#include <iostream>
#include <iostream>
#ifndef __GLIBCXX__
#ifndef __GLIBCXX__
#error
#error
#endif
#endif
int main(int argc, char *argv[]) { return 0; }"
int main(int argc, char *argv[]) { return 0; }"
GXX_LIBSTDCPP
)
GXX_LIBSTDCPP
)
if
(
GXX_LIBSTDCPP
)
if
(
GXX_LIBSTDCPP
)
message
(
message
(
STATUS
"Testing for known regex bug, since you're using GNU libstdc++"
)
STATUS
"Testing for known regex bug, since you're using GNU libstdc++"
)
try_run
(
STD_REGEX_RUNNING STD_REGEX_COMPILING
try_run
(
STD_REGEX_RUNNING STD_REGEX_COMPILING
${
CMAKE_CURRENT_BINARY_DIR
}
/test
${
CMAKE_CURRENT_BINARY_DIR
}
/test
${
PROJECT_SOURCE_DIR
}
/cmake/test-rx.cpp
)
${
PROJECT_SOURCE_DIR
}
/cmake/test-rx.cpp
)
if
(
STD_REGEX_RUNNING STREQUAL FAILED_TO_RUN
)
if
(
STD_REGEX_RUNNING STREQUAL FAILED_TO_RUN
)
message
(
message
(
STATUS
STATUS
"You are probably trying to compile using the g++ standard library which contains a crashing std::regex implementation. Will use boost::regex instead"
"You are probably trying to compile using the g++ standard library which contains a crashing std::regex implementation. Will use boost::regex instead"
)
)
find_package
(
Boost 1.80 QUIET COMPONENTS regex
)
find_package
(
Boost 1.80 QUIET COMPONENTS regex
)
if
(
NOT Boost_FOUND
)
if
(
NOT Boost_FOUND
)
set
(
BOOST_REGEX_STANDALONE ON
)
set
(
BOOST_REGEX_STANDALONE ON
)
FetchContent_Declare
(
FetchContent_Declare
(
boost-rx
boost-rx
GIT_REPOSITORY https://github.com/boostorg/regex
GIT_REPOSITORY https://github.com/boostorg/regex
GIT_TAG boost-1.83.0
)
GIT_TAG boost-1.83.0
)
FetchContent_MakeAvailable
(
boost-rx
)
FetchContent_MakeAvailable
(
boost-rx
)
endif
()
endif
()
set
(
BOOST_REGEX ON
)
set
(
BOOST_REGEX ON
)
endif
()
endif
()
endif
()
endif
()
set
(
CMAKE_THREAD_PREFER_PTHREAD
)
set
(
CMAKE_THREAD_PREFER_PTHREAD
)
...
@@ -194,31 +194,31 @@ set(THREADS_PREFER_PTHREAD_FLAG)
...
@@ -194,31 +194,31 @@ set(THREADS_PREFER_PTHREAD_FLAG)
find_package
(
Threads
)
find_package
(
Threads
)
if
(
MSVC
)
if
(
MSVC
)
# Avoid linking the shared library of zlib Search ZLIB_ROOT first if it is
# Avoid linking the shared library of zlib Search ZLIB_ROOT first if it is
# set.
# set.
if
(
ZLIB_ROOT
)
if
(
ZLIB_ROOT
)
set
(
_ZLIB_SEARCH_ROOT PATHS
${
ZLIB_ROOT
}
NO_DEFAULT_PATH
)
set
(
_ZLIB_SEARCH_ROOT PATHS
${
ZLIB_ROOT
}
NO_DEFAULT_PATH
)
list
(
APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT
)
list
(
APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT
)
endif
()
endif
()
# Normal search.
# Normal search.
set
(
_ZLIB_x86
"(x86)"
)
set
(
_ZLIB_x86
"(x86)"
)
set
(
_ZLIB_SEARCH_NORMAL
set
(
_ZLIB_SEARCH_NORMAL
PATHS
"[HKEY_LOCAL_MACHINE
\\
SOFTWARE
\\
GnuWin32
\\
Zlib;InstallPath]"
PATHS
"[HKEY_LOCAL_MACHINE
\\
SOFTWARE
\\
GnuWin32
\\
Zlib;InstallPath]"
"$ENV{ProgramFiles}/zlib"
"$ENV{ProgramFiles
${
_ZLIB_x86
}
}/zlib"
)
"$ENV{ProgramFiles}/zlib"
"$ENV{ProgramFiles
${
_ZLIB_x86
}
}/zlib"
)
unset
(
_ZLIB_x86
)
unset
(
_ZLIB_x86
)
list
(
APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL
)
list
(
APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL
)
if
(
BUILD_FOR_CCP4
)
if
(
BUILD_FOR_CCP4
)
list
(
PREPEND _ZLIB_SEARCHES
"$ENV{CCP4}/lib"
)
list
(
PREPEND _ZLIB_SEARCHES
"$ENV{CCP4}/lib"
)
endif
()
endif
()
foreach
(
search
${
_ZLIB_SEARCHES
}
)
foreach
(
search
${
_ZLIB_SEARCHES
}
)
find_library
(
find_library
(
ZLIB_LIBRARY
ZLIB_LIBRARY
NAMES zlibstatic NAMES_PER_DIR
${${
search
}}
NAMES zlibstatic NAMES_PER_DIR
${${
search
}}
PATH_SUFFIXES lib
)
PATH_SUFFIXES lib
)
endforeach
()
endforeach
()
endif
()
endif
()
find_package
(
ZLIB REQUIRED
)
find_package
(
ZLIB REQUIRED
)
...
@@ -229,22 +229,22 @@ find_package(ZLIB REQUIRED)
...
@@ -229,22 +229,22 @@ find_package(ZLIB REQUIRED)
find_package
(
Eigen3 3.4 QUIET
)
find_package
(
Eigen3 3.4 QUIET
)
if
(
Eigen3_FOUND AND TARGET Eigen3::Eigen
)
if
(
Eigen3_FOUND AND TARGET Eigen3::Eigen
)
get_target_property
(
EIGEN_INCLUDE_DIR Eigen3::Eigen
get_target_property
(
EIGEN_INCLUDE_DIR Eigen3::Eigen
INTERFACE_INCLUDE_DIRECTORIES
)
INTERFACE_INCLUDE_DIRECTORIES
)
else
()
else
()
# Create a private copy of eigen3 and populate it only, no need to build
# Create a private copy of eigen3 and populate it only, no need to build
FetchContent_Declare
(
FetchContent_Declare
(
my-eigen3
my-eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0
)
GIT_TAG 3.4.0
)
FetchContent_GetProperties
(
my-eigen3
)
FetchContent_GetProperties
(
my-eigen3
)
if
(
NOT my-eigen3_POPULATED
)
if
(
NOT my-eigen3_POPULATED
)
FetchContent_Populate
(
my-eigen3
)
FetchContent_Populate
(
my-eigen3
)
endif
()
endif
()
set
(
EIGEN_INCLUDE_DIR
${
my-eigen3_SOURCE_DIR
}
)
set
(
EIGEN_INCLUDE_DIR
${
my-eigen3_SOURCE_DIR
}
)
endif
()
endif
()
include
(
FindFilesystem
)
include
(
FindFilesystem
)
...
@@ -259,286 +259,286 @@ write_version_header(${PROJECT_SOURCE_DIR}/src/ LIB_NAME "LibCIFPP")
...
@@ -259,286 +259,286 @@ write_version_header(${PROJECT_SOURCE_DIR}/src/ LIB_NAME "LibCIFPP")
# SymOp data table
# SymOp data table
if
(
CIFPP_RECREATE_SYMOP_DATA
)
if
(
CIFPP_RECREATE_SYMOP_DATA
)
# The tool to create the table
# The tool to create the table
add_executable
(
symop-map-generator
add_executable
(
symop-map-generator
"
${
PROJECT_SOURCE_DIR
}
/src/symop-map-generator.cpp"
)
"
${
PROJECT_SOURCE_DIR
}
/src/symop-map-generator.cpp"
)
add_custom_command
(
add_custom_command
(
OUTPUT
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
OUTPUT
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
COMMAND
COMMAND
$<TARGET_FILE:symop-map-generator> $ENV{CLIBD}/syminfo.lib
$<TARGET_FILE:symop-map-generator> $ENV{CLIBD}/syminfo.lib
$ENV{CLIBD}/symop.lib
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
)
$ENV{CLIBD}/symop.lib
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
)
add_custom_target
(
add_custom_target
(
OUTPUT
OUTPUT
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
DEPENDS symop-map-generator
"$ENV{CLIBD}/syminfo.lib"
DEPENDS symop-map-generator
"$ENV{CLIBD}/syminfo.lib"
"$ENV{CLIBD}/symop.lib"
)
"$ENV{CLIBD}/symop.lib"
)
endif
()
endif
()
# Sources
# Sources
set
(
project_sources
set
(
project_sources
${
PROJECT_SOURCE_DIR
}
/src/category.cpp
${
PROJECT_SOURCE_DIR
}
/src/category.cpp
${
PROJECT_SOURCE_DIR
}
/src/condition.cpp
${
PROJECT_SOURCE_DIR
}
/src/condition.cpp
${
PROJECT_SOURCE_DIR
}
/src/datablock.cpp
${
PROJECT_SOURCE_DIR
}
/src/datablock.cpp
${
PROJECT_SOURCE_DIR
}
/src/dictionary_parser.cpp
${
PROJECT_SOURCE_DIR
}
/src/dictionary_parser.cpp
${
PROJECT_SOURCE_DIR
}
/src/file.cpp
${
PROJECT_SOURCE_DIR
}
/src/file.cpp
${
PROJECT_SOURCE_DIR
}
/src/item.cpp
${
PROJECT_SOURCE_DIR
}
/src/item.cpp
${
PROJECT_SOURCE_DIR
}
/src/parser.cpp
${
PROJECT_SOURCE_DIR
}
/src/parser.cpp
${
PROJECT_SOURCE_DIR
}
/src/row.cpp
${
PROJECT_SOURCE_DIR
}
/src/row.cpp
${
PROJECT_SOURCE_DIR
}
/src/validate.cpp
${
PROJECT_SOURCE_DIR
}
/src/validate.cpp
${
PROJECT_SOURCE_DIR
}
/src/text.cpp
${
PROJECT_SOURCE_DIR
}
/src/text.cpp
${
PROJECT_SOURCE_DIR
}
/src/utilities.cpp
${
PROJECT_SOURCE_DIR
}
/src/utilities.cpp
${
PROJECT_SOURCE_DIR
}
/src/atom_type.cpp
${
PROJECT_SOURCE_DIR
}
/src/atom_type.cpp
${
PROJECT_SOURCE_DIR
}
/src/compound.cpp
${
PROJECT_SOURCE_DIR
}
/src/compound.cpp
${
PROJECT_SOURCE_DIR
}
/src/point.cpp
${
PROJECT_SOURCE_DIR
}
/src/point.cpp
${
PROJECT_SOURCE_DIR
}
/src/symmetry.cpp
${
PROJECT_SOURCE_DIR
}
/src/symmetry.cpp
${
PROJECT_SOURCE_DIR
}
/src/model.cpp
${
PROJECT_SOURCE_DIR
}
/src/model.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/cif2pdb.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/cif2pdb.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb_record.hpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb_record.hpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif_remark_3.hpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif_remark_3.hpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif_remark_3.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/pdb2cif_remark_3.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/reconstruct.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/reconstruct.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/validate-pdbx.cpp
${
PROJECT_SOURCE_DIR
}
/src/pdb/validate-pdbx.cpp
)
)
set
(
project_headers
set
(
project_headers
${
PROJECT_SOURCE_DIR
}
/include/cif++.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/utilities.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/utilities.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/item.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/item.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/datablock.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/datablock.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/file.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/file.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/validate.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/validate.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/iterator.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/iterator.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/parser.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/parser.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/forward_decl.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/forward_decl.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/dictionary_parser.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/dictionary_parser.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/condition.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/condition.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/category.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/category.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/row.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/row.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/atom_type.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/atom_type.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/compound.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/compound.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/point.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/point.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/symmetry.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/symmetry.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/model.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/model.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/cif2pdb.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/cif2pdb.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/io.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/io.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/pdb2cif.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/pdb2cif.hpp
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/tls.hpp
)
${
PROJECT_SOURCE_DIR
}
/include/cif++/pdb/tls.hpp
)
add_library
(
cifpp
${
project_sources
}
${
project_headers
}
add_library
(
cifpp
${
project_sources
}
${
project_headers
}
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
)
${
PROJECT_SOURCE_DIR
}
/src/symop_table_data.hpp
)
add_library
(
cifpp::cifpp ALIAS cifpp
)
add_library
(
cifpp::cifpp ALIAS cifpp
)
set
(
CMAKE_DEBUG_POSTFIX d
)
set
(
CMAKE_DEBUG_POSTFIX d
)
set_target_properties
(
cifpp PROPERTIES DEBUG_POSTFIX
"d"
)
set_target_properties
(
cifpp PROPERTIES DEBUG_POSTFIX
"d"
)
generate_export_header
(
cifpp EXPORT_FILE_NAME
generate_export_header
(
cifpp EXPORT_FILE_NAME
${
PROJECT_SOURCE_DIR
}
/include/cif++/exports.hpp
)
${
PROJECT_SOURCE_DIR
}
/include/cif++/exports.hpp
)
if
(
BOOST_REGEX
)
if
(
BOOST_REGEX
)
target_compile_definitions
(
cifpp PRIVATE USE_BOOST_REGEX=1
target_compile_definitions
(
cifpp PRIVATE USE_BOOST_REGEX=1
BOOST_REGEX_STANDALONE=1
)
BOOST_REGEX_STANDALONE=1
)
get_target_property
(
BOOST_REGEX_INCLUDE_DIR Boost::regex
get_target_property
(
BOOST_REGEX_INCLUDE_DIR Boost::regex
INTERFACE_INCLUDE_DIRECTORIES
)
INTERFACE_INCLUDE_DIRECTORIES
)
endif
()
endif
()
if
(
MSVC
)
if
(
MSVC
)
target_compile_definitions
(
cifpp PUBLIC NOMINMAX=1
)
target_compile_definitions
(
cifpp PUBLIC NOMINMAX=1
)
endif
()
endif
()
set_target_properties
(
cifpp PROPERTIES POSITION_INDEPENDENT_CODE ON
)
set_target_properties
(
cifpp PROPERTIES POSITION_INDEPENDENT_CODE ON
)
target_include_directories
(
target_include_directories
(
cifpp
cifpp
PUBLIC
"$<BUILD_INTERFACE:
${
PROJECT_SOURCE_DIR
}
/include>"
PUBLIC
"$<BUILD_INTERFACE:
${
PROJECT_SOURCE_DIR
}
/include>"
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
PRIVATE
"
${
BOOST_REGEX_INCLUDE_DIR
}
"
"
${
EIGEN_INCLUDE_DIR
}
"
)
PRIVATE
"
${
BOOST_REGEX_INCLUDE_DIR
}
"
"
${
EIGEN_INCLUDE_DIR
}
"
)
target_link_libraries
(
cifpp PUBLIC Threads::Threads ZLIB::ZLIB
target_link_libraries
(
cifpp PUBLIC Threads::Threads ZLIB::ZLIB
${
CIFPP_REQUIRED_LIBRARIES
}
)
${
CIFPP_REQUIRED_LIBRARIES
}
)
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
)
endif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
endif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
if
(
CIFPP_DOWNLOAD_CCD
)
if
(
CIFPP_DOWNLOAD_CCD
)
# download the components.cif file from CCD
# download the components.cif file from CCD
set
(
COMPONENTS_CIF
${
PROJECT_SOURCE_DIR
}
/rsrc/components.cif
)
set
(
COMPONENTS_CIF
${
PROJECT_SOURCE_DIR
}
/rsrc/components.cif
)
if
(
EXISTS
${
COMPONENTS_CIF
}
)
if
(
EXISTS
${
COMPONENTS_CIF
}
)
file
(
SIZE
${
COMPONENTS_CIF
}
CCD_FILE_SIZE
)
file
(
SIZE
${
COMPONENTS_CIF
}
CCD_FILE_SIZE
)
if
(
CCD_FILE_SIZE EQUAL 0
)
if
(
CCD_FILE_SIZE EQUAL 0
)
message
(
STATUS
"Removing empty
${
COMPONENTS_CIF
}
file"
)
message
(
STATUS
"Removing empty
${
COMPONENTS_CIF
}
file"
)
file
(
REMOVE
"
${
COMPONENTS_CIF
}
"
)
file
(
REMOVE
"
${
COMPONENTS_CIF
}
"
)
endif
()
endif
()
endif
()
endif
()
if
(
NOT EXISTS
${
COMPONENTS_CIF
}
)
if
(
NOT EXISTS
${
COMPONENTS_CIF
}
)
# Since the file(DOWNLOAD) command in cmake does not use compression, we try
# Since the file(DOWNLOAD) command in cmake does not use compression, we try
# to download the gzipped version and decompress it ourselves.
# to download the gzipped version and decompress it ourselves.
find_program
(
GUNZIP gunzip
)
find_program
(
GUNZIP gunzip
)
if
(
WIN32 OR GUNZIP STREQUAL
"GUNZIP-NOTFOUND"
)
if
(
WIN32 OR GUNZIP STREQUAL
"GUNZIP-NOTFOUND"
)
file
(
file
(
DOWNLOAD https://files.wwpdb.org/pub/pdb/data/monomers/components.cif
DOWNLOAD https://files.wwpdb.org/pub/pdb/data/monomers/components.cif
${
COMPONENTS_CIF
}
${
COMPONENTS_CIF
}
SHOW_PROGRESS
SHOW_PROGRESS
STATUS CCD_FETCH_STATUS
)
STATUS CCD_FETCH_STATUS
)
else
()
else
()
if
(
NOT EXISTS
"
${
COMPONENTS_CIF
}
.gz"
)
if
(
NOT EXISTS
"
${
COMPONENTS_CIF
}
.gz"
)
file
(
file
(
DOWNLOAD
DOWNLOAD
https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
${
COMPONENTS_CIF
}
.gz
${
COMPONENTS_CIF
}
.gz
SHOW_PROGRESS
SHOW_PROGRESS
STATUS CCD_FETCH_STATUS
)
STATUS CCD_FETCH_STATUS
)
endif
()
endif
()
add_custom_command
(
add_custom_command
(
OUTPUT
${
COMPONENTS_CIF
}
OUTPUT
${
COMPONENTS_CIF
}
COMMAND
"
${
GUNZIP
}
"
${
COMPONENTS_CIF
}
.gz
COMMAND
"
${
GUNZIP
}
"
${
COMPONENTS_CIF
}
.gz
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/rsrc/
)
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/rsrc/
)
add_custom_target
(
COMPONENTS ALL DEPENDS
${
COMPONENTS_CIF
}
)
add_custom_target
(
COMPONENTS ALL DEPENDS
${
COMPONENTS_CIF
}
)
endif
()
endif
()
# Do not continue if downloading went wrong
# Do not continue if downloading went wrong
list
(
POP_FRONT CCD_FETCH_STATUS CCD_FETCH_STATUS_CODE
)
list
(
POP_FRONT CCD_FETCH_STATUS CCD_FETCH_STATUS_CODE
)
if
(
CCD_FETCH_STATUS_CODE
)
if
(
CCD_FETCH_STATUS_CODE
)
message
(
message
(
FATAL_ERROR
"Error trying to download CCD file:
${
CCD_FETCH_STATUS
}
"
)
FATAL_ERROR
"Error trying to download CCD file:
${
CCD_FETCH_STATUS
}
"
)
endif
()
endif
()
endif
()
endif
()
endif
()
endif
()
# Installation directories
# Installation directories
if
(
BUILD_FOR_CCP4
)
if
(
BUILD_FOR_CCP4
)
set
(
CIFPP_DATA_DIR
set
(
CIFPP_DATA_DIR
"$ENV{CCP4}/share/libcifpp"
"$ENV{CCP4}/share/libcifpp"
CACHE PATH
"Directory where dictionary and other static data is stored"
)
CACHE PATH
"Directory where dictionary and other static data is stored"
)
else
()
else
()
set
(
CIFPP_DATA_DIR
set
(
CIFPP_DATA_DIR
"
${
CMAKE_INSTALL_FULL_DATADIR
}
/libcifpp"
"
${
CMAKE_INSTALL_FULL_DATADIR
}
/libcifpp"
CACHE PATH
"Directory where dictionary and other static data is stored"
)
CACHE PATH
"Directory where dictionary and other static data is stored"
)
endif
()
endif
()
if
(
CIFPP_DATA_DIR
)
if
(
CIFPP_DATA_DIR
)
target_compile_definitions
(
cifpp PUBLIC DATA_DIR=
"
${
CIFPP_DATA_DIR
}
"
)
target_compile_definitions
(
cifpp PUBLIC DATA_DIR=
"
${
CIFPP_DATA_DIR
}
"
)
endif
()
endif
()
if
(
UNIX AND NOT BUILD_FOR_CCP4
)
if
(
UNIX AND NOT BUILD_FOR_CCP4
)
if
(
"
${
CMAKE_INSTALL_PREFIX
}
"
STREQUAL
"/usr/local"
)
if
(
"
${
CMAKE_INSTALL_PREFIX
}
"
STREQUAL
"/usr/local"
)
set
(
CIFPP_CACHE_DIR
set
(
CIFPP_CACHE_DIR
"/var/cache/libcifpp"
"/var/cache/libcifpp"
CACHE PATH
"The directory where downloaded data files are stored"
)
CACHE PATH
"The directory where downloaded data files are stored"
)
else
()
else
()
set
(
CIFPP_CACHE_DIR
set
(
CIFPP_CACHE_DIR
"
${
CMAKE_INSTALL_FULL_LOCALSTATEDIR
}
/cache/libcifpp"
"
${
CMAKE_INSTALL_FULL_LOCALSTATEDIR
}
/cache/libcifpp"
CACHE PATH
"The directory where downloaded data files are stored"
)
CACHE PATH
"The directory where downloaded data files are stored"
)
endif
()
endif
()
target_compile_definitions
(
cifpp PUBLIC CACHE_DIR=
"
${
CIFPP_CACHE_DIR
}
"
)
target_compile_definitions
(
cifpp PUBLIC CACHE_DIR=
"
${
CIFPP_CACHE_DIR
}
"
)
set
(
CIFPP_ETC_DIR
set
(
CIFPP_ETC_DIR
"
${
CMAKE_INSTALL_FULL_SYSCONFDIR
}
"
"
${
CMAKE_INSTALL_FULL_SYSCONFDIR
}
"
CACHE PATH
"The directory where the update configuration file is stored"
)
CACHE PATH
"The directory where the update configuration file is stored"
)
else
()
else
()
unset
(
CIFPP_CACHE_DIR
)
unset
(
CIFPP_CACHE_DIR
)
endif
()
endif
()
# Install rules
# Install rules
install
(
install
(
TARGETS cifpp
TARGETS cifpp
EXPORT cifpp-targets
EXPORT cifpp-targets
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
INCLUDES
INCLUDES
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
if
(
MSVC AND BUILD_SHARED_LIBS
)
if
(
MSVC AND BUILD_SHARED_LIBS
)
install
(
install
(
FILES $<TARGET_PDB_FILE:cifpp>
FILES $<TARGET_PDB_FILE:cifpp>
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
OPTIONAL
)
OPTIONAL
)
endif
()
endif
()
# Clean up old config files (with old names)
# Clean up old config files (with old names)
file
(
GLOB OLD_CONFIG_FILES
file
(
GLOB OLD_CONFIG_FILES
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cifpp/cifppConfig*.cmake
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cifpp/cifppConfig*.cmake
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cifpp/cifppTargets*.cmake
)
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cifpp/cifppTargets*.cmake
)
if
(
OLD_CONFIG_FILES
)
if
(
OLD_CONFIG_FILES
)
message
(
message
(
STATUS
"Installation will remove old config files:
${
OLD_CONFIG_FILES
}
"
)
STATUS
"Installation will remove old config files:
${
OLD_CONFIG_FILES
}
"
)
install
(
CODE
"file(REMOVE
${
OLD_CONFIG_FILES
}
)"
)
install
(
CODE
"file(REMOVE
${
OLD_CONFIG_FILES
}
)"
)
endif
()
endif
()
install
(
install
(
EXPORT cifpp-targets
EXPORT cifpp-targets
FILE
"cifpp-targets.cmake"
FILE
"cifpp-targets.cmake"
NAMESPACE cifpp::
NAMESPACE cifpp::
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
)
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
)
install
(
install
(
DIRECTORY include/cif++
DIRECTORY include/cif++
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
COMPONENT Devel
)
COMPONENT Devel
)
install
(
install
(
FILES include/cif++.hpp
FILES include/cif++.hpp
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
COMPONENT Devel
)
COMPONENT Devel
)
if
(
CIFPP_DATA_DIR
)
if
(
CIFPP_DATA_DIR
)
install
(
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ma.dic
${
COMPONENTS_CIF
}
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ma.dic
${
COMPONENTS_CIF
}
DESTINATION
${
CIFPP_DATA_DIR
}
)
DESTINATION
${
CIFPP_DATA_DIR
}
)
endif
()
endif
()
if
(
CIFPP_CACHE_DIR
)
if
(
CIFPP_CACHE_DIR
)
install
(
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ma.dic
${
COMPONENTS_CIF
}
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ma.dic
${
COMPONENTS_CIF
}
DESTINATION
${
CIFPP_CACHE_DIR
}
)
DESTINATION
${
CIFPP_CACHE_DIR
}
)
endif
()
endif
()
set
(
CONFIG_TEMPLATE_FILE
${
PROJECT_SOURCE_DIR
}
/cmake/cifpp-config.cmake.in
)
set
(
CONFIG_TEMPLATE_FILE
${
PROJECT_SOURCE_DIR
}
/cmake/cifpp-config.cmake.in
)
configure_package_config_file
(
configure_package_config_file
(
${
CONFIG_TEMPLATE_FILE
}
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config.cmake
${
CONFIG_TEMPLATE_FILE
}
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config.cmake
INSTALL_DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
INSTALL_DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
PATH_VARS CIFPP_DATA_DIR
)
PATH_VARS CIFPP_DATA_DIR
)
install
(
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config.cmake"
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config-version.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config-version.cmake"
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/cifpp
COMPONENT Devel
)
COMPONENT Devel
)
set_target_properties
(
set_target_properties
(
cifpp
cifpp
PROPERTIES VERSION
${
PROJECT_VERSION
}
PROPERTIES VERSION
${
PROJECT_VERSION
}
SOVERSION
"
${
PROJECT_VERSION_MAJOR
}
.
${
PROJECT_VERSION_MINOR
}
"
SOVERSION
"
${
PROJECT_VERSION_MAJOR
}
.
${
PROJECT_VERSION_MINOR
}
"
INTERFACE_cifpp_MAJOR_VERSION
${
PROJECT_VERSION_MAJOR
}
)
INTERFACE_cifpp_MAJOR_VERSION
${
PROJECT_VERSION_MAJOR
}
)
set_property
(
set_property
(
TARGET cifpp
TARGET cifpp
APPEND
APPEND
PROPERTY COMPATIBLE_INTERFACE_STRING cifpp_MAJOR_VERSION
)
PROPERTY COMPATIBLE_INTERFACE_STRING cifpp_MAJOR_VERSION
)
write_basic_package_version_file
(
write_basic_package_version_file
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config-version.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cifpp/cifpp-config-version.cmake"
VERSION
${
PROJECT_VERSION
}
VERSION
${
PROJECT_VERSION
}
COMPATIBILITY AnyNewerVersion
)
COMPATIBILITY AnyNewerVersion
)
# In case we're included as sub_directory:
# In case we're included as sub_directory:
if
(
NOT PROJECT_IS_TOP_LEVEL
)
if
(
NOT PROJECT_IS_TOP_LEVEL
)
...
@@ -546,109 +546,109 @@ if(NOT PROJECT_IS_TOP_LEVEL)
...
@@ -546,109 +546,109 @@ if(NOT PROJECT_IS_TOP_LEVEL)
endif
()
endif
()
if
(
BUILD_TESTING
)
if
(
BUILD_TESTING
)
# We're using the older version 2 of Catch2
# We're using the older version 2 of Catch2
FetchContent_Declare
(
FetchContent_Declare
(
Catch2
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9
)
GIT_TAG v2.13.9
)
FetchContent_MakeAvailable
(
Catch2
)
FetchContent_MakeAvailable
(
Catch2
)
list
(
list
(
APPEND
APPEND
CIFPP_tests
CIFPP_tests
unit-v2
unit-v2
unit-3d
unit-3d
format
format
model
model
rename-compound
rename-compound
sugar
sugar
spinner
spinner
validate-pdbx
)
validate-pdbx
)
foreach
(
CIFPP_TEST IN LISTS CIFPP_tests
)
foreach
(
CIFPP_TEST IN LISTS CIFPP_tests
)
set
(
CIFPP_TEST
"
${
CIFPP_TEST
}
-test"
)
set
(
CIFPP_TEST
"
${
CIFPP_TEST
}
-test"
)
set
(
CIFPP_TEST_SOURCE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
CIFPP_TEST
}
.cpp"
)
set
(
CIFPP_TEST_SOURCE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
CIFPP_TEST
}
.cpp"
)
add_executable
(
add_executable
(
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test-main.cpp"
)
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test-main.cpp"
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp
Catch2::Catch2
)
Catch2::Catch2
)
target_include_directories
(
${
CIFPP_TEST
}
PRIVATE
"
${
EIGEN_INCLUDE_DIR
}
"
)
target_include_directories
(
${
CIFPP_TEST
}
PRIVATE
"
${
EIGEN_INCLUDE_DIR
}
"
)
if
(
MSVC
)
if
(
MSVC
)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options
(
${
CIFPP_TEST
}
PRIVATE /EHsc
)
target_compile_options
(
${
CIFPP_TEST
}
PRIVATE /EHsc
)
endif
()
endif
()
add_custom_target
(
add_custom_target
(
"run-
${
CIFPP_TEST
}
"
"run-
${
CIFPP_TEST
}
"
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
${
CIFPP_TEST
}
)
DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
${
CIFPP_TEST
}
)
add_custom_command
(
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/Run
${
CIFPP_TEST
}
.touch
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
add_test
(
NAME
${
CIFPP_TEST
}
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
add_test
(
NAME
${
CIFPP_TEST
}
COMMAND $<TARGET_FILE:
${
CIFPP_TEST
}
> --data-dir
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
endforeach
()
endforeach
()
endif
()
endif
()
# Optionally install the update scripts for CCD and dictionary files
# Optionally install the update scripts for CCD and dictionary files
if
(
CIFPP_INSTALL_UPDATE_SCRIPT
)
if
(
CIFPP_INSTALL_UPDATE_SCRIPT
)
if
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Linux"
OR
${
CMAKE_SYSTEM_NAME
}
STREQUAL
if
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Linux"
OR
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"GNU"
)
"GNU"
)
if
(
"
${
CMAKE_INSTALL_PREFIX
}
"
STREQUAL
"/usr/local"
)
if
(
"
${
CMAKE_INSTALL_PREFIX
}
"
STREQUAL
"/usr/local"
)
set
(
CIFPP_CRON_DIR
set
(
CIFPP_CRON_DIR
"/etc/cron.weekly"
"/etc/cron.weekly"
CACHE PATH
"The cron directory, for the update script"
)
CACHE PATH
"The cron directory, for the update script"
)
else
()
else
()
set
(
CIFPP_CRON_DIR
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/cron.weekly"
"
${
CIFPP_ETC_DIR
}
/cron.weekly"
CACHE PATH
"The cron directory, for the update script"
)
CACHE PATH
"The cron directory, for the update script"
)
endif
()
endif
()
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"FreeBSD"
)
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"FreeBSD"
)
set
(
CIFPP_CRON_DIR
set
(
CIFPP_CRON_DIR
"
${
CIFPP_ETC_DIR
}
/periodic/weekly"
"
${
CIFPP_ETC_DIR
}
/periodic/weekly"
CACHE PATH
"The cron directory, for the update script"
)
CACHE PATH
"The cron directory, for the update script"
)
else
()
else
()
message
(
FATAL_ERROR
"Don't know where to install the update script"
)
message
(
FATAL_ERROR
"Don't know where to install the update script"
)
endif
()
endif
()
configure_file
(
${
PROJECT_SOURCE_DIR
}
/tools/update-libcifpp-data.in
configure_file
(
${
PROJECT_SOURCE_DIR
}
/tools/update-libcifpp-data.in
update-libcifpp-data @ONLY
)
update-libcifpp-data @ONLY
)
install
(
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/update-libcifpp-data
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/update-libcifpp-data
DESTINATION
${
CIFPP_CRON_DIR
}
DESTINATION
${
CIFPP_CRON_DIR
}
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE
WORLD_READ
)
WORLD_READ
)
install
(
DIRECTORY DESTINATION
${
CIFPP_CACHE_DIR
}
)
install
(
DIRECTORY DESTINATION
${
CIFPP_CACHE_DIR
}
)
# a config file, to make it complete
# a config file, to make it complete
if
(
NOT EXISTS
"
${
CIFPP_ETC_DIR
}
/libcifpp.conf"
)
if
(
NOT EXISTS
"
${
CIFPP_ETC_DIR
}
/libcifpp.conf"
)
file
(
file
(
WRITE
${
CMAKE_CURRENT_BINARY_DIR
}
/libcifpp.conf
WRITE
${
CMAKE_CURRENT_BINARY_DIR
}
/libcifpp.conf
[[# Uncomment the next line to enable automatic updates
[[# Uncomment the next line to enable automatic updates
# update=true
# update=true
]]
)
]]
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/libcifpp.conf
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/libcifpp.conf
DESTINATION
"
${
CIFPP_ETC_DIR
}
"
)
DESTINATION
"
${
CIFPP_ETC_DIR
}
"
)
install
(
install
(
CODE
"message(
\"
A configuration file has been written to
${
CIFPP_ETC_DIR
}
/libcifpp.conf, please edit this file to enable automatic updates
\"
)"
CODE
"message(
\"
A configuration file has been written to
${
CIFPP_ETC_DIR
}
/libcifpp.conf, please edit this file to enable automatic updates
\"
)"
)
)
install
(
DIRECTORY DESTINATION
"
${
CIFPP_ETC_DIR
}
/libcifpp/cache-update.d"
)
install
(
DIRECTORY DESTINATION
"
${
CIFPP_ETC_DIR
}
/libcifpp/cache-update.d"
)
endif
()
endif
()
target_compile_definitions
(
cifpp PUBLIC CACHE_DIR=
"
${
CIFPP_CACHE_DIR
}
"
)
target_compile_definitions
(
cifpp PUBLIC CACHE_DIR=
"
${
CIFPP_CACHE_DIR
}
"
)
endif
()
endif
()
if
(
BUILD_DOCUMENTATION
)
if
(
BUILD_DOCUMENTATION
)
add_subdirectory
(
docs
)
add_subdirectory
(
docs
)
endif
()
endif
()
set
(
CPACK_RESOURCE_FILE_LICENSE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/LICENSE"
)
set
(
CPACK_RESOURCE_FILE_LICENSE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/LICENSE"
)
...
...
changelog
View file @
b36988e6
...
@@ -3,6 +3,7 @@ Version 6.0.1
...
@@ -3,6 +3,7 @@ Version 6.0.1
-
Change
order
of
categories
inside
a
datablock
to
match
order
in
file
-
Change
order
of
categories
inside
a
datablock
to
match
order
in
file
-
Change
default
order
to
write
out
categories
in
a
file
based
on
-
Change
default
order
to
write
out
categories
in
a
file
based
on
parent
/
child
relationship
parent
/
child
relationship
-
Added
validate_pdbx
and
recover_pdbx
Version
6.0.0
Version
6.0.0
-
Drop
the
use
of
CCP4
's monomer library for compound information
-
Drop
the
use
of
CCP4
's monomer library for compound information
...
...
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