This is my CMakelists.txt file.
cmake_minimum_required(VERSION 3.0.2)
project(osm_map)
find_package(catkin REQUIRED COMPONENTS rviz)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
set(QT_LIBRARIES Qt5::Widgets Qt5::Qml)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(SRC_FILES
src/core.cpp
)
add_library(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES})
When I try to compile my project with catkin_make -Wno-dev --only-pkg-with-deps osm_map
, it seems to find every module of QT (I also tested others not shown below) but not QML. Error message:
CMake Error at osm_map/CMakeLists.txt:53 (target_link_libraries):
Target "osm_map" links to:
Qt5::Qml
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
QT QML is installed on my system and the path /usr/include/x86_64-linux-gnu/qt5/QtQml
and includes the necessary headers. And idea why I could do? The find_package
call for QT is supposed to find all libaries and headers shipped with QT, maybe that is the part that is not working properly for QML?