The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=11672 ====================================================================== Reported By: Alexander Assigned To: ====================================================================== Project: CMake Issue ID: 11672 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2011-01-10 06:54 EST Last Modified: 2011-01-10 06:54 EST ====================================================================== Summary: FindQt4.cmake sometimes fails due to exec_program misbehavior Description: FindQt4.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. ====================================================================== 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 ====================================================================== _______________________________________________ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers