[Interest] Rebuilding cmake project (in Qt Creator) fails - build directories write-protected?

Till Oliver Knoll till.oliver.knoll at gmail.com
Wed Dec 30 12:33:25 CET 2020


Dear all,

It's been a while since I asked my last question here - or posted
anything meaningful, for that matter - so first of all "Hello!" and
"Merry Christmas / Holidays" :)

I have started a new Qt 5.15.2 (open source) project on Windows 10 (due
to a dependency on Flight Simulator 2020, specifically SimConnect.dll
;)), and since Qt 6 will default to cmake (as I understand) I also chose
cmake in the Qt Creator 4.14.0.

*The problem: *"rebuilding" (QtCreator: "Build/Rebuild All Projects")
the project fails when trying to generate the translation *.ts files
respectively the correspoding "list" (?) file:


FAILED: C:/dev/Qt/MainWindow/MainWindow_de_DE.ts
CMakeFiles/MainWindow_de_DE.ts_lst_file
cmd.exe /C "cd /D
C:\dev\Qt\build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug &&
C:\Qt\5.15.2\mingw81_64\bin\lupdate.exe
@C:/dev/Qt/build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/CMakeFiles/MainWindow_de_DE.ts_lst_file
-ts C:/dev/Qt/MainWindow/MainWindow_de_DE.ts"
lupdate error: List file
'C:/dev/Qt/build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/CMakeFiles/*MainWindow_de_DE.ts_lst_file'
is not readable.*
ninja: build stopped: subcommand failed.

Initially I thought that this is yet another issue with whitespace in
the build path, but that's not the case (I now moved it from
c:/Users/Oliver Knoll/work/... to c:/dev/Qt/work/... - that is, no
spaces in path anymore).


However I noticed that some directories in the "build" directory
(c:/dev/Qt/build-MainWindow-Desktop_...) have the "Write Protected" flag
set:

.cmake
CMakeFiles
MainWindow_autogen

The Windows 10 "Properties" dialog says: "Write-Protected (only concerns
files in the directory)" (or similar, in German: "Schreibgeschützt
(betrifft nur Dateien im Ordner).

So when trying to manually delete those folders a dialog pops up asking
me for administrator rights, and when I click on Continue (with admin
rights) then another dialog tells me that I need the corresponding
access rights from user "Oliver Knoll" - well, that's exactly my user
(with admin rights).

However I can "cd" into the remaining directories and delete all files
without problems, and after that I can delete the entire build folder at
last.

Back in Qt Creator a CTRL + B (Build Project "MainWindow") then
re-builds the project again.


Another - proper? - solution, in Qt Creator (all in "Build" menu):

* Clean Project "MainWindow"
* Clear CMake Configuration (at that point the subdirectory
.cmake/api/v1/query (and reply) still remains, plus 3 "ninja" related
files and cmake_install.cmake)
* Run CMake
* Rebuild Project "MainWindow"

It works, but... really? 4 steps instead of just one? Is that the proper
"CMake way" (I am totally new to CMake) to rebuild a project from scratch?

The above example refers to a simple "MainWindow" project setup in Qt
Creator as follows:

* New File Or Project
* Qt Widgets Application
* Name: MainWindow (any name)
* Build System: CMake
* Default classes/files, including Generate form
* Add any translation language
* Default Qt Kit: Qt 5.15.2 MinGW 64-bit
* No version control

The above experiments were done with the default generated CMakeLists.txt.


*Development environment:*

* Qt 5.15.2 Open Source
* QtCreator 4.14.0
* CMake 3.19.0 (installed via Qt Installer)
* Windows 10 2004 (all updates installed)
* Except the MS FS2020 SDK (SimConnect.dll) there are no other developer
tools installed (specifically no other CMake, no Visual Studio, no other
compilers etc.)
* "Default Windows Home installation" (one user - Oliver Knoll - with
admin rights; yes, it's a "gaming machine" ;))


*Other:
*

* Most likely not relevant, but: it is a "Windows To Go" installation
(created/installed via tool "WinToUSB"), installed on an external SSD
(which is connected to a Mac ;))

The full compilation error during a "Rebuild" (without clearing the
CMake configuration):

12:02:08: Running steps for project MainWindow...
12:02:08: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build .
--target clean
[1/2 54.3/sec] Cleaning additional files...
[2/2 83.6/sec] Cleaning all built files...
Cleaning... 0 files.
12:02:08: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited normally.
12:02:08: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build .
--target all
[1/6 2.7/sec] Automatic MOC and UIC for target MainWindow
[2/6 5.1/sec] Generating C:/dev/Qt/MainWindow/MainWindow_de_DE.ts
FAILED: C:/dev/Qt/MainWindow/MainWindow_de_DE.ts
CMakeFiles/MainWindow_de_DE.ts_lst_file
cmd.exe /C "cd /D
C:\dev\Qt\build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug &&
C:\Qt\5.15.2\mingw81_64\bin\lupdate.exe
@C:/dev/Qt/build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/CMakeFiles/MainWindow_de_DE.ts_lst_file
-ts C:/dev/Qt/MainWindow/MainWindow_de_DE.ts"
lupdate error: List file
'C:/dev/Qt/build-MainWindow-Desktop_Qt_5_15_2_MinGW_64_bit-Debug/CMakeFiles/MainWindow_de_DE.ts_lst_file'
is not readable.
ninja: build stopped: subcommand failed.
12:02:09: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited with
code 1.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201230/4cbe4134/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201230/4cbe4134/attachment.sig>


More information about the Interest mailing list