Warning, /libraries/atcore/unittests/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: AtCore Authors
0002 # SPDX-License-Identifier: BSD-3-Clause
0003 find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS
0004     Test
0005 )
0006 # Helper macro TEST used to created rules to build, link, install and run tests
0007 macro(TEST NAME FILE)
0008     add_executable(${NAME} ${FILE} )
0009     target_link_libraries(
0010         ${NAME}
0011         AtCore
0012         Qt::Core Qt::Test
0013         )
0014 
0015     if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
0016         # Run test using wine
0017         if(WINE_PROGRAM)
0018             add_test(
0019                 NAME ${NAME}
0020                 COMMAND "$<TARGET_FILE:${NAME}>"
0021                 WORKING_DIRECTORY ${WINDOWS_STAGING_TESTS}
0022                 )
0023             # Set WINEPATH (%PATH%) to WINDOWS_STAGING_TESTS allowing wine to find dlls
0024             # WINEDEBUG=-all is used to avoid anoying winde debug outputs
0025             set_tests_properties(${NAME} PROPERTIES ENVIRONMENT "WINEPATH=${WINDOWS_STAGING_TESTS};WINEDEBUG=-all")
0026             set_tests_properties(${NAME} PROPERTIES DEPENDS PrepareTests)
0027         endif()
0028     else()
0029         add_test(NAME ${NAME} COMMAND  $<TARGET_FILE:${NAME}>)
0030     endif()
0031 endmacro()
0032 
0033 TEST(AtCoreTests atcoretests.cpp)
0034 TEST(GcodeTests gcodetests.cpp)
0035 TEST(TemperatureTests temperaturetests.cpp)
0036 TEST(BedDeformTests beddeformtests.cpp)
0037