File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,13 @@ set(CMAKE_AUTOMOC ON)
17
17
## We'll use the version that rviz used so they are compatible.
18
18
if (rviz_QT_VERSION VERSION_LESS "5" )
19
19
message (STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
20
- find_package (Qt4 COMPONENTS QtCore QtGui REQUIRED )
20
+ find_package (Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui )
21
+ ## pull in all required include dirs, define QT_LIBRARIES, etc.
21
22
include (${QT_USE_FILE} )
22
23
else ()
23
24
message (STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
24
- find_package (Qt5Widgets REQUIRED )
25
- find_package (Qt5Core REQUIRED )
26
- find_package (Qt5OpenGL REQUIRED )
27
- ## Set the QT_LIBRARIES variable for Qt5, so it can be used below.
25
+ find_package (Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets )
26
+ ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
28
27
set (QT_LIBRARIES Qt5::Widgets )
29
28
endif ()
30
29
Original file line number Diff line number Diff line change @@ -17,14 +17,13 @@ set(CMAKE_AUTOMOC ON)
17
17
## We'll use the version that rviz used so they are compatible.
18
18
if (rviz_QT_VERSION VERSION_LESS "5" )
19
19
message (STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
20
- find_package (Qt4 COMPONENTS QtCore QtGui REQUIRED )
20
+ find_package (Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui )
21
+ ## pull in all required include dirs, define QT_LIBRARIES, etc.
21
22
include (${QT_USE_FILE} )
22
23
else ()
23
24
message (STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION} " )
24
- find_package (Qt5Widgets REQUIRED )
25
- find_package (Qt5Core REQUIRED )
26
- find_package (Qt5OpenGL REQUIRED )
27
- ## Set the QT_LIBRARIES variable for Qt5, so it can be used below.
25
+ find_package (Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets )
26
+ ## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
28
27
set (QT_LIBRARIES Qt5::Widgets )
29
28
endif ()
30
29
You can’t perform that action at this time.
0 commit comments