Results 1 to 2 of 2

Thread: lupdate error: Passing a CMakeLists.txt as project file is not supported

  1. #1
    Join Date
    Sep 2024
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default lupdate error: Passing a CMakeLists.txt as project file is not supported

    We are using QT 6.7.2 and started a simple application with one label.
    Also have tree translation files.
    We added a label to the UI with a text tr("Welcome).

    Now we try to use the buildin tool Linguist and update translations

    The following issues where found:

    Starting external tool "C:\Qt\6.7.2\mingw_64\bin\lupdate.exe D:/QTProjects/Test/Translation1/CMakeLists.txt"
    lupdate error: Passing a CMakeLists.txt as project file is not supported.
    Please use the 'qt_add_lupdate' CMake command and build the 'update_translations' target.
    "C:\Qt\6.7.2\mingw_64\bin\lupdate.exe" finished with error

    What are we doing wrong?
    Have we forgot something?

    Please advise

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: lupdate error: Passing a CMakeLists.txt as project file is not supported

    Have you read the documentation on using Linguist in a cmake build?

    You need to add two commands to your CMakelists.txt file:

    One to add the CMake components needed to invoke Linquist during build time:

    Qt Code:
    1. find_package(Qt6 REQUIRED COMPONENTS LinguistTools)
    To copy to clipboard, switch view to plain text mode 

    And another to actually invoke Linguist to create .ts files for your sources:

    Qt Code:
    1. qt_add_lupdate(target TS_FILES file1.ts [file2.ts ...]
    2. [SOURCES source1.cpp [sources2.cpp ...]]
    3. [INCLUDE_DIRECTORIES directory1 [directory2 ...]]
    4. [NO_GLOBAL_TARGET]
    5. [OPTIONS ...])
    To copy to clipboard, switch view to plain text mode 

    The documentation explains what these commands and their parameters mean.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. No such file or directory error on Non QT Project
    By franbogaz in forum Qt Programming
    Replies: 3
    Last Post: 29th November 2016, 21:54
  2. Replies: 3
    Last Post: 20th September 2016, 17:29
  3. Replies: 1
    Last Post: 25th November 2013, 04:59
  4. Replies: 4
    Last Post: 9th August 2012, 21:08
  5. Extra qualification error while compiling the project file
    By amit_pansuria in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2007, 07:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.