You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to create a library with a map widget in Qt. This i the CMakeLists.txt
cmake_minimum_required (VERSION 3.22)
project (bcgf-map)
add_definitions (-DBCGF_MAP_EXPORTS)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTOUIC ON)
set (CMAKE_AUTORCC ON)
find_package (Boost REQUIRED QUIET)
find_package (Qt5 COMPONENTS Core Gui Widgets Qml Quick Location Positioning REQUIRED)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../)
include_directories (${Boost_INCLUDE_DIRS})
set (PROJECT_SRC
Widget.cpp
)
set (PROJECT_QRC
Resources/qml.qrc
)
add_library (${PROJECT_NAME} SHARED ${PROJECT_SRC} ${PROJECT_QRC})
target_link_libraries(
${PROJECT_NAME}
PUBLIC
bcgf-core
Qt5::Widgets
Qt5::Gui
Qt5::GuiPrivate
Qt5::Qml
Qt5::Quick
Qt5::Location
Qt5::Positioning
${Boost_LIBRARIES}
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
The library is built correctly, and when I run the application that links it, I obtain the following error in the console:
qrc:/qml/map.qml:4:1: module "QtPositioning" is not installed
import QtPositioning 5.15
^
qrc:/qml/map.qml:3:1: module "QtLocation" is not installed
import QtLocation 5.15
^
qrc:/qml/map.qml:4:1: module "QtPositioning" is not installed
import QtPositioning 5.15
^
qrc:/qml/map.qml:3:1: module "QtLocation" is not installed
import QtLocation 5.15
I've tried to copy manually the declarative_locationd.dll and the declarative_positioningd.dll libraries in the same path of the executable but nothing change.
What I need to do in order to import the modules correctly and there's a way to do it from inside CMake with already defined commands, instead of creating functions for making the needed operations?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to create a library with a map widget in Qt. This i the
CMakeLists.txt
The library is built correctly, and when I run the application that links it, I obtain the following error in the console:
This is the qml:
I've tried to copy manually the
declarative_locationd.dll
and thedeclarative_positioningd.dll
libraries in the same path of the executable but nothing change.What I need to do in order to import the modules correctly and there's a way to do it from inside CMake with already defined commands, instead of creating functions for making the needed operations?
Beta Was this translation helpful? Give feedback.
All reactions