Warning, /frameworks/ki18n/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
0002 
0003 include(ECMAddTests)
0004 
0005 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test Concurrent)
0006 
0007 if (BUILD_WITH_QML)
0008 ecm_add_test(ki18ndeclarativetest.cpp
0009     TEST_NAME "ki18n-declarativetest"
0010     LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Qml KF5::I18n
0011 )
0012 endif()
0013 
0014 ecm_add_test(klocalizedstringtest.cpp
0015     TEST_NAME "ki18n-klocalizedstringtest"
0016     LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent KF5::I18n ${LibIntl_LIBRARIES}
0017 )
0018 # klocalizedstringtest needs the libintl include path
0019 target_include_directories(ki18n-klocalizedstringtest PRIVATE ${LibIntl_INCLUDE_DIRS})
0020 
0021 ecm_add_test(klazylocalizedstringtest.cpp
0022     TEST_NAME "ki18n-klazylocalizedstringtest"
0023     LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::I18n
0024 )
0025 
0026 if (TARGET ktranscript)
0027 ecm_add_test(ktranscripttest.cpp testhelpers.cpp
0028     TEST_NAME "ki18n-ktranscripttest"
0029     LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::I18n
0030 )
0031 # ktranscripttest needs the path to ktranscript in the build dir: it cannot rely
0032 # on the installed version since it must be able to run *before* the plugin is
0033 # installed.
0034 target_compile_definitions(ki18n-ktranscripttest PRIVATE "KTRANSCRIPT_PATH=\"$<TARGET_FILE:ktranscript>\"")
0035 
0036 # ktranscriptcleantest needs to directly compile ktranscript.cpp with an addition DEFINE
0037 ecm_add_test(ktranscriptcleantest.cpp ../src/i18n/ktranscript.cpp ../src/i18n/common_helpers.cpp
0038     TEST_NAME ki18n-ktranscriptcleantest
0039     LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Qml Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent KF5::I18n
0040 )
0041 target_compile_definitions(ki18n-ktranscriptcleantest PRIVATE "KTRANSCRIPT_TESTBUILD")
0042 target_include_directories(ki18n-ktranscriptcleantest PRIVATE ..)
0043 endif()
0044 
0045 add_test(ki18n_install ${CMAKE_CTEST_COMMAND}
0046     --build-and-test
0047     "${CMAKE_CURRENT_SOURCE_DIR}/ki18n_install"
0048     "${CMAKE_CURRENT_BINARY_DIR}/ki18n_install"
0049     --build-generator ${CMAKE_GENERATOR}
0050     --build-makeprogram ${CMAKE_MAKE_PROGRAM}
0051     --build-target install
0052     --build-options
0053         "-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}"
0054         "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ki18n_install/destdir"
0055         "-DKF5I18n_DIR=${CMAKE_BINARY_DIR}/cmake"
0056     --test-command ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/ki18n_install/test.cmake")
0057 
0058 ecm_add_tests(
0059     kcatalogtest.cpp
0060     kcountrytest.cpp
0061     kcountrysubdivisiontest.cpp
0062     ktimezonetest.cpp
0063     LINK_LIBRARIES KF5::I18nLocaleData Qt${QT_MAJOR_VERSION}::Test
0064 )