From 585979140ecf4eb782b4d41e482b56de94d54fd4 Mon Sep 17 00:00:00 2001 From: wep21 Date: Mon, 29 Apr 2024 17:45:57 +0900 Subject: [PATCH] update workaround in rviz_rendering_tests Signed-off-by: wep21 --- rviz_rendering_tests/CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rviz_rendering_tests/CMakeLists.txt b/rviz_rendering_tests/CMakeLists.txt index 148e81559..bf4f114cd 100644 --- a/rviz_rendering_tests/CMakeLists.txt +++ b/rviz_rendering_tests/CMakeLists.txt @@ -32,14 +32,17 @@ find_package(ament_cmake REQUIRED) if(BUILD_TESTING) # do find_package(rviz_ogre_vendor) first to make sure the custom OGRE is found find_package(rviz_ogre_vendor REQUIRED) - if(Qt5_DIR AND NOT QT_DIR) - set(QT_DIR "${Qt5_DIR}" CACHE PATH "" FORCE) + if(MSVC) + set(QT_VERSION_MAJOR 5) + find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) + function(qt_wrap_cpp out) + qt5_wrap_cpp(_sources ${ARGN}) + set("${out}" ${_sources} PARENT_SCOPE) + endfunction() + else() + find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) + find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) endif() - if(Qt6_DIR AND NOT QT_DIR) - set(QT_DIR "{Qt6_DIR}" CACHE PATH "" FORCE) - endif() - find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) - find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) find_package(rviz_rendering REQUIRED) find_package(resource_retriever REQUIRED)