Commit 1f8e491d by Maarten L. Hekkelman

generate exports header

parent 05cfa921
......@@ -35,10 +35,13 @@ include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CMakePackageConfigHelpers)
include(CheckCXXSourceCompiles)
include(GenerateExportHeader)
set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
......@@ -249,6 +252,7 @@ set(project_headers
add_library(cifpp ${project_sources} ${project_headers} ${PROJECT_SOURCE_DIR}/src/symop_table_data.hpp)
add_library(cifpp::cifpp ALIAS cifpp)
generate_export_header(cifpp EXPORT_FILE_NAME cif++/exports.hpp)
if(BOOST_REGEX)
target_compile_definitions(cifpp PRIVATE USE_BOOST_REGEX=1 BOOST_REGEX_STANDALONE=1)
......@@ -263,7 +267,7 @@ set_target_properties(cifpp PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(cifpp
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include;${PROJECT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
......@@ -343,6 +347,12 @@ install(
COMPONENT Devel
)
install(
FILES ${PROJECT_BINARY_DIR}/cif++/exports.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cif++
COMPONENT Devel
)
install(FILES
${PROJECT_SOURCE_DIR}/rsrc/mmcif_ddl.dic
${PROJECT_SOURCE_DIR}/rsrc/mmcif_pdbx.dic
......
......@@ -26,8 +26,6 @@
#pragma once
#include <array>
#include <cif++/forward_decl.hpp>
#include <cif++/condition.hpp>
......@@ -35,6 +33,8 @@
#include <cif++/row.hpp>
#include <cif++/validate.hpp>
#include <array>
// TODO: implement all of:
// https://en.cppreference.com/w/cpp/named_req/Container
// https://en.cppreference.com/w/cpp/named_req/SequenceContainer
......
......@@ -29,14 +29,14 @@
/// \file This file contains the definition for the class compound, encapsulating
/// the information found for compounds in the CCD.
#include <cif++.hpp>
#include <cif++/atom_type.hpp>
#include <map>
#include <set>
#include <tuple>
#include <vector>
#include <cif++.hpp>
#include <cif++/atom_type.hpp>
namespace cif
{
......@@ -188,4 +188,4 @@ class compound_factory
std::shared_ptr<compound_factory_impl> m_impl;
};
} // namespace pdbx
} // namespace cif
......@@ -26,14 +26,14 @@
#pragma once
#include <cif++/row.hpp>
#include <cassert>
#include <functional>
#include <iostream>
#include <regex>
#include <utility>
#include <cif++/row.hpp>
namespace cif
{
......
......@@ -26,9 +26,8 @@
#pragma once
#include <cif++/forward_decl.hpp>
#include <cif++/category.hpp>
#include <cif++/forward_decl.hpp>
namespace cif
{
......@@ -89,7 +88,7 @@ class datablock : public std::list<category>
}
// --------------------------------------------------------------------
bool operator==(const datablock &rhs) const;
private:
......
......@@ -26,6 +26,12 @@
#pragma once
#include <cif++/exports.hpp>
#include <cif++/forward_decl.hpp>
#include <cif++/text.hpp>
#include <cif++/utilities.hpp>
#include <cassert>
#include <charconv>
#include <cstring>
#include <iomanip>
......@@ -35,9 +41,6 @@
#include <optional>
#include <utility>
#include <cif++/forward_decl.hpp>
#include <cif++/text.hpp>
/// \file item.hpp
/// This file contains the declaration of item but also the item_value and item_handle
/// These handle the storage of and access to the data for a single data field.
......@@ -45,8 +48,6 @@
namespace cif
{
extern int VERBOSE;
// --------------------------------------------------------------------
/// \brief item is a transient class that is used to pass data into rows
/// but it also takes care of formatting data.
......@@ -353,7 +354,7 @@ struct item_handle
{
}
static const item_handle s_null_item;
CIFPP_EXPORT static const item_handle s_null_item;
friend void swap(item_handle a, item_handle b)
{
......
......@@ -26,10 +26,10 @@
#pragma once
#include <numeric>
#include <cif++/atom_type.hpp>
#include <numeric>
#if __cpp_lib_format
#include <format>
#endif
......
......@@ -26,11 +26,11 @@
#pragma once
#include <cif++/row.hpp>
#include <map>
#include <regex>
#include <cif++/row.hpp>
namespace cif
{
......
......@@ -26,12 +26,12 @@
#pragma once
#include <cif++.hpp>
#include <string>
#include <tuple>
#include <vector>
#include <cif++.hpp>
namespace cif
{
......
......@@ -26,6 +26,8 @@
#pragma once
#include <cif++/exports.hpp>
#include <array>
#include <cstdint>
#include <string>
......@@ -50,8 +52,8 @@ struct space_group
int nr;
};
extern const space_group kSpaceGroups[];
extern const std::size_t kNrOfSpaceGroups;
extern CIFPP_EXPORT const space_group kSpaceGroups[];
extern CIFPP_EXPORT const std::size_t kNrOfSpaceGroups;
// --------------------------------------------------------------------
......
......@@ -34,7 +34,6 @@
#include <tuple>
#include <vector>
#if __has_include(<experimental/type_traits>)
#include <experimental/type_traits>
#else
......
......@@ -26,6 +26,8 @@
#pragma once
#include <cif++/exports.hpp>
#include <filesystem>
#ifndef STDOUT_FILENO
......@@ -50,7 +52,7 @@
namespace cif
{
extern int VERBOSE;
extern CIFPP_EXPORT int VERBOSE;
// the git 'build' number
std::string get_version_nr();
......
......@@ -26,13 +26,13 @@
#pragma once
#include <cif++/text.hpp>
#include <filesystem>
#include <list>
#include <mutex>
#include <utility>
#include <cif++/text.hpp>
namespace cif
{
......
......@@ -24,14 +24,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <numeric>
#include <stack>
#include <cif++/category.hpp>
#include <cif++/datablock.hpp>
#include <cif++/parser.hpp>
#include <cif++/utilities.hpp>
#include <numeric>
#include <stack>
// TODO: Find out what the rules are exactly for linked items, the current implementation
// is inconsistent. It all depends whether a link is satified if a field taking part in the
// set of linked items is null at one side and not null in the other.
......
......@@ -24,16 +24,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++/compound.hpp>
#include <filesystem>
#include <fstream>
#include <map>
#include <mutex>
#include <numeric>
#include <shared_mutex>
#include <filesystem>
#include <fstream>
#include <cif++/compound.hpp>
namespace fs = std::filesystem;
namespace cif
......
......@@ -24,10 +24,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cassert>
#include <cif++/row.hpp>
#include <cassert>
namespace cif
{
......
......@@ -34,8 +34,6 @@
namespace fs = std::filesystem;
extern int VERBOSE;
namespace cif::mm
{
......
......@@ -24,22 +24,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cassert>
#include <iostream>
#include <map>
#include <regex>
#include <stack>
#include <cif++/utilities.hpp>
#include <cif++/forward_decl.hpp>
#include <cif++/parser.hpp>
#include <cif++/file.hpp>
namespace cif
{
extern int VERBOSE;
}
#include <cassert>
#include <iostream>
#include <map>
#include <regex>
#include <stack>
namespace cif
{
......
......@@ -24,6 +24,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++.hpp>
#include <cif++/pdb/cif2pdb.hpp>
#include <cif++/gzio.hpp>
#include <cmath>
#include <deque>
#include <iomanip>
......@@ -31,9 +35,6 @@
#include <regex>
#include <set>
#include <cif++.hpp>
#include <cif++/pdb/cif2pdb.hpp>
#include <cif++/gzio.hpp>
namespace cif::pdb
{
......
......@@ -24,17 +24,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <cif++.hpp>
#include <cif++/pdb/pdb2cif.hpp>
#include <cif++/pdb/pdb2cif_remark_3.hpp>
#include <cif++/gzio.hpp>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
using cif::category;
using cif::datablock;
using cif::iequals;
......
......@@ -25,12 +25,11 @@
*/
#include <cif++.hpp>
#include <cif++/pdb/pdb2cif_remark_3.hpp>
#include <map>
#include <set>
#include <cif++/pdb/pdb2cif_remark_3.hpp>
namespace cif::pdb
{
......
......@@ -27,12 +27,12 @@
// #include <sys/ioctl.h>
// #include <termios.h>
#include <iomanip>
#include <iostream>
#include <cif++.hpp>
#include <cif++/pdb/tls.hpp>
#include <iomanip>
#include <iostream>
namespace cif
{
......
......@@ -24,11 +24,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++/point.hpp>
#include <cassert>
#include <random>
#include <cif++/point.hpp>
namespace cif
{
......
......@@ -24,10 +24,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdexcept>
#include <cif++/symmetry.hpp>
#include <stdexcept>
#include "./symop_table_data.hpp"
namespace cif
......
......@@ -24,11 +24,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++/text.hpp>
#include <algorithm>
#include <cassert>
#include <cif++/text.hpp>
namespace cif
{
......
......@@ -24,6 +24,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++/utilities.hpp>
#include "revision.hpp"
#include <atomic>
#include <cassert>
#include <cmath>
......@@ -44,10 +47,6 @@
#include <termios.h>
#endif
#include <cif++/utilities.hpp>
#include "revision.hpp"
namespace fs = std::filesystem;
// --------------------------------------------------------------------
......
......@@ -24,6 +24,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cif++/dictionary_parser.hpp>
#include <cif++/validate.hpp>
#include <cif++/utilities.hpp>
#include <cif++/gzio.hpp>
#include <cassert>
#include <fstream>
#include <iostream>
......@@ -41,12 +46,6 @@ using boost::regex;
using std::regex;
#endif
#include <cif++/dictionary_parser.hpp>
#include <cif++/validate.hpp>
#include <cif++/utilities.hpp>
#include <cif++/gzio.hpp>
namespace cif
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment