Skip to content

Commit

Permalink
fix makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Apr 8, 2024
1 parent 5756047 commit abd9fdf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
24 changes: 13 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ set(THREADS_PREFER_PTHREAD_FLAG)
find_package(Threads)
find_package(libmcfp QUIET)

if(NOT libmcfp_FOUND)
if(NOT (libmcfp_FOUND OR TARGET libmcfp))
include(FetchContent)

if(CMAKE_VERSION GREATER_EQUAL 3.28)
Expand All @@ -114,19 +114,21 @@ if(NOT libmcfp_FOUND)
FetchContent_MakeAvailable(libmcfp)
endif()

find_package(cifpp 7 QUIET)
if(NOT TARGET cifpp AND NOT cifpp_FOUND)
find_package(cifpp 7 QUIET)

if(NOT cifpp_FOUND)
set(CIFPP_DOWNLOAD_CCD OFF)
if(NOT cifpp_FOUND)
set(CIFPP_DOWNLOAD_CCD OFF)

FetchContent_Declare(
cifpp
${EXLC}
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
GIT_TAG v7.0.3
)
FetchContent_Declare(
cifpp
${EXLC}
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
GIT_TAG v7.0.3
)

FetchContent_MakeAvailable(cifpp)
FetchContent_MakeAvailable(cifpp)
endif()
endif()

add_subdirectory(libdssp)
Expand Down
6 changes: 3 additions & 3 deletions libdssp/src/dssp-io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void writeDSSP(const dssp &dssp, std::ostream &os)
std::time_t today = system_clock::to_time_t(system_clock::now());
std::tm *tm = std::gmtime(&today);

std::string version = kVersionNumber;
std::string version = klibdsspVersionNumber;
if (version.length() < 10)
version.insert(version.end(), 10 - version.length(), ' ');

Expand Down Expand Up @@ -877,8 +877,8 @@ void annotateDSSP(cif::datablock &db, const dssp &dssp, bool writeOther, bool wr
software.emplace({
{ "pdbx_ordinal", software.get_unique_id("") },
{ "name", "dssp" },
{ "version", kVersionNumber },
{ "date", kRevisionDate },
{ "version", klibdsspVersionNumber },
{ "date", klibdsspRevisionDate },
{ "classification", "model annotation" }
});
}
20 changes: 11 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
find_package(Catch2 QUIET)
if(NOT(Catch2_FOUND OR TARGET Catch2))
find_package(Catch2 QUIET)

if(NOT Catch2_FOUND)
include(FetchContent)
if(NOT Catch2_FOUND)
include(FetchContent)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9)

FetchContent_MakeAvailable(Catch2)
FetchContent_MakeAvailable(Catch2)

set(Catch2_VERSION "2.13.9")
set(Catch2_VERSION "2.13.9")
endif()
endif()

add_executable(unit-test-dssp ${CMAKE_CURRENT_SOURCE_DIR}/unit-test-dssp.cpp ${PROJECT_SOURCE_DIR}/libdssp/src/dssp-io.cpp)
Expand Down

0 comments on commit abd9fdf

Please sign in to comment.