Results 1 to 7 of 7

Thread: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

  1. #1
    Join Date
    Jan 2006
    Location
    11 N 78 E
    Posts
    110
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    Hello. In connection with a project I am working on, I found some related Qt-based code at https://code.google.com/p/cornucopia-lib/

    So I cloned the hg repo, and did:
    Qt Code:
    1. mkdir build
    2. cd build
    3. cmake ..
    To copy to clipboard, switch view to plain text mode 
    but I got the following errors:
    Qt Code:
    1. CMake Error: The following variables are used in this project, but
    2. they are set to NOTFOUND.
    3. Please set them or make sure they are set and tested correctly in the
    4. CMake files:
    5. QT_QTSCRIPT_INCLUDE_DIR (ADVANCED)
    6. used as include directory in directory
    7. /home/samjnaa/sr/_repos/hg/cornucopia-lib/DemoUI
    8. QT_QTSVG_INCLUDE_DIR (ADVANCED)
    9. used as include directory in directory
    10. /home/samjnaa/sr/_repos/hg/cornucopia-lib/DemoUI
    11. used as include directory in directory
    12. /home/samjnaa/sr/_repos/hg/cornucopia-lib/Tools
    13. -- Configuring incomplete, errors occurred!
    To copy to clipboard, switch view to plain text mode 
    I wrote to the author about this but he was not sure what the problem was. So I hope someone here can indicate to me how I can fix these errors.

    I am running Kubuntu Raring 64-bit with Qt 4.8.4 and CMake 2.8.10.

    Thank you!
    Penguin #395953 using Qt for open-source development on X11 using C++ and
    Python via PyQt

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    The CMake Qt find module uses the Qt4 qmake: is it in the PATH?

    You could try this at the top of DemoUI/ CMakeLists.txt:
    Qt Code:
    1. # CmakeLists.txt in DemoUI
    2.  
    3. FIND_PACKAGE(Qt4 COMPONENTS QtSvg QtScript REQUIRED)
    4. SET(QT_USE_QTSVG TRUE)
    5. SET(QT_USE_QTSCRIPT TRUE)
    6. INCLUDE(${QT_USE_FILE})
    7.  
    8. ...
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to ChrisW67 for this useful post:

    jamadagni (25th June 2013)

  4. #3
    Join Date
    Jan 2006
    Location
    11 N 78 E
    Posts
    110
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    Quote Originally Posted by ChrisW67 View Post
    The CMake Qt find module uses the Qt4 qmake: is it in the PATH?
    Yes it is.
    You could try this at the top of DemoUI/ CMakeLists.txt:
    Qt Code:
    1. FIND_PACKAGE(Qt4 COMPONENTS QtSvg QtScript REQUIRED)
    To copy to clipboard, switch view to plain text mode 
    Thank you very much! This worked to remove this particular error, but now I am getting the following error:
    Qt Code:
    1. Scanning dependencies of target DemoUI
    2. [ 58%] Building CXX object DemoUI/CMakeFiles/DemoUI.dir/GroupSelWidget.cpp.o
    3. In file included from /home/samjnaa/sr/_repos/hg/cornucopia-lib/DemoUI/GroupSelWidget.cpp:21:0:
    4. /home/samjnaa/sr/_repos/hg/cornucopia-lib/DemoUI/GroupSelWidget.h:26:19: fatal error: QWidget: No such file or directory
    5. #include <QWidget>
    6. ^
    7. compilation terminated.
    8. make[2]: *** [DemoUI/CMakeFiles/DemoUI.dir/GroupSelWidget.cpp.o] Error 1
    9. make[1]: *** [DemoUI/CMakeFiles/DemoUI.dir/all] Error 2
    10. make: *** [all] Error 2
    To copy to clipboard, switch view to plain text mode 
    But I have the Qt headers installed (indeed I'm sure it would have complained earlier if I had not):
    Qt Code:
    1. $ dpkg -S QWidget
    2. ...
    3. libqt4-dev: /usr/include/qt4/QtGui/QWidget
    4. ...
    To copy to clipboard, switch view to plain text mode 
    I am guessing that some CMake command is pointing to the wrong include directory or something. (Or perhaps the code needs to use "QtGui/" as in #include <QtGui/QWidget> but I'd prefer to hack the CMakeLists.txt if possible.) Please tell me what correction I have to do to get *this* working now?
    Penguin #395953 using Qt for open-source development on X11 using C++ and
    Python via PyQt

  5. #4
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    Qt Code:
    1. //#include <QtGui/QWidget>
    2. #include <QtWidgets/QtWidgets>
    To copy to clipboard, switch view to plain text mode 

  6. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    No, the module name is not needed in the include (especially not the Qt5 one saman_artorious suggests).
    Add QtGui and maybe QtCore to the COMPONENTS in your CMakeLists.txt

  7. The following user says thank you to ChrisW67 for this useful post:

    jamadagni (25th June 2013)

  8. #6
    Join Date
    Jan 2006
    Location
    11 N 78 E
    Posts
    110
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    Quote Originally Posted by ChrisW67 View Post
    No, the module name is not needed in the include (especially not the Qt5 one saman_artorious suggests).
    Add QtGui and maybe QtCore to the COMPONENTS in your CMakeLists.txt
    Hi thank you very much -- I definitely preferred to not touch the sources and your suggestion worked (yes I needed to include QtCore too -- apparently there was #include <QSet> in there). BTW presumably the authors' CMake script worked at the time of their upload -- any idea it does not work now?
    Penguin #395953 using Qt for open-source development on X11 using C++ and
    Python via PyQt

  9. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error "variable set to NOTFOUND" in compiling a Qt project wtih CMake

    The problem would appear to be a change in the behaviour of the CMake Qt4 find module, not Qt.

Similar Threads

  1. Replies: 0
    Last Post: 20th November 2011, 13:41
  2. "Cannot find -lqjpeg" error when compiling QT application in static mode
    By JonathanReez in forum Installation and Deployment
    Replies: 7
    Last Post: 6th September 2011, 16:44
  3. Replies: 5
    Last Post: 17th May 2011, 12:47
  4. Replies: 3
    Last Post: 15th February 2010, 18:27
  5. Replies: 3
    Last Post: 8th July 2008, 20:37

Tags for this Thread

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.