MantisBT - CMake
View Issue Details
0012352CMakeModulespublic2011-07-20 02:282016-06-10 14:31
Dubrovskiy Viacheslav 
Alex Neundorf 
normalmajorhave not tried
closedmoved 
Linux
CMake 2.8.5 
CMake 2.8.12 
0012352: Problem with version handling of FindQt4.cmake
According to the file modules / readme.txt, without specifying the variable version XXX_FIND_VERSION should not exist, variables XXX_FIND_VERSION_MAJOR,
XXX_FIND_VERSION_MINOR, XXX_FIND_VERSION_PATCH and XXX_FIND_VERSION_TWEAK,
XXX_FIND_VERSION_COUNT. At the moment there is a variable XXX_FIND_VERSION
always defined, variables XXX_FIND_VERSION_MAJOR,
XXX_FIND_VERSION_MINOR, XXX_FIND_VERSION_PATCH and XXX_FIND_VERSION_TWEAK at
no indication of version set to a random value.

In this unpredictable execution module assembly from falling to the assembly
improperly collected files.


diff -Naur cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx cmake-2.8.5/Source/cmFindPackageCommand.cxx
--- cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx 2011-07-08 15:12:50.000000000 +0400
+++ cmake-2.8.5/Source/cmFindPackageCommand.cxx 2011-07-19 13:39:01.640015703 +0400
@@ -1731,10 +1731,10 @@
 
       // Try to parse the version number and store the results that were
       // successfully parsed.
- unsigned int parsed_major;
- unsigned int parsed_minor;
- unsigned int parsed_patch;
- unsigned int parsed_tweak;
+ unsigned int parsed_major = 0;
+ unsigned int parsed_minor = 0;
+ unsigned int parsed_patch = 0;
+ unsigned int parsed_tweak = 0;
       this->VersionFoundCount =
         sscanf(this->VersionFound.c_str(), "%u.%u.%u.%u",
                &parsed_major, &parsed_minor,
@@ -1751,6 +1751,7 @@
     }
 
   result_version = this->Makefile->GetSafeDefinition("PACKAGE_VERSION");
+ if(!this->VersionFoundCount) this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION");
   if (result_version.empty())
     {
     result_version = "unknown";
No tags attached.
related to 0012414closed Clinton Stimpson Mistakes in FindQt3.cmake and FindQt4.cmake Qt version definition 
patch FindQt4.cmake.patch (659) 2011-08-16 18:40
https://public.kitware.com/Bug/file/4005/FindQt4.cmake.patch
patch cmake-alt-fix-QT_MIN_VERSION.patch (3,017) 2011-08-20 09:15
https://public.kitware.com/Bug/file/4015/cmake-alt-fix-QT_MIN_VERSION.patch
Issue History
2011-07-20 02:28Dubrovskiy ViacheslavNew Issue
2011-08-03 14:37Brad KingAssigned To => Brad King
2011-08-03 14:37Brad KingStatusnew => assigned
2011-08-03 14:39Brad KingNote Added: 0027159
2011-08-03 14:42Brad KingNote Added: 0027160
2011-08-03 14:43Brad KingNote Added: 0027161
2011-08-03 14:58Dubrovskiy ViacheslavNote Added: 0027164
2011-08-03 16:01Brad KingAssigned ToBrad King => Alex Neundorf
2011-08-03 16:02Brad KingNote Added: 0027165
2011-08-16 18:39Alex NeundorfNote Added: 0027208
2011-08-16 18:40Alex NeundorfFile Added: FindQt4.cmake.patch
2011-08-16 21:47Dubrovskiy ViacheslavNote Added: 0027210
2011-08-17 19:05Alex NeundorfNote Added: 0027225
2011-08-17 19:05Alex NeundorfCategoryCMake => Modules
2011-08-19 12:41Dubrovskiy ViacheslavNote Added: 0027248
2011-08-20 09:15Dubrovskiy ViacheslavFile Added: cmake-alt-fix-QT_MIN_VERSION.patch
2011-08-20 09:17Dubrovskiy ViacheslavNote Added: 0027254
2011-08-22 15:23Alex NeundorfRelationship addedrelated to 0012414
2011-08-22 18:10Alex NeundorfNote Added: 0027262
2011-08-22 18:20Alex NeundorfNote Edited: 0027262bug_revision_view_page.php?bugnote_id=27262#r406
2011-08-22 18:33Alex NeundorfSummaryError in the formation of variable versions of => Problem with version handling of FindQt4.cmake
2011-10-23 09:44Alex NeundorfNote Added: 0027631
2011-10-23 13:12Dubrovskiy ViacheslavNote Added: 0027632
2011-12-15 16:55Alex NeundorfNote Added: 0027990
2012-08-13 14:44Alex NeundorfTarget Version => CMake 2.8.10
2012-10-18 14:03Alex NeundorfTarget VersionCMake 2.8.10 => CMake 2.8.11
2013-05-17 09:33Robert MaynardTarget VersionCMake 2.8.11 => CMake 2.8.12
2016-06-10 14:28Kitware RobotNote Added: 0041867
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027159)
Brad King   
2011-08-03 14:39   
The code your patch touches has nothing to do with the XXX_FIND_* variables documented in readme.txt. It is used for package configuration version files as documented in the find_package command:

  http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package [^]

and here:

  http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Package_Version_Files [^]
(0027160)
Brad King   
2011-08-03 14:42   
The hunk that initializes parsed_* variables is unnecessary. The variable values are used only when sscanf returns a sufficiently large value indicating that each variable has been set.

The hunk that removes the definition of PACKAGE_FIND_VERSION is also unnecessary. When the method returns the local "varScope" variable destructor pops a level off the (dynamic scope) stack and the original value (if any) of the variable is restored.
(0027161)
Brad King   
2011-08-03 14:43   
Can you please post a test case showing your original problem?
(0027164)
Dubrovskiy Viacheslav   
2011-08-03 14:58   
Yes. Since updating cmake get error in qutim:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr '-DCMAKE_C_FLAGS:STRING=-pipe -Wall -g -
O2' '-DCMAKE_CXX_FLAGS:STRING=-pipe -Wall -g -O2' -DLIB_SUFFIX=64 -
DPHONON_INCLUDE_DIR=/usr/include/kde4
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so -
found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib64/libX11.so
-- Checking for Doxygen...
-- Found Doxygen: /usr/bin/doxygen
-- [+] XSETTINGSDIALOG: extension added to build
-- [+] TRAYICON: extension added to build
-- [+] SOUNDTHEMESELECTOR: extension added to build
-- Softkeys is unsupported by platform. Softkeys action box will be skipped.
-- [+] SOFTKEYSACTIONBOX: extension added to build
-- [+] SIMPLEROSTERSTORAGE: extension added to build
-- [+] TORYCONTACTLISTWIDGET: extension added to build
-- [+] SIMPLECONTACTLISTWIDGET: extension added to build
-- [+] TREECONTACTSMODEL: extension added to build
-- [+] SEPARATEDCONTACTSMODEL: extension added to build
-- [+] PLAINCONTACTSMODEL: extension added to build
-- [+] SIMPLECONTACTLIST: extension added to build
-- [+] SIMPLEACTIONS: extension added to build
-- [+] SIMPLEACTIONBOX: extension added to build
-- [+] SIMPLEABOUT: extension added to build
-- [+] SHORTCUTSETTINGS: extension added to build
-- [+] SESSIONHELPER: extension added to build
-- [+] SERVICECHOOSER: extension added to build
-- [+] SEARCHDIALOG: extension added to build
-- [+] QTICONS: extension added to build
-- [+] QSOUNDBACKEND: extension added to build
-- [+] PROXYSETTINGS: extension added to build
-- [+] PLISTCONFIG: extension added to build
-- [+] PASSWORD: extension added to build
-- [+] OLDSOUNDTHEME: extension added to build
-- [+] NOTIFICATIONSSETTINGS: extension added to build
-- [+] NOTIFICATIONFILTER: extension added to build
-- [+] NOCRYPTOSERVICE: extension added to build
-- [+] MOBILESETTINGSDIALOG: extension added to build
-- [+] MOBILENOTIFICATIONSSETTINGS: extension added to build
-- [+] MOBILECONTACTINFO: extension added to build
-- [+] MOBILEABOUT: extension added to build
-- [+] MIGRATION02X03: extension added to build
-- [+] METACONTACTS: extension added to build
-- [+] LOCALIZATION: extension added to build
-- [+] KOPETEEMOTICONSBACKEND: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] KINETICSCROLLER: extension added to build
-- [+] JSONHISTORY: extension added to build
-- [+] JSONCONFIG: extension added to build
-- [+] JOINGROUPCHATDLG: extension added to build
-- [+] JOINCHATDIALOG: extension added to build
-- [+] IDLESTATUSCHANGER: extension added to build
-- checking for module 'xscrnsaver'
-- found xscrnsaver, version 1.2.1
-- [+] IDLEDETECTOR: extension added to build
-- [*] ICONS/HICOLOR: Directory hicolor will be installed to
share/apps/qutim/icons/hicolor
-- [+] HUMANITY-ICONS: extension added to build
-- [+] FILETRANSFERSETTINGS: extension added to build
-- [+] FILETRANSFER: extension added to build
-- [+] EMOTICONSSETTINGS: extension added to build
-- [+] DATAFORMSBACKEND: extension added to build
-- [+] CONTACTINFO: extension added to build
-- [+] CHATSPELLCHECKER: extension added to build
-- [+] CHATNOTIFICATIONSBACKEND: extension added to build
-- [+] AUTHDIALOG: extension added to build
-- [+] ADIUMSRVICONS: extension added to build
-- [+] TABBEDCHATFORM: extension added to build
-- [+] STACKEDCHATFORM: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] WEBKITCHAT: extension added to build
-- [+] TEXTCHAT: extension added to build
-- [+] ADIUMCHAT: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] ADDCONTACTDLG: extension added to build
-- [+] ACCOUNTCREATOR: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] WALL: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [*] VPHOTOALBUM/DEFAULT: Directory default will be installed to
share/apps/qutim/vphotoalbum/default
-- [+] PHOTOALBUM: extension added to build
-- [+] VKONTAKTE: extension added to build
-- checking for module 'purple>=2.6.0'
-- found purple, version 2.9.0
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] QUETZAL: extension added to build
-- [+] XSTATUS: extension added to build
-- [+] IDENTIFY: extension added to build
-- [+] OSCAR: extension added to build
-- [+] MRIM: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- checking for module 'qca2'
-- found qca2, version 2.0.3
-- Found QCA2: /usr/lib64/libqca.so
-- Found libidn: /usr/lib64/libidn.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.5")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] JABBER: extension added to build
-- [+] IRC: extension added to build
-- checking for module 'TelepathyQt4>=0.3.0'
-- found TelepathyQt4, version 0.7.1
-- [+] ASTRAL: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] YANDEXNAROD: extension added to build
-- Could NOT find WinThings API layer library.
-- WinThings API layer library cannot be built by your compiler.
-- You should specify WINTHINGS_APILAYER_LIBRARY if you have prebuild library.
-- 'Windows Integration' plugin will be skipped.
-- [+] WININTEGRATION: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] WEATHER: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] URLPREVIEW: extension added to build
-- [+] UNREADMESSAGESKEEPER: extension added to build
-- checking for module 'dbusmenu-qt>=0.8.1'
-- package 'dbusmenu-qt>=0.8.1' not found
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Cannot build unity launcher integration
-- [+] UNITYLAUNCHER: extension added to build
-- Symbian integration will be skipped
-- [+] SYMBIANINTEGRATION: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] SDLSOUND: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] SCRIPTAPI: extension added to build
-- [+] QRCICONS: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [*] QMLCHAT/DEFAULT: Directory default will be installed to
share/apps/qutim/qmlchat/default
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] QMLCHAT: extension added to build
-- Found LibAttica: /usr/lib64/libattica.so (found suitable version "0.2.0",
required is "0.1.0")
-- Found BZip2: /usr/lib64/libbz2.so
-- Looking for BZ2_bzCompressInit in /usr/lib64/libbz2.so
-- Looking for BZ2_bzCompressInit in /usr/lib64/libbz2.so - found
-- Looking for lzma_auto_decoder in /usr/lib64/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib64/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib64/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib64/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib64/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib64/liblzma.so - found
-- Found LIBLZMA: /usr/include
-- [+] PLUGMAN: extension added to build
-- Found Phonon: /usr/lib64/libphonon.so
-- Found Phonon Includes: /usr/include/kde4/KDE;/usr/include/kde4
-- [+] PHONONSOUND: extension added to build
-- Could NOT find Qt4 (missing: QT_QXML_INCLUDE_DIR QT_QXML_LIBRARY) (found
suitable version "4.7.3", required is "4.6.0")
-- [+] OLDDELEGATE: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [+] NOWPLAYING: extension added to build
-- Couldn't find any version of QtMobility.
-- Using QtMobility version:
-- QtMobility not found.
-- Mobility plugin set will be skipped
-- [+] MOBILITY: extension added to build
-- [+] MASSMESSAGING: extension added to build
-- Macintegration plugin will be skipped
-- [+] MACINTEGRATION: extension added to build
-- [+] LOGGER: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is
"4.6.0")
-- [*] QUICKPOPUP/GLASS: Directory glass will be installed to
share/apps/qutim/quickpopup/glass
-- [*] QUICKPOPUP/DEFAULT: Directory default will be installed to
share/apps/qutim/quickpopup/default
-- [+] KINETICPOPUPS: extension added to build
CMake Error at /usr/share/kde4/apps/cmake/modules/FindQt4.cmake:514 (MESSAGE):
  Invalid Qt version string given: "4.6.0", major version 4 is required, e.g.
  "4.0.1"
Call Stack (most recent call first):
  /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:422 (find_package)
  /usr/share/CMake/Modules/FindKDE4.cmake:95 (FIND_PACKAGE)
  plugins/kdeintegration/CMakeLists.txt:3 (find_package)


-- Configuring incomplete, errors occurred!
(0027165)
Brad King   
2011-08-03 16:02   
Alex, would you please try to reproduce this? Thanks.
(0027208)
Alex Neundorf   
2011-08-16 18:39   
Viacheslav,

please apply the attached patch to FindQt4.cmake to your /usr/share/kde4/apps/cmake/modules/FindQt4.cmake .
This only adds some debug output.
Then please run cmake again and post the output here please.

Thanks
Alex
(0027210)
Dubrovskiy Viacheslav   
2011-08-16 21:47   
===skip===

-- Found QCA2: /usr/lib/libqca.so
-- Found libidn: /usr/lib/libidn.so
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.5")
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is "4.6.0")
-- [+] JABBER: extension added to build
-- checking for module 'TelepathyQt4>=0.3.0'
-- found TelepathyQt4, version 0.7.1.1
-- [+] ASTRAL: extension added to build
-- checking for module 'purple>=2.6.0'
-- found purple, version 2.9.0
-- [+] QUETZAL: extension added to build
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.3", required is "4.6.0")
-- QT_MIN_VERSION: -4.6.0- Qt4_FIND_VERSION: -4.6.0- req_qt_major_vers --
CMake Error at /usr/share/kde4/apps/cmake/modules/FindQt4.cmake:515 (MESSAGE):
  Invalid Qt version string given: "4.6.0", major version 4 is required, e.g.
  "4.0.1"
Call Stack (most recent call first):
  /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:422 (find_package)
  /usr/share/CMake/Modules/FindKDE4.cmake:95 (FIND_PACKAGE)
  plugins/kdeintegration/CMakeLists.txt:3 (find_package)
(0027225)
Alex Neundorf   
2011-08-17 19:05   
This is weird, req_qt_major_vers is empty according to the output you posted.
This is the code from FindQt4.cmake:

STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers
            "${QT_MIN_VERSION}")
IF (NOT req_qt_major_vers)
   MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\",
                                             expected e.g. \"4.0.1\"")
ENDIF (NOT req_qt_major_vers)

STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers
              "${QT_MIN_VERSION}")
...
IF( Qt4_FIND_VERSION )
   SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} )
   SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} )
...
ENDIF( Qt4_FIND_VERSION )

So, if QT_MIN_VERSION is set, req_qt_major_vers should be set from the regexp at the top.
If Qt4_FIND_VERSION is set (via find_package), then req_qt_major_vers is set to Qt4_FIND_VERSION_MAJOR, which is set automatically by the find_package() command.

I think the only possible explanation is that Qt4_FIND_VERSION is set, and Qt4_FIND_VERSION_MAJOR is not set. But I have no idea how this should be possible.

Can you add some more debug output, e.g. to print the values of the Qt4_FIND_VERSION_MAJOR/MINOR/PATCH variables, and so that it also shows whether cmake went into the if() block ?

Alex
(0027248)
Dubrovskiy Viacheslav   
2011-08-19 12:41   
> Can you add some more debug output, e.g. to print the values of the Qt4_FIND_VERSION_MAJOR/MINOR/PATCH variables, and so that it also shows whether cmake went into the if() block ?

Yes I can, but I do not know exactly what and where to write. It would be better if you showed the patch.
(0027254)
Dubrovskiy Viacheslav   
2011-08-20 09:17   
Look at the latest patch. It solves the problem.
Regexp fixes and adds less frightening message about the correct version.
(0027262)
Alex Neundorf   
2011-08-22 18:10   
(edited on: 2011-08-22 18:20)
Hmm, your patch contains basically three separate changes.

* slightly changed error message, that's fine

* it changes the regexp for getting the minor version from QTVERSION and QT_MIN_VERSION
This change has the effect that it can now handle minor versions which consist of multiple digits, like e.g. 4.10.5, right ?
But this shouldn't be the case here for you, according to the log messages "4.7.3" was found, and required is "4.6.0".
So, this is not the change which fixes the problem for you, right ?

* the part where also Qt4_FIND_VERSION_MAJOR/MINOR/PATCH are set. But this also shouldn't change anything for you. These variables are not used in the find_package_handle_standard_args() macro, which is called afterwards to compare the version numbers. Is this the change which fixes the problem for you ?
What values do these variables have if you don't set them ?

Can you create a minimal testcase which reproduces the problem ?
I just tried here with a tiny Qt4 project and it worked for, both using QT_MIN_VERSION and also when specifying the version directly in the find_package() call.

Alex

(0027631)
Alex Neundorf   
2011-10-23 09:44   
Am I right with my assumption that your Qt has a somewhat different version number ?

Alex
(0027632)
Dubrovskiy Viacheslav   
2011-10-23 13:12   
Here is a simple testcase:

[builder@localhost BUILD]$ cat ../CMakeLists.txt
cmake_minimum_required (VERSION 2.6 FATAL_ERROR)

project( testKDE4 )

set(QT_MIN_VERSION "4.6.0")

find_package(Qt4 COMPONENTS QtCore QtGui)
find_package(KDE4)


[builder@localhost BUILD]$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake-qt4 (found suitable version "4.7.4", required is "4.6.0")
CMake Error at /usr/share/kde4/apps/cmake/modules/FindQt4.cmake:514 (MESSAGE):
  Invalid Qt version string given: "4.6.0", major version 4 is required, e.g.
  "4.0.1"
Call Stack (most recent call first):
  /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:422 (find_package)
  /usr/share/CMake/Modules/FindKDE4.cmake:95 (FIND_PACKAGE)
  CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!

[builder@localhost BUILD]$ rpm -qa | grep qt4-dev
libqt4-devel-4.7.4-alt2
libtelepathy-qt4-devel-0.7.3-alt1
(0027990)
Alex Neundorf   
2011-12-15 16:55   
This one seems to be the same:
https://bugs.kde.org/show_bug.cgi?id=288993 [^]
(0041867)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.