Skip to content

Commit 9dbf67e

Browse files
authored
Don't require Kwalify for tests on MSVC
Kwalify is used to validate MLT's YAML files, but it is not available for MSVC easily (eg. via vcpkg). This is only relevant for local setups, because for CI it is covered by other plattforms and the results of YAML validation are plattform independent
1 parent df6c49e commit 9dbf67e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ endif()
336336

337337
if(BUILD_TESTING)
338338
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Core Test)
339-
find_package(Kwalify REQUIRED)
339+
if(NOT MSVC)
340+
# Kwalify is not available for MSVC easily (eg. via vcpkg)
341+
find_package(Kwalify REQUIRED)
342+
endif()
340343
enable_testing()
341344
endif()
342345

src/tests/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ if(MOD_QT6)
5151
)
5252
endif()
5353

54-
55-
file(GLOB YML_FILES "${CMAKE_SOURCE_DIR}/src/modules/*/*.yml")
56-
foreach(YML_FILE ${YML_FILES})
57-
get_filename_component(FILE_NAME ${YML_FILE} NAME)
58-
file(RELATIVE_PATH KWALIFY_TEST_NAME "${CMAKE_SOURCE_DIR}/src/modules" ${YML_FILE})
59-
if(NOT FILE_NAME MATCHES "resolution_scale.yml")
60-
add_test(NAME "kwalify:${KWALIFY_TEST_NAME}" COMMAND ${Kwalify_EXECUTABLE} -f "${CMAKE_SOURCE_DIR}/src/framework/metaschema.yaml" ${YML_FILE})
61-
endif()
62-
endforeach()
54+
if(Kwalify_FOUND)
55+
file(GLOB YML_FILES "${CMAKE_SOURCE_DIR}/src/modules/*/*.yml")
56+
foreach(YML_FILE ${YML_FILES})
57+
get_filename_component(FILE_NAME ${YML_FILE} NAME)
58+
file(RELATIVE_PATH KWALIFY_TEST_NAME "${CMAKE_SOURCE_DIR}/src/modules" ${YML_FILE})
59+
if(NOT FILE_NAME MATCHES "resolution_scale.yml")
60+
add_test(NAME "kwalify:${KWALIFY_TEST_NAME}" COMMAND ${Kwalify_EXECUTABLE} -f "${CMAKE_SOURCE_DIR}/src/framework/metaschema.yaml" ${YML_FILE})
61+
endif()
62+
endforeach()
63+
endif()

0 commit comments

Comments
 (0)