Skip to content

Commit 15bcddf

Browse files
committed
work around cpmfindpackage limitation
1 parent 2e4f63c commit 15bcddf

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,26 @@ CPMFindPackage(
122122
GIT_TAG v1.4.2
123123
EXCLUDE_FROM_ALL YES)
124124

125-
CPMFindPackage(
126-
NAME cifpp
127-
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
128-
GIT_TAG v8.0.1
129-
EXCLUDE_FROM_ALL YES
130-
)
125+
# CPMFindPackage does not pass on variables set with set_and_check
126+
# Working around this here
127+
find_package(cifpp 8.0.1 QUIET)
128+
129+
if(NOT cifpp_FOUND)
130+
CPMAddPackage(
131+
NAME cifpp
132+
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
133+
GIT_TAG v8.0.1
134+
EXCLUDE_FROM_ALL YES)
135+
endif()
131136

132137
if(TARGET cifpp)
133138
get_target_property(CIFPP_SOURCE_DIR cifpp SOURCE_DIR)
134139
set(CIFPP_DATA_DIR ${CIFPP_SOURCE_DIR}/rsrc)
135-
else()
140+
elseif(DEFINED CIFPP_SHARE_DIR)
141+
message(NOTICE "dssp: using ${CIFPP_SHARE_DIR} from CIFPP_SHARE_DIR as CIFPP_DATA_DIR")
136142
set(CIFPP_DATA_DIR ${CIFPP_SHARE_DIR})
143+
else()
144+
message(FATAL_ERROR "dssp: The CIFPP_SHARE_DIR variable is not found in the cifpp configuration files")
137145
endif()
138146

139147
if(INSTALL_LIBRARY)
@@ -149,7 +157,6 @@ target_link_libraries(mkdssp PRIVATE mcfp::mcfp dssp::dssp)
149157
if(USE_RSRC)
150158
mrc_target_resources(mkdssp
151159
${CIFPP_DATA_DIR}/mmcif_pdbx.dic
152-
${CIFPP_DATA_DIR}/mmcif_ddl.dic
153160
${CMAKE_CURRENT_SOURCE_DIR}/libdssp/mmcif_pdbx/dssp-extension.dic)
154161
else()
155162
get_target_property(LIBDSSP_SOURCE_DIR dssp SOURCE_DIR)

0 commit comments

Comments
 (0)