benlau / quickflux

A Flux implementation for QML
Apache License 2.0
327 stars 74 forks source link

QT Creator complains `QML module not found (QuickFlux)` #23

Closed ThomasDebrunner closed 4 years ago

ThomasDebrunner commented 5 years ago

I can run the todo demo just fine from within QT Creator. However, the editor keeps complaining that QML module not found (QuickFlux). I am using CMake, and this is my CmakeLists.txt:

cmake_minimum_required(VERSION 3.10.0)

project(todo)

set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOMOC ON)

set(CMAKE_AUTOUIC ON)

set(CMAKE_AUTORCC ON)

find_package(Qt5Qml CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Quick CONFIG REQUIRED)

set(todo_SRCS
    main.cpp
    qml.qrc
)

include(ExternalProject)

ExternalProject_Add(QuickFlux
        PREFIX "${PROJECT_BINARY_DIR}/QuickFlux-build"
        GIT_REPOSITORY "https://github.com/benlau/quickflux.git"
        CMAKE_ARGS "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
                    "-DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/QuickFlux"
                    "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
)

link_directories("${PROJECT_BINARY_DIR}/QuickFlux/lib")
include_directories("${PROJECT_BINARY_DIR}/QuickFlux/include")

add_executable(todo ${todo_SRCS})
add_dependencies(todo QuickFlux)

target_link_libraries(todo debug quickfluxd optimized quickflux)
target_link_libraries(todo Qt5::Qml Qt5::Gui Qt5::Core Qt5::Quick)

How can I tell QT Creator that the library is present?

cerkiewny commented 5 years ago

Had same issue, make sure to call registerQuickFluxQmlTypes()