From f275a1fa28230568d23ddf071eaf6638a59b662f Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 18 Sep 2019 14:10:52 +0200 Subject: [PATCH] CMake Build: Fix CMake configuration when BUILD_WITH_TESTS=ON The GMock/GTest unittest was not working with the latest translation patches. Change-Id: I83e337c6278cb93344c734c05d090a65def34a3b Reviewed-by: Tobias Hunger --- cmake/QtCreatorAPI.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index db98b9751cc..5e3ea2534c8 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -201,7 +201,10 @@ function(set_public_includes target includes) endforeach() endfunction() -function(fix_test_environment test_name) +function(finalize_test_setup test_name) + # Never translate tests: + set_tests_properties(${name} PROPERTIES QT_SKIP_TRANSLATION ON) + if (WIN32) list(APPEND env_path $ENV{PATH}) list(APPEND env_path ${CMAKE_BINARY_DIR}/${IDE_PLUGIN_PATH}) @@ -828,11 +831,8 @@ function(add_qtc_test name) if (NOT _arg_GTEST) add_test(NAME ${name} COMMAND ${name}) - fix_test_environment(${name}) + finalize_test_setup(${name}) endif() - - # Never translate tests: - set_tests_properties(${name} PROPERTIES QT_SKIP_TRANSLATION ON) endfunction() function(finalize_qtc_gtest test_name) @@ -841,6 +841,6 @@ function(finalize_qtc_gtest test_name) gtest_add_tests(TARGET ${test_name} SOURCES ${test_sources} TEST_LIST test_list) foreach(test IN LISTS test_list) - fix_test_environment(${test}) + finalize_test_setup(${test}) endforeach() endfunction()