Problem with Build in QML
-
CMake project configuration failed ?
could you please show us your CMakeLists.txt file ? -
CMake project configuration failed ?
could you please show us your CMakeLists.txt file ?@ankou29666 of course
cmake_minimum_required(VERSION 3.16) project(untitled VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.8) qt_add_executable(appuntitled main.cpp ) qt_add_qml_module(appuntitled URI untitled VERSION 1.0 QML_FILES Main.qml ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appuntitled PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appuntitled MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appuntitled PRIVATE Qt6::Quick ) include(GNUInstallDirs) install(TARGETS appuntitled BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
-
I don't remember what is the error message displayed in that case but all I notice is that you define a target name but next define properties for another target name.
either you rename your project to appuntitled, or you rename it untitled everywhere else. But mixing "untitled" in project definition with "appuntitled" everywhere else won't work for sure.
Best practice is to use ${PROJECT_NAME} variable :
project (somename blablabla) qt_add_executable (${PROJECT_NAME} yourfiles) qt_add_qml_module (${PROJECT_NAME} URI your.project.uri RESOURCE_PREFIX someprefix VERSION 1.0 QML_FILES YourQmlFiles.qml )
it's more reliable template than QtCreator's defaults.