mirror of
https://github.com/PDB-REDO/dssp.git
synced 2026-06-04 13:44:21 +08:00
this should work on windows as well
This commit is contained in:
2
.github/workflows/cmake-multi-platform.yml
vendored
2
.github/workflows/cmake-multi-platform.yml
vendored
@@ -60,6 +60,4 @@ jobs:
|
||||
- name: Test
|
||||
working-directory: ${{ steps.strings.outputs.build-output-dir }}/test
|
||||
run: ctest --build-config Release --output-on-failure
|
||||
env:
|
||||
LIBCIFPP_DATA_DIR: ${{ steps.strings.outputs.build-output-dir }}/_deps/cifpp-src/rsrc
|
||||
|
||||
|
||||
@@ -85,6 +85,12 @@ if(MSVC)
|
||||
|
||||
get_WIN32_WINNT(ver)
|
||||
add_definitions(-D_WIN32_WINNT=${ver})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
else()
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create a revision file, containing the current git version info
|
||||
@@ -124,7 +130,8 @@ if(NOT PDB_REDO_META)
|
||||
cifpp
|
||||
${EXLC}
|
||||
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
|
||||
GIT_TAG v7.0.1)
|
||||
GIT_TAG 92bd52d
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(cifpp)
|
||||
endif()
|
||||
|
||||
@@ -39,4 +39,6 @@ else()
|
||||
target_compile_definitions(unit-test-dssp PUBLIC CATCH22=1)
|
||||
endif()
|
||||
|
||||
add_test(NAME unit-test-dssp COMMAND $<TARGET_FILE:unit-test-dssp> --data-dir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_test(NAME unit-test-dssp COMMAND $<TARGET_FILE:unit-test-dssp>
|
||||
--data-dir ${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
--rsrc-dir ${CMAKE_CURRENT_BINARY_DIR}/_deps/cifpp-src/rsrc)
|
||||
|
||||
@@ -74,9 +74,13 @@ int main(int argc, char *argv[])
|
||||
using namespace Catch::Clara;
|
||||
#endif
|
||||
|
||||
std::filesystem::path rsrc_dir;
|
||||
|
||||
auto cli = session.cli() // Get Catch2's command line parser
|
||||
| Opt(gTestDir, "data-dir") // bind variable to a new option, with a hint string
|
||||
["-D"]["--data-dir"] // the option names it will respond to
|
||||
| Opt(rsrc_dir, "rsrc-dir") // bind variable to a new option, with a hint string
|
||||
["-D"]["--rsrc-dir"] // the option names it will respond to
|
||||
("The directory containing the data files"); // description string for the help output
|
||||
|
||||
// Now pass the new composite back to Catch2 so it uses that
|
||||
@@ -87,6 +91,9 @@ int main(int argc, char *argv[])
|
||||
if (returnCode != 0) // Indicates a command line error
|
||||
return returnCode;
|
||||
|
||||
if (not rsrc_dir.empty() and std::filesystem::exists(rsrc_dir))
|
||||
cif::add_data_directory(rsrc_dir);
|
||||
|
||||
return session.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user