Commit 9914970c by Maarten L. Hekkelman

With cmake file

parent 6338c836
...@@ -24,3 +24,4 @@ msvc/x64/ ...@@ -24,3 +24,4 @@ msvc/x64/
.vscode/ .vscode/
.vs/ .vs/
build
cmake_minimum_required(VERSION 3.10)
include(FindPkgConfig)
# set the project name
project(mkdssp VERSION 4.0.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set bindir, if not use -DBIN_INSTALL_DIR
if(NOT BIN_INSTALL_DIR)
if(CMAKE_INSTALL_BINDIR)
set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
else(CMAKE_INSTALL_BINDIR)
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
endif(CMAKE_INSTALL_BINDIR)
endif(NOT BIN_INSTALL_DIR)
# Set libdir, if not use -DLIB_INSTALL_DIR
if(NOT LIB_INSTALL_DIR)
if(CMAKE_INSTALL_LIBDIR)
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
else(CMAKE_INSTALL_LIBDIR)
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
endif(CMAKE_INSTALL_LIBDIR)
endif(NOT LIB_INSTALL_DIR)
# Set includedir, if not use -DINCLUDE_INSTALL_DIR
if(NOT INCLUDE_INSTALL_DIR)
if(CMAKE_INSTALL_INCLUDEDIR)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
else(CMAKE_INSTALL_INCLUDEDIR)
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
endif(CMAKE_INSTALL_INCLUDEDIR)
endif(NOT INCLUDE_INSTALL_DIR)
# Set sharedir, if not use -DSHARE_INSTALL_DIR
if(NOT SHARE_INSTALL_DIR)
if(CMAKE_INSTALL_DATADIR)
set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}")
else(CMAKE_INSTALL_DATADIR)
set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
endif(CMAKE_INSTALL_DATADIR)
endif(NOT SHARE_INSTALL_DIR)
set (Boost_DETAILED_FAILURE_MSG ON)
# set (BOOST_ROOT ${PROJECT_SOURCE_DIR}/../boost_1_75_0)
# set (Boost_COMPILER "-vc")
# set (Boost_USE_STATIC_RUNTIME ON)
find_package(Boost 1.73.0 REQUIRED COMPONENTS system iostreams regex date_time program_options)
set(CMAKE_THREAD_PREFER_PTHREAD)
set(THREADS_PREFER_PTHREAD_FLAG)
find_package(Threads)
pkg_check_modules(LibcifPP libcifpp)
include_directories(
${PROJECT_SOURCE_DIR}/src
)
add_executable(mkdssp ${PROJECT_SOURCE_DIR}/src/mkdssp.cpp)
include_directories(${PROJECT_NAME} PUBLIC ${LibcifPP_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
)
target_link_libraries(${PROJECT_NAME} ${LibcifPP_LINK_LIBRARIES} ${Boost_LIBRARIES} z bz2 Threads::Threads)
if(MSVC)
# make msvc standards compliant...
target_compile_options(${PROJECT_NAME} PRIVATE /permissive-)
target_compile_options(unit-test PRIVATE /permissive-)
endif()
...@@ -475,6 +475,11 @@ int d_main(int argc, const char* argv[]) ...@@ -475,6 +475,11 @@ int d_main(int argc, const char* argv[])
("xyzin,i", po::value<std::string>(), "coordinates file") ("xyzin,i", po::value<std::string>(), "coordinates file")
("output,o", po::value<std::string>(), "Output to this file") ("output,o", po::value<std::string>(), "Output to this file")
("debug,d", po::value<int>(), "Debug level (for even more verbose output)") ("debug,d", po::value<int>(), "Debug level (for even more verbose output)")
("compounds", po::value<std::string>(), "Location of the components.cif file from CCD")
("components", po::value<std::string>(), "Location of the components.cif file from CCD, alias")
("extra-compounds", po::value<std::string>(), "File containing residue information for extra compounds in this specific target, should be either in CCD format or a CCP4 restraints file")
("mmcif-dictionary", po::value<std::string>(), "Path to the mmcif_pdbx.dic file to use instead of default")
; ;
po::options_description cmdline_options; po::options_description cmdline_options;
...@@ -520,7 +525,22 @@ int d_main(int argc, const char* argv[]) ...@@ -520,7 +525,22 @@ int d_main(int argc, const char* argv[])
cif::VERBOSE = vm["debug"].as<int>(); cif::VERBOSE = vm["debug"].as<int>();
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// Load extra CCD definitions, if any
if (vm.count("compounds"))
cif::addFileResource("components.cif", vm["compounds"].as<std::string>());
else if (vm.count("components"))
cif::addFileResource("components.cif", vm["components"].as<std::string>());
if (vm.count("extra-compounds"))
mmcif::CompoundFactory::instance().pushDictionary(vm["extra-compounds"].as<std::string>());
// And perhaps a private mmcif_pdbx dictionary
if (vm.count("mmcif-dictionary"))
cif::addFileResource("mmcif_pdbx_v50.dic", vm["mmcif-dictionary"].as<std::string>());
if (vm.count("dict")) if (vm.count("dict"))
{ {
for (auto dict: vm["dict"].as<std::vector<std::string>>()) for (auto dict: vm["dict"].as<std::vector<std::string>>())
......
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