Commit bd8e68d7 by Maarten L. Hekkelman

this should work on windows as well

parent 3b92367b
...@@ -60,6 +60,4 @@ jobs: ...@@ -60,6 +60,4 @@ jobs:
- name: Test - name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}/test working-directory: ${{ steps.strings.outputs.build-output-dir }}/test
run: ctest --build-config Release --output-on-failure 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) ...@@ -85,6 +85,12 @@ if(MSVC)
get_WIN32_WINNT(ver) get_WIN32_WINNT(ver)
add_definitions(-D_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() endif()
# Create a revision file, containing the current git version info # Create a revision file, containing the current git version info
...@@ -124,7 +130,8 @@ if(NOT PDB_REDO_META) ...@@ -124,7 +130,8 @@ if(NOT PDB_REDO_META)
cifpp cifpp
${EXLC} ${EXLC}
GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git GIT_REPOSITORY https://github.com/pdb-redo/libcifpp.git
GIT_TAG v7.0.1) GIT_TAG 92bd52d
)
FetchContent_MakeAvailable(cifpp) FetchContent_MakeAvailable(cifpp)
endif() endif()
......
...@@ -39,4 +39,6 @@ else() ...@@ -39,4 +39,6 @@ else()
target_compile_definitions(unit-test-dssp PUBLIC CATCH22=1) target_compile_definitions(unit-test-dssp PUBLIC CATCH22=1)
endif() 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[]) ...@@ -74,9 +74,13 @@ int main(int argc, char *argv[])
using namespace Catch::Clara; using namespace Catch::Clara;
#endif #endif
std::filesystem::path rsrc_dir;
auto cli = session.cli() // Get Catch2's command line parser auto cli = session.cli() // Get Catch2's command line parser
| Opt(gTestDir, "data-dir") // bind variable to a new option, with a hint string | Opt(gTestDir, "data-dir") // bind variable to a new option, with a hint string
["-D"]["--data-dir"] // the option names it will respond to ["-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 ("The directory containing the data files"); // description string for the help output
// Now pass the new composite back to Catch2 so it uses that // Now pass the new composite back to Catch2 so it uses that
...@@ -87,6 +91,9 @@ int main(int argc, char *argv[]) ...@@ -87,6 +91,9 @@ int main(int argc, char *argv[])
if (returnCode != 0) // Indicates a command line error if (returnCode != 0) // Indicates a command line error
return returnCode; return returnCode;
if (not rsrc_dir.empty() and std::filesystem::exists(rsrc_dir))
cif::add_data_directory(rsrc_dir);
return session.run(); return session.run();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment