View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011672CMakeCMakepublic2011-01-10 06:542011-05-02 14:46
ReporterAlexander 
Assigned ToClinton Stimpson 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindows 7 64 bitOS Version
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011672: FindQt4.cmake sometimes fails due to exec_program misbehavior
DescriptionFindQt4.cmake uses exec_program() call to retrieve configuration values from qmake, such as QT_VERSION, QT_INSTALL_LIBS or whatever.

However, in my tests exec_program() call sometimes delivers empty output, so FindQt4 module reports errors like these ones (FindQt4.cmake was modified to output intermediate variables):

[Debugging output starts here]

Running C:/Hudson/Common/ThirdParty/qt/win32/bin/qmake.exe with arg QT_VERSION
Got return code 0 and output 4.7.1
Converted output path to 4.7.1 and recorded to QTVERSION
Running C:/Hudson/Common/ThirdParty/qt/win32/bin/qmake.exe with arg QMAKE_MKSPECS
Got return code 0 and output C:/Hudson/Common/ThirdParty/qt\mkspecs
Converted output path to C:/Hudson/Common/ThirdParty/qt/mkspecs and recorded to qt_mkspecs_dirs
Running C:/Hudson/Common/ThirdParty/qt/win32/bin/qmake.exe with arg QT_INSTALL_LIBS
Got return code 0 and output
Converted output path to and recorded to QT_LIBRARY_DIR_TMP

[Debugging output ends here]

Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as
Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:642 (MESSAGE):
 Could NOT find QtCore.

The script qmakeTest.cmake, when run as cmake -P qmakeTest.cmake reproduces this problem approximately ones per several hundreds iterations.

It should be noted that if first part of the script (which uses exec_program) is commented and second part (which uses execute_process) is used instead, things work fine (up to 10,000 iterations - the max I had the time to wait for ;-) ), so, considering exec_program is deprecated, the way to fix this seems to be just to replace exec_program with execute_process.

The primary testing environment was Windows 7 64 bit installed in VirtualBox 3.2.12, though I've got similar error, I believe, on native Windows 7 64 bit installation too.
TagsNo tags attached.
Attached Files? file icon qmakeTest.cmake [^] (683 bytes) 2011-01-10 06:54

 Relationships

  Notes
(0024528)
Michael Wild (reporter)
2011-01-10 07:51

Possibly a bug in cmWin32ProcessExecution? Seems to be the most likely candidate to me...
(0024772)
David Cole (manager)
2011-01-17 12:25

Clinton, any way to eliminate exec_program in favor of execute_process here? The exact reason execute_process was introduced were problems with exec_program similar to those reported here...
(0024780)
Clinton Stimpson (developer)
2011-01-17 13:15

I tried to remove it a while back but had problems. I'll look again.
(0024840)
Clinton Stimpson (developer)
2011-01-17 21:19

Fix put in git : 858fe0e

Had to strip trailing whitespace for execute_process() to work.
(0026359)
David Cole (manager)
2011-05-02 14:46

Closing resolved issues that have not been updated in more than 3 months.

 Issue History
Date Modified Username Field Change
2011-01-10 06:54 Alexander New Issue
2011-01-10 06:54 Alexander File Added: qmakeTest.cmake
2011-01-10 07:51 Michael Wild Note Added: 0024528
2011-01-17 12:24 David Cole Assigned To => Clinton Stimpson
2011-01-17 12:24 David Cole Status new => assigned
2011-01-17 12:25 David Cole Note Added: 0024772
2011-01-17 13:15 Clinton Stimpson Note Added: 0024780
2011-01-17 21:19 Clinton Stimpson Note Added: 0024840
2011-01-17 21:19 Clinton Stimpson Status assigned => resolved
2011-01-17 21:19 Clinton Stimpson Resolution open => fixed
2011-05-02 14:46 David Cole Note Added: 0026359
2011-05-02 14:46 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team