1
0
mirror of https://github.com/woo-j/zint.git synced 2024-12-23 13:33:55 +03:00
zint/backend_qt/tests/CMakeLists.txt
gitlost 5669addf01 CMake: allow ctest to be run without having to install zint or
manually set LD_LIBRARY_PATH and PATH (ticket #279, props
  Alexey Dokuchaev)
2023-01-09 01:14:42 +00:00

29 lines
849 B
CMake

# Copyright (C) 2021-23 Robin Stuart <rstuart114@gmail.com>
# vim: set ts=4 sw=4 et :
cmake_minimum_required(VERSION 3.5)
project(QZint_tests LANGUAGES CXX)
enable_testing()
if(USE_QT6)
find_package(Qt6Test REQUIRED)
else()
find_package(Qt5Test REQUIRED)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
add_executable(test_qzint test_qzint.cpp)
target_link_libraries(test_qzint PRIVATE QZint Qt${QT_VERSION_MAJOR}::Test)
add_test(NAME qzint COMMAND test_qzint)
if(MSVC)
set_tests_properties(qzint PROPERTIES ENVIRONMENT
"PATH=${CMAKE_BINARY_DIR}/backend/${CMAKE_BUILD_TYPE}\;${CMAKE_BINARY_DIR}/frontend/${CMAKE_BUILD_TYPE}\;$ENV{PATH}")
else()
set_tests_properties(qzint PROPERTIES ENVIRONMENT
"LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/backend;PATH=${CMAKE_BINARY_DIR}/frontend:$ENV{PATH}")
endif()