Results 1 to 2 of 2

Thread: Problem while building Qt5 with cmake

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows
    Thanks
    75
    Thanked 24 Times in 21 Posts

    Default Problem while building Qt5 with cmake

    Hi all...
    There is problem during building Qt5 with cmake. What's the problem?
    Here is the error:

    CMake Error at CMakeLists.txt:15 (qt5_use_modules):
    Unknown CMake command "qt5_use_modules".

    And in following comes CMakeLists.txt file:

    cmake_minimum_required(VERSION 2.8.8)
    project(untitled4)

    # Tell CMake to run moc when necessary:
    set(CMAKE_AUTOMOC ON)
    # As moc files are generated in the binary dir, tell CMake
    # to always look for includes there:
    set(CMAKE_INCLUDE_CURRENT_DIR ON)

    # Widgets finds its own dependencies.
    find_package(Qt5Widgets REQUIRED)

    add_executable(untitled4 main.cpp mainwindow.cpp)

    qt5_use_modules(untitled4 Widgets)

  2. #2
    Join Date
    Oct 2006
    Posts
    279
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    6
    Thanked 40 Times in 39 Posts

    Default Re: Problem while building Qt5 with cmake

    According to the documentation it you need cmake 2.8.9.
    Qt Code:
    1. cmake_minimum_required(VERSION 2.8.9)
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Very frustrating problem with cmake
    By kurrachow in forum Newbie
    Replies: 3
    Last Post: 21st March 2011, 16:17
  2. Problem when linking a Qt Unit Test with CMake
    By NoRulez in forum Qt Programming
    Replies: 6
    Last Post: 10th June 2010, 18:30
  3. Problem building QtSingleApplication
    By skuallpa in forum Installation and Deployment
    Replies: 0
    Last Post: 28th April 2010, 16:20
  4. problem while building
    By mohanakrishnan in forum Newbie
    Replies: 4
    Last Post: 28th October 2009, 13:29
  5. Replies: 0
    Last Post: 2nd September 2008, 05:29

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
  •  
Qt is a trademark of The Qt Company.