Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dssp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
dssp
Commits
6e497de7
Unverified
Commit
6e497de7
authored
Mar 09, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final touches
parent
4ca72c7e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
123 deletions
+13
-123
CMakeLists.txt
+12
-19
cmake/FindFilesystem.cmake
+0
-74
libdssp/CMakeLists.txt
+1
-30
No files found.
CMakeLists.txt
View file @
6e497de7
...
...
@@ -29,22 +29,15 @@ project(mkdssp VERSION 4.4.4 LANGUAGES CXX)
list
(
APPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
include
(
GNUInstallDirs
)
include
(
CheckFunctionExists
)
include
(
CheckIncludeFiles
)
include
(
CheckLibraryExists
)
include
(
CMakePackageConfigHelpers
)
#
include(GNUInstallDirs)
#
include(CheckFunctionExists)
#
include(CheckIncludeFiles)
#
include(CheckLibraryExists)
#
include(CMakePackageConfigHelpers)
include
(
FetchContent
)
include
(
FindFilesystem
)
include
(
GenerateExportHeader
)
# include(GenerateExportHeader)
include
(
CTest
)
set
(
CXX_EXTENSIONS OFF
)
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
find_package
(
Filesystem REQUIRED
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
)
elseif
(
MSVC
)
...
...
@@ -95,7 +88,7 @@ endif()
# Create a revision file, containing the current git version info
include
(
VersionString
)
write_version_header
(
"
${
PROJEC
T_SOURCE_DIR
}
/src"
)
write_version_header
(
"
${
CMAKE_CURREN
T_SOURCE_DIR
}
/src"
)
# Optionally use mrc to create resources
find_package
(
Mrc QUIET
)
...
...
@@ -119,7 +112,7 @@ if(NOT PDB_REDO_META)
libmcfp
${
EXLC
}
GIT_REPOSITORY https://github.com/mhekkel/libmcfp
GIT_TAG v1.
2.4
)
GIT_TAG v1.
3.1
)
FetchContent_MakeAvailable
(
libmcfp
)
...
...
@@ -140,7 +133,7 @@ endif()
add_subdirectory
(
libdssp
)
add_executable
(
mkdssp
${
PROJEC
T_SOURCE_DIR
}
/src/mkdssp.cpp
)
add_executable
(
mkdssp
${
CMAKE_CURREN
T_SOURCE_DIR
}
/src/mkdssp.cpp
)
target_link_libraries
(
mkdssp PRIVATE libmcfp::libmcfp dssp::dssp
)
...
...
@@ -148,12 +141,12 @@ if(USE_RSRC)
mrc_target_resources
(
mkdssp
${
CIFPP_SHARE_DIR
}
/mmcif_pdbx.dic
${
CIFPP_SHARE_DIR
}
/mmcif_ddl.dic
${
PROJEC
T_SOURCE_DIR
}
/libdssp/mmcif_pdbx/dssp-extension.dic
)
${
CMAKE_CURREN
T_SOURCE_DIR
}
/libdssp/mmcif_pdbx/dssp-extension.dic
)
endif
()
# Install rules
install
(
TARGETS
${
PROJECT_NAME
}
RUNTIME DESTINATION
${
BIN_INSTALL_DIR
}
RUNTIME DESTINATION
bin
)
if
(
BUILD_DOCUMENTATION
)
...
...
@@ -162,7 +155,7 @@ endif()
if
(
UNIX
)
install
(
FILES doc/mkdssp.1
DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/man/man1
)
DESTINATION
share
/man/man1
)
endif
()
if
(
EXISTS
"
${
CCP4
}
/html"
)
...
...
cmake/FindFilesystem.cmake
deleted
100644 → 0
View file @
4ca72c7e
# Simplistic reimplementation of https://github.com/vector-of-bool/CMakeCM/blob/master/modules/FindFilesystem.cmake
if
(
TARGET std::filesystem
)
return
()
endif
()
cmake_minimum_required
(
VERSION 3.10
)
include
(
CMakePushCheckState
)
include
(
CheckIncludeFileCXX
)
include
(
CheckCXXSourceCompiles
)
cmake_push_check_state
()
set
(
CMAKE_CXX_STANDARD 17
)
check_include_file_cxx
(
"filesystem"
_CXX_FILESYSTEM_HAVE_HEADER
)
mark_as_advanced
(
_CXX_FILESYSTEM_HAVE_HEADER
)
set
(
code
[[
#include <cstdlib>
#include <filesystem>
int main() {
auto cwd = std::filesystem::current_path();
return EXIT_SUCCESS;
}
]]
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 8.4.0
)
# >> https://stackoverflow.com/questions/63902528/program-crashes-when-filesystempath-is-destroyed
set
(
CXX_FILESYSTEM_NO_LINK_NEEDED 0
)
else
()
# Check a simple filesystem program without any linker flags
check_cxx_source_compiles
(
"
${
code
}
"
CXX_FILESYSTEM_NO_LINK_NEEDED
)
endif
()
if
(
CXX_FILESYSTEM_NO_LINK_NEEDED
)
set
(
_found 1
)
else
()
set
(
prev_libraries
${
CMAKE_REQUIRED_LIBRARIES
}
)
# Add the libstdc++ flag
set
(
CMAKE_REQUIRED_LIBRARIES
${
prev_libraries
}
-lstdc++fs
)
check_cxx_source_compiles
(
"
${
code
}
"
CXX_FILESYSTEM_STDCPPFS_NEEDED
)
set
(
_found
${
CXX_FILESYSTEM_STDCPPFS_NEEDED
}
)
if
(
NOT CXX_FILESYSTEM_STDCPPFS_NEEDED
)
# Try the libc++ flag
set
(
CMAKE_REQUIRED_LIBRARIES
${
prev_libraries
}
-lc++fs
)
check_cxx_source_compiles
(
"
${
code
}
"
CXX_FILESYSTEM_CPPFS_NEEDED
)
set
(
_found
${
CXX_FILESYSTEM_CPPFS_NEEDED
}
)
endif
()
endif
()
if
(
_found
)
add_library
(
std::filesystem INTERFACE IMPORTED
)
set_property
(
TARGET std::filesystem APPEND PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17
)
if
(
CXX_FILESYSTEM_NO_LINK_NEEDED
)
# Nothing to add...
elseif
(
CXX_FILESYSTEM_STDCPPFS_NEEDED
)
set_target_properties
(
std::filesystem PROPERTIES IMPORTED_LIBNAME stdc++fs
)
elseif
(
CXX_FILESYSTEM_CPPFS_NEEDED
)
set_target_properties
(
std::filesystem PROPERTIES IMPORTED_LIBNAME c++fs
)
endif
()
endif
()
cmake_pop_check_state
()
set
(
Filesystem_FOUND
${
_found
}
CACHE BOOL
"TRUE if we can run a program using std::filesystem"
FORCE
)
if
(
Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND
)
message
(
FATAL_ERROR
"Cannot run simple program using std::filesystem"
)
endif
()
libdssp/CMakeLists.txt
View file @
6e497de7
...
...
@@ -55,39 +55,10 @@ configure_package_config_file(
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dssp/dsspConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/dssp/dsspConfigVersion.cmake"
DESTINATION lib/cmake/dssp
COMPONENT Devel
)
# set(dssp_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR})
# set_target_properties(dssp PROPERTIES
# VERSION ${PROJECT_VERSION}
# SOVERSION ${dssp_MAJOR_VERSION}
# INTERFACE_dssp_MAJOR_VERSION ${dssp_MAJOR_VERSION})
# set_property(TARGET dssp APPEND PROPERTY
# COMPATIBLE_INTERFACE_STRING dssp_MAJOR_VERSION
# )
# write_basic_package_version_file(
# "${CMAKE_CURRENT_BINARY_DIR}/dssp/dsspConfigVersion.cmake"
# VERSION ${PROJECT_VERSION}
# COMPATIBILITY AnyNewerVersion
# )
# # pkgconfig support
# set(prefix ${CMAKE_INSTALL_PREFIX})
# set(exec_prefix ${CMAKE_INSTALL_PREFIX})
# set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
# set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/libdssp.pc.in
# ${CMAKE_CURRENT_BINARY_DIR}/libdssp.pc.in @ONLY)
# file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libdssp.pc
# INPUT ${CMAKE_CURRENT_BINARY_DIR}/libdssp.pc.in)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdssp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
set
(
CIFPP_DATA_DIR
"
${
CMAKE_INSTALL_FULL_DATADIR
}
/libcifpp"
)
set
(
CIFPP_DATA_DIR share/libcifpp
)
install
(
FILES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mmcif_pdbx/dssp-extension.dic"
DESTINATION
${
CIFPP_DATA_DIR
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment