Extract sources list for the test binary into a CMake variable

This commit is contained in:
hashlag
2025-08-17 17:24:26 +03:00
parent 74202c9256
commit 6c2feef644

View File

@@ -11,7 +11,10 @@ FetchContent_Declare(
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest) FetchContent_MakeAvailable(googletest)
add_executable(ChaosTests Md4HasherTests.cpp Md5HasherTests.cpp) set(ChaosTests_SOURCE Md4HasherTests.cpp
Md5HasherTests.cpp)
add_executable(ChaosTests ${ChaosTests_SOURCE})
target_link_libraries(ChaosTests gtest gtest_main) target_link_libraries(ChaosTests gtest gtest_main)
target_include_directories(ChaosTests PRIVATE target_include_directories(ChaosTests PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Chaos> $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Chaos>