Skip to content

Commit

Permalink
fix makefile to create shared libraries when requested to do so
Browse files Browse the repository at this point in the history
example should work when there is no components.cif file yet
  • Loading branch information
mhekkel committed Apr 3, 2024
1 parent 588e075 commit bfbbeb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 3.23)
# set the project name
project(
libcifpp
VERSION 7.0.4
VERSION 7.0.5
LANGUAGES CXX)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down Expand Up @@ -331,7 +331,7 @@ set(project_headers
include/cif++/validate.hpp
)

add_library(cifpp STATIC)
add_library(cifpp)
add_library(cifpp::cifpp ALIAS cifpp)

target_sources(cifpp
Expand Down Expand Up @@ -494,11 +494,14 @@ if(PROJECT_IS_TOP_LEVEL OR BUILD_FOR_CCP4)
FILE "cifpp-targets.cmake"
DESTINATION lib/cmake/cifpp)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_ddl.dic
${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_pdbx.dic
${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_ma.dic
DESTINATION ${CMAKE_INSTALL_DATADIR}/libcifpp)

if(CIFPP_DATA_DIR AND CIFPP_DOWNLOAD_CCD)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_ddl.dic
${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_pdbx.dic
${CMAKE_CURRENT_SOURCE_DIR}/rsrc/mmcif_ma.dic ${COMPONENTS_CIF}
install(FILES ${COMPONENTS_CIF}
DESTINATION ${CMAKE_INSTALL_DATADIR}/libcifpp)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main(int argc, char *argv[])
exit(1);
}

cif::file file = cif::pdb::read(argv[1]);
cif::file file(argv[1]);

if (file.empty())
{
Expand Down

0 comments on commit bfbbeb9

Please sign in to comment.