Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101072

Choosing a project name with a dash inside creates a broken cmake configuration

    XMLWordPrintable

Details

    Description

      Choose "File/New...", pick "Application (Qt)", pick "Qt Quick Application".

      Use "dashy-dashman" as the "Name".

      Trying to build the project runs into

      FAILED: CMakeFiles/appdashy-dashman.dir/appdashy-dashman_qmltyperegistrations.cpp.o 
      /usr/bin/g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -I/home/prcs1076/tmp/build-dashy-dashman-Desktop_Qt_6_3_0_GCC_64bit-Debug/appdashy-dashman_autogen/include -I/home/prcs1076/tmp/dashy-dashman -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQml/6.3.0 -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQml/6.3.0/QtQml -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtCore/6.3.0 -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtCore/6.3.0/QtCore -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtCore -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include -isystem /home/prcs1076/Qt/6.3.0/gcc_64/mkspecs/linux-g++ -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQml -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQmlIntegration -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtNetwork -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQuick -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtGui -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtQmlModels -isystem /home/prcs1076/Qt/6.3.0/gcc_64/include/QtOpenGL -g -fPIC -MD -MT CMakeFiles/appdashy-dashman.dir/appdashy-dashman_qmltyperegistrations.cpp.o -MF CMakeFiles/appdashy-dashman.dir/appdashy-dashman_qmltyperegistrations.cpp.o.d -o CMakeFiles/appdashy-dashman.dir/appdashy-dashman_qmltyperegistrations.cpp.o -c /home/prcs1076/tmp/build-dashy-dashman-Desktop_Qt_6_3_0_GCC_64bit-Debug/appdashy-dashman_qmltyperegistrations.cpp
      /home/prcs1076/tmp/build-dashy-dashman-Desktop_Qt_6_3_0_GCC_64bit-Debug/appdashy-dashman_qmltyperegistrations.cpp:17:47: error: expected initializer before ‘-’ token
         17 | Q_QMLTYPE_EXPORT void qml_register_types_dashy-dashman()
            |                                               ^
      /home/prcs1076/tmp/build-dashy-dashman-Desktop_Qt_6_3_0_GCC_64bit-Debug/appdashy-dashman_qmltyperegistrations.cpp:22:67: error: ‘qml_register_types_dashy’ was not declared in this scope
         22 | static const QQmlModuleRegistration registration("dashy-dashman", qml_register_types_dashy-dashman);
            |                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~
      /home/prcs1076/tmp/build-dashy-dashman-Desktop_Qt_6_3_0_GCC_64bit-Debug/appdashy-dashman_qmltyperegistrations.cpp:22:92: error: ‘dashman’ was not declared in this scope
         22 | static const QQmlModuleRegistration registration("dashy-dashman", qml_register_types_dashy-dashman);
            |                                                                                            ^~~~~~~
      [15/18 11.7/sec] Building CXX object CMakeFiles/appdashy-dashman.dir/.rcc/qmlcache/appdashy-dashman_main_qml.cpp.o
      [16/18 12.4/sec] Building CXX object CMakeFiles/appdashy-dashman.dir/main.cpp.o
      [17/18 11.7/sec] Building CXX object CMakeFiles/appdashy-dashman.dir/.rcc/qmlcache/appdashy-dashman_qmlcache_loader.cpp.o
      ninja: build stopped: subcommand failed.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ulherman Ulf Hermann
              cajus Cajus Pollmeier
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes