Mercurial > hgrepos > Python2 > PyMuPDF
view mupdf-source/thirdparty/zint/cmake/zint_add_test.cmake @ 46:7ee69f120f19 default tip
>>>>> tag v1.26.5+1 for changeset b74429b0f5c4
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 11 Oct 2025 17:17:30 +0200 |
| parents | b50eed0cc0ef |
| children |
line wrap: on
line source
# Copyright (C) 2021-2024 Robin Stuart <rstuart114@gmail.com> # Adapted from qrencode/tests/CMakeLists.txt # Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org> # vim: set ts=4 sw=4 et : macro(zint_add_test test_name test_command) set(ADDITIONAL_LIBS "${ARGN}" ${LIBRARY_FLAGS}) if(ZINT_SHARED) add_executable(${test_command} ${test_command}.c) target_link_libraries(${test_command} testcommon ${ADDITIONAL_LIBS}) if(NOT (ZINT_USE_PNG AND PNG_FOUND)) target_compile_definitions(${test_command} PRIVATE ZINT_NO_PNG) endif() add_test(${test_name} ${test_command}) if(MSVC) set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR};PATH=${CMAKE_BINARY_DIR}/backend/${CMAKE_BUILD_TYPE}\;${CMAKE_BINARY_DIR}/frontend/${CMAKE_BUILD_TYPE}\;$ENV{PATH}") else() set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/backend;PATH=${CMAKE_BINARY_DIR}/frontend:$ENV{PATH}") endif() endif() if(ZINT_STATIC) add_executable(${test_command}-static ${test_command}.c) target_link_libraries(${test_command}-static testcommon-static ${ADDITIONAL_LIBS}) if(NOT (ZINT_USE_PNG AND PNG_FOUND)) target_compile_definitions(${test_command}-static PRIVATE ZINT_NO_PNG) endif() add_test(${test_name}-static ${test_command}-static) if(MSVC) set_tests_properties(${test_name}-static PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR};PATH=${CMAKE_BINARY_DIR}/backend/${CMAKE_BUILD_TYPE}\;${CMAKE_BINARY_DIR}/frontend/${CMAKE_BUILD_TYPE}\;$ENV{PATH}") else() set_tests_properties(${test_name}-static PROPERTIES ENVIRONMENT "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/backend;PATH=${CMAKE_BINARY_DIR}/frontend:$ENV{PATH}") endif() endif() endmacro()
