Commit b3dc38f2 by Maarten L. Hekkelman

update for WIN32

parent 6044d3dc
...@@ -125,7 +125,8 @@ endif() ...@@ -125,7 +125,8 @@ endif()
if(MSVC) if(MSVC)
# make msvc standards compliant... # make msvc standards compliant...
add_compile_options(/permissive-) add_compile_options(/permissive- /bigobj)
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")
...@@ -297,11 +298,11 @@ set_target_properties(cifpp PROPERTIES POSITION_INDEPENDENT_CODE ON) ...@@ -297,11 +298,11 @@ 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;${PROJECT_BINARY_DIR};${EIGEN3_INCLUDE_DIR}>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include;${PROJECT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
) )
target_link_libraries(cifpp PUBLIC Threads::Threads ZLIB::ZLIB ${CIFPP_REQUIRED_LIBRARIES}) target_link_libraries(cifpp PUBLIC Threads::Threads ZLIB::ZLIB ${CIFPP_REQUIRED_LIBRARIES} PRIVATE Eigen3::Eigen)
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)
...@@ -344,7 +345,7 @@ install(TARGETS cifpp ...@@ -344,7 +345,7 @@ install(TARGETS cifpp
if(MSVC AND BUILD_SHARED_LIBS) if(MSVC AND BUILD_SHARED_LIBS)
install( install(
FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> FILES $<TARGET_PDB_FILE:cifpp>
DESTINATION ${CMAKE_INSTALL_LIBDIR} DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL) OPTIONAL)
endif() endif()
......
...@@ -237,7 +237,11 @@ function(write_version_header dir) ...@@ -237,7 +237,11 @@ function(write_version_header dir)
if(res EQUAL 0) if(res EQUAL 0)
set(REVISION_STRING "${out}") set(REVISION_STRING "${out}")
else()
message(STATUS "Git hash not found, does this project has a 'build' tag?")
endif() endif()
else()
message(STATUS "Git hash not found")
endif() endif()
# Check the revision string, if it matches we fill in the required info # Check the revision string, if it matches we fill in the required info
......
...@@ -29,7 +29,7 @@ class version_info_base ...@@ -29,7 +29,7 @@ class version_info_base
{ {
for (auto lib = registered_libraries(); lib != nullptr; lib = lib->m_next) for (auto lib = registered_libraries(); lib != nullptr; lib = lib->m_next)
{ {
os << '-' << std::endl; os << "-\n";
lib->write(os, verbose); lib->write(os, verbose);
} }
} }
...@@ -55,15 +55,15 @@ class version_info_base ...@@ -55,15 +55,15 @@ class version_info_base
void write(std::ostream &os, bool verbose) void write(std::ostream &os, bool verbose)
{ {
os << m_name << " version " << m_version << std::endl; os << m_name << " version " << m_version << '\n';
if (verbose) if (verbose)
{ {
if (m_build_number != 0) if (m_build_number != 0)
{ {
os << "build: " << m_build_number << ' ' << m_revision_date << std::endl; os << "build: " << m_build_number << ' ' << m_revision_date << '\n';
if (m_git_tag[0] != 0) if (m_git_tag[0] != 0)
os << "git tag: " << m_git_tag << std::endl; os << "git tag: " << m_git_tag << '\n';
} }
} }
} }
...@@ -100,25 +100,8 @@ class version_info : public version_info_base ...@@ -100,25 +100,8 @@ class version_info : public version_info_base
: version_info_base(name, version, build_number, git_tag, revision_date, is_main) : version_info_base(name, version, build_number, git_tag, revision_date, is_main)
{ {
} }
struct register_object
{
register_object()
{
static implementation_type s_instance;
}
};
template <register_object &>
struct reference_object;
static register_object s_registered_object;
static reference_object<s_registered_object> s_referenced_object;
}; };
template <typename T>
typename version_info<T>::register_object version_info<T>::s_registered_object;
} // namespace version_info_v1_1 } // namespace version_info_v1_1
inline void write_version_string(std::ostream &os, bool verbose) inline void write_version_string(std::ostream &os, bool verbose)
...@@ -128,11 +111,11 @@ inline void write_version_string(std::ostream &os, bool verbose) ...@@ -128,11 +111,11 @@ inline void write_version_string(std::ostream &os, bool verbose)
#endif #endif
class version_info_@IDENT_PREFIX@impl : public version_info_v1_1::version_info<version_info_@IDENT_PREFIX@impl> const class version_info_@IDENT_PREFIX@impl : public version_info_v1_1::version_info<version_info_@IDENT_PREFIX@impl>
{ {
public: public:
version_info_@IDENT_PREFIX@impl() version_info_@IDENT_PREFIX@impl()
: version_info(k@VAR_PREFIX@ProjectName, k@VAR_PREFIX@VersionNumber, k@VAR_PREFIX@BuildNumber, k@VAR_PREFIX@RevisionGitTag, k@VAR_PREFIX@RevisionDate, @BOOL_IS_MAIN@) : version_info(k@VAR_PREFIX@ProjectName, k@VAR_PREFIX@VersionNumber, k@VAR_PREFIX@BuildNumber, k@VAR_PREFIX@RevisionGitTag, k@VAR_PREFIX@RevisionDate, @BOOL_IS_MAIN@)
{ {
} }
}; } s_version_info_@IDENT_PREFIX@instance;
\ No newline at end of file
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <list> #include <list>
#include "cif++/exports.hpp"
#include "cif++/datablock.hpp" #include "cif++/datablock.hpp"
#include "cif++/parser.hpp" #include "cif++/parser.hpp"
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#pragma once #pragma once
#include "cif++/exports.hpp"
#include <string> #include <string>
#include <vector> #include <vector>
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#pragma once #pragma once
#include "cif++/exports.hpp"
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <complex> #include <complex>
......
...@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(clr_1) ...@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(clr_1)
{ {
using namespace cif::colour; using namespace cif::colour;
std::cout << "Hello, " << cif::coloured("world!", white, red, regular) << '\n' std::cout << "Hello, " << cif::coloured("world!", white, red, cif::colour::regular) << '\n'
<< "Hello, " << cif::coloured("world!", white, red, bold) << '\n' << "Hello, " << cif::coloured("world!", white, red, bold) << '\n'
<< "Hello, " << cif::coloured("world!", black, red) << '\n' << "Hello, " << cif::coloured("world!", black, red) << '\n'
<< "Hello, " << cif::coloured("world!", white, green) << '\n' << "Hello, " << cif::coloured("world!", white, green) << '\n'
......
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