- 
    Bug 
- 
    Resolution: Fixed
- 
     Not Evaluated Not Evaluated
- 
    Qt Creator 11.0.3, Qt Creator 12.0.1
- 
    None
- 
        5e6f1f5da (12.0)
When using a CMake variable to set the target in qt_add_executable() and qt_add_qml_module() , a new qml file is added in qt_add_executable(), not in qt_add_qml_module().
Steps performed:
- Create a new Qt Quick project
- Replace the target name in qt_add_executable() and qt_add_qml_module() with ${PROJECT_NAME}
- Right click on target name in the project source tree and select Add New... > Qt > QML File
- The QML file is created and added to qt_add_executable in CMakeLists.txt
Before a new qml file is added:
project(myapp VERSION 0.1 LANGUAGES CXX)
qt_add_executable(${PROJECT_NAME}
   main.cpp
)
qt_add_qml_module(${PROJECT_NAME}
   URI test
  VERSION 1.0
  QML_FILES
   Main.qml   
)
 
After the new qml file is added:
qt_add_executable(${PROJECT_NAME}
  main.cpp
  Test.qml //It should be added in qt_add_qml_module
)
qt_add_qml_module(${PROJECT_NAME}
   URI test
  VERSION 1.0
  QML_FILES
  Main.qml
)
| For Gerrit Dashboard: QTCREATORBUG-30218 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 530417,2 | CMakePM: Fix adding qml files to targets using ${PROJECT_NAME} | 12.0 | qt-creator/qt-creator | Status: MERGED | -1 | 0 |