Commit cded8443 by Maarten L. Hekkelman

update for WIN32

parent ad317afe
......@@ -35,7 +35,6 @@ include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CMakePackageConfigHelpers)
include(FindFilesystem)
include(GenerateExportHeader)
include(CTest)
set(CXX_EXTENSIONS OFF)
......@@ -71,6 +70,7 @@ endif()
if(MSVC)
# make msvc standards compliant...
add_compile_options(/permissive-)
add_link_options(/NODEFAULTLIB:library)
macro(get_WIN32_WINNT version)
if(WIN32 AND CMAKE_SYSTEM_VERSION)
......
......@@ -237,7 +237,11 @@ function(write_version_header dir)
if(res EQUAL 0)
set(REVISION_STRING "${out}")
else()
message(STATUS "Git hash not found, does this project has a 'build' tag?")
endif()
else()
message(STATUS "Git hash not found")
endif()
# Check the revision string, if it matches we fill in the required info
......
......@@ -29,7 +29,7 @@ class version_info_base
{
for (auto lib = registered_libraries(); lib != nullptr; lib = lib->m_next)
{
os << '-' << std::endl;
os << "-\n";
lib->write(os, verbose);
}
}
......@@ -55,15 +55,15 @@ class version_info_base
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 (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)
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
: 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
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
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:
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@)
{
}
};
\ No newline at end of file
} s_version_info_@IDENT_PREFIX@instance;
......@@ -35,7 +35,6 @@ include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CMakePackageConfigHelpers)
include(FindFilesystem)
include(GenerateExportHeader)
set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
......@@ -69,6 +68,7 @@ endif()
if(MSVC)
# make msvc standards compliant...
add_compile_options(/permissive-)
add_link_options(/NODEFAULTLIB:library)
macro(get_WIN32_WINNT version)
if(WIN32 AND CMAKE_SYSTEM_VERSION)
......@@ -84,6 +84,9 @@ if(MSVC)
add_definitions(-D_WIN32_WINNT=${ver})
endif()
# We do not want to write an export file for all our symbols...
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Create a revision file, containing the current git version info
include(VersionString)
write_version_header("${PROJECT_SOURCE_DIR}/src" LIB_NAME "libdssp")
......@@ -111,6 +114,8 @@ add_library(dssp::dssp ALIAS dssp)
target_link_libraries(dssp PUBLIC cifpp::cifpp)
set_target_properties(dssp PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(dssp
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
......@@ -127,7 +132,7 @@ install(TARGETS dssp
if(MSVC AND BUILD_SHARED_LIBS)
install(
FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
FILES $<TARGET_PDB_FILE:dssp>
DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL)
endif()
......
......@@ -35,6 +35,10 @@
#include <numeric>
#include <thread>
#ifdef near
#undef near
#endif
using residue = dssp::residue;
using statistics = dssp::statistics;
using structure_type = dssp::structure_type;
......
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