Skip to content

Commit

Permalink
Fix library path for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Master92 committed Dec 4, 2023
1 parent 271c55f commit d70825f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,13 @@ if(NOT DOCTEST_CMAKE)
message(FATAL_ERROR "Could not find doctest.cmake")
else()
include(${DOCTEST_CMAKE})
doctest_discover_tests(${PROJECT_NAME}_tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../src)
set(LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../src)
# Fix path for MSVC is located in the respective build type subdirectory
if(MSVC)
set(DOCTEST_CMAKE_DIR "${LIBRARY_DIR}/$<CONFIG>")
else()
set(DOCTEST_CMAKE_DIR "${LIBRARY_DIR}")
endif()

doctest_discover_tests(${PROJECT_NAME}_tests WORKING_DIRECTORY ${DOCTEST_CMAKE_DIR})
endif()

0 comments on commit d70825f

Please sign in to comment.