From 9c687bd723dce7113ab19269115ae649365a38c2 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 26 Apr 2024 22:55:58 +0200 Subject: [PATCH] Fix include directories of test targets after a7fdc1af1 The include directories need to be set for test targets as well; otherwise they cannot compile unless tests link against the main target as well. --- cmake/modules/TestUtilities.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/modules/TestUtilities.cmake b/cmake/modules/TestUtilities.cmake index 89410c1..ebcede5 100644 --- a/cmake/modules/TestUtilities.cmake +++ b/cmake/modules/TestUtilities.cmake @@ -52,9 +52,10 @@ function (configure_test_target) PRIVATE "${ARGS_LIBRARIES}" "${PRIVATE_LIBRARIES}") target_include_directories( "${TEST_TARGET_NAME}" - PUBLIC $ $ + PUBLIC $ + $ $ ${PUBLIC_INCLUDE_DIRS} - PRIVATE ${TEST_INCLUDE_DIRS} "${PRIVATE_INCLUDE_DIRS}") + PRIVATE ${TEST_INCLUDE_DIRS} ${PRIVATE_INCLUDE_DIRS}) target_compile_definitions( "${TEST_TARGET_NAME}" PUBLIC "${META_PUBLIC_COMPILE_DEFINITIONS}"