Commit 1f8e491d by Maarten L. Hekkelman

generate exports header

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