From 5b092916c6ae7ab61c14372f9a1a10ab2f3ed148 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 29 Jan 2023 00:12:16 +0800 Subject: [PATCH] test: combine test deps --- test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9e20151..322945c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.0) enable_testing() +set(TEST_DEPS gtest gtest_main klotski) + ################################################################ unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) @@ -14,16 +16,14 @@ add_library(md5 STATIC ../third_party/md5/md5.cpp) include_directories(../src/klotski_core/utils) add_executable(test_utils utils.cc) -target_link_libraries(test_utils PUBLIC gtest gtest_main) -target_link_libraries(test_utils PUBLIC klotski) +target_link_libraries(test_utils PUBLIC ${TEST_DEPS}) add_test(NAME utils COMMAND test_utils) ################################################################ include_directories(../src/klotski_core/all_cases) add_executable(test_all_cases all_cases.cc) -target_link_libraries(test_all_cases PUBLIC gtest gtest_main) -target_link_libraries(test_all_cases PUBLIC klotski md5) +target_link_libraries(test_all_cases PUBLIC ${TEST_DEPS} md5) add_test(NAME all_cases COMMAND test_all_cases) ################################################################