qtbase: add cmake test

This commit is contained in:
Tony Theodore 2020-01-18 13:46:49 +11:00
parent a73ac718e0
commit 2a6658cd92
2 changed files with 21 additions and 1 deletions

19
src/qtbase-test.cmake Normal file
View File

@ -0,0 +1,19 @@
# This file is part of MXE. See LICENSE.md for licensing information.
# partial module - included by src/cmake/CMakeLists.txt
set(TGT test-${PKG}-cmake)
enable_language(CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 ${PKG_VERSION} EXACT REQUIRED COMPONENTS Widgets)
add_executable(${TGT} ${CMAKE_CURRENT_LIST_DIR}/qt-test.cpp)
target_link_libraries(${TGT} Qt5::Widgets)
install(TARGETS ${TGT} DESTINATION bin)

View File

@ -96,8 +96,9 @@ define $(PKG)_BUILD
-I'$(1)/test-$(PKG)-pkgconfig' \
`'$(TARGET)-pkg-config' Qt5Widgets$(BUILD_TYPE_SUFFIX) --cflags --libs`
# setup cmake toolchain
# setup cmake toolchain and test
echo 'set(CMAKE_SYSTEM_PREFIX_PATH "$(PREFIX)/$(TARGET)/qt5" ${CMAKE_SYSTEM_PREFIX_PATH})' > '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake'
$(CMAKE_TEST)
# batch file to run test programs
(printf 'set PATH=..\\lib;..\\qt5\\bin;..\\qt5\\lib;%%PATH%%\r\n'; \