Commit 2c28c183 by Maarten L. Hekkelman

On Windows

parent 399344c1
......@@ -43,9 +43,9 @@ if(MSVC)
get_WIN32_WINNT(ver)
add_definitions(-D_WIN32_WINNT=${ver})
# On Windows, do not install in the system location by default
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(WARNING "The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}")
# On Windows, do not install in the system location
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT ($ENV{LOCALAPPDATA} STREQUAL ""))
message(WARNING "The executable will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}")
set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE)
endif()
......@@ -121,7 +121,7 @@ find_package(ZLIB)
find_package(BZip2)
find_package(cifpp 1.0 REQUIRED)
if(USE_RSRC)
if(CIFPP_FOUND)
add_compile_definitions("DATA_DIR=\"${CIFPP_SHARE_DIR}\"")
endif()
......@@ -136,13 +136,22 @@ if (BZIP2_FOUND)
link_libraries(BZip2::BZip2)
endif()
if(USE_RSRC)
add_custom_command(OUTPUT mkdssp_rsrc.obj
COMMAND ${MRC} -o mkdssp_rsrc.obj ${CIFPP_SHARE_DIR}/mmcif_pdbx_v50.dic ${COFF_SPEC}
)
set(DSSP_RESOURCE mkdssp_rsrc.obj)
endif()
include_directories(
${PROJECT_SOURCE_DIR}/src
PUBLIC ${cifpp_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
)
add_executable(mkdssp
${PROJECT_SOURCE_DIR}/src/mkdssp.cpp)
${PROJECT_SOURCE_DIR}/src/mkdssp.cpp
${DSSP_RESOURCE})
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
......
......@@ -183,7 +183,7 @@ std::string ResidueToDSSPLine(const mmcif::DSSP::ResidueInfo& info)
case mmcif::Helix::Start: helix[static_cast<int>(helixType)] = '>'; break;
case mmcif::Helix::End: helix[static_cast<int>(helixType)] = '<'; break;
case mmcif::Helix::StartAndEnd: helix[static_cast<int>(helixType)] = 'X'; break;
case mmcif::Helix::Middle: helix[static_cast<int>(helixType)] = (helixType == mmcif::HelixType::rh_pp ? 'P' : ('3' + static_cast<int>(helixType))); break;
case mmcif::Helix::Middle: helix[static_cast<int>(helixType)] = (helixType == mmcif::HelixType::rh_pp ? 'P' : static_cast<char>('3' + static_cast<int>(helixType))); break;
}
}
......@@ -560,14 +560,14 @@ int d_main(int argc, const char* argv[])
if (fmt.empty() and vm.count("output"))
{
fs::path p = vm["output"].as<std::string>();
fs::path output = vm["output"].as<std::string>();
if (p.extension() == ".gz")
p = p.stem();
else if (p.extension() == ".bz2")
p = p.stem();
if (output.extension() == ".gz")
output = output.stem();
else if (output.extension() == ".bz2")
output = output.stem();
if (p.extension() == ".dssp")
if (output.extension() == ".dssp")
fmt = "dssp";
else
fmt = "cif";
......@@ -578,8 +578,8 @@ int d_main(int argc, const char* argv[])
if (vm.count("output"))
{
fs::path p = vm["output"].as<std::string>();
std::ofstream of(p, std::ios_base::out | std::ios_base::binary);
fs::path output = vm["output"].as<std::string>();
std::ofstream of(output, std::ios_base::out | std::ios_base::binary);
if (not of.is_open())
{
......@@ -589,9 +589,9 @@ int d_main(int argc, const char* argv[])
io::filtering_stream<io::output> out;
if (p.extension() == ".gz")
if (output.extension() == ".gz")
out.push(io::gzip_compressor());
else if (p.extension() == ".bz2")
else if (output.extension() == ".bz2")
out.push(io::bzip2_compressor());
out.push(of);
......
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