Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [solved]CMake cannot find QT5

[solved]CMake cannot find QT5

Scheduled Pinned Locked Moved Installation and Deployment
8 Posts 2 Posters 13.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GGILOYAN
    wrote on last edited by
    #1

    Hi

    I whant to build OSG with QT5.
    With qt4 it works fine but with QT5 I get the following message from CMake

    CMake Warning at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:616 (message):
    c:/Qt/Qt5.3.0/5.3/msvc2013_opengl/bin/qmake.exe reported QT_INSTALL_LIBS as
    "C:/Qt/Qt5.3.0/5.3/msvc2013_opengl/lib" but QtCore could not be found
    there. Qt is NOT installed correctly for the target build environment.

    Please advise

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show the Qt 5 part of your CMakeList.txt ? Also, do you have e.g. Qt5CoreConfig.cmake in your installation somewhere ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GGILOYAN
        wrote on last edited by
        #3

        Hi

        There is not Qt5CoreConfig.cmake file in my installation somewhere.

        This is the part where tryed to find qt

        Include macro utilities here

        @INCLUDE(OsgMacroUtils)

        OPTION(OSG_USE_QT "Enable to use Qt (build Qt-dependent libraries, plugins and examples)" ON)

        IF(OSG_USE_QT AND NOT ANDROID)

        To select a specific version of QT define DESIRED_QT_VERSION

        via cmake -DDESIRED_QT_VERSION=5

        QUIET option disables messages if the package cannot be found.

        IF  (DESIRED_QT_VERSION)
            IF  (DESIRED_QT_VERSION MATCHES 5)
                  FIND_PACKAGE(Qt5Widgets)
            ELSEIF (DESIRED_QT_VERSION MATCHES 4)
                  FIND_PACKAGE(Qt4)
            ELSE()
                  FIND_PACKAGE(Qt3)
            ENDIF()
        
        ELSE()
        
            FIND_PACKAGE(Qt5Widgets QUIET)
        
            IF ( Qt5Widgets_FOUND )
                # CMake 2.8.8 or greater required
                BUILDER_VERSION_GREATER(2 8 7)
                IF(NOT VALID_BUILDER_VERSION)
                    MESSAGE(
                    SEND_ERROR
                    "Qt5 requires CMake version 2.8.8 or greater!\n"
                    "Update CMake or set DESIRED_QT_VERSION to less than 5
                    or disable OSG_USE_QT."
                    )
                ENDIF( )
            ENDIF( )
        
            IF ( NOT Qt5Widgets_FOUND )
                FIND_PACKAGE(Qt4)
        
                IF (NOT QT4_FOUND)
                    FIND_PACKAGE(Qt3)
                ENDIF()
            ENDIF()
        ENDIF()
        
        #If we have found Qt5, let's try to top off by getting the webkit as well
        IF ( Qt5Widgets_FOUND )
            FIND_PACKAGE(Qt5WebKitWidgets QUIET)
        ENDIF()
        

        ENDIF()@

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Do you have any cmake related file in your Qt installation ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GGILOYAN
            wrote on last edited by
            #5

            What do you mean exactly ?
            Before I built other project with Qt4. That's all

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I meant:

              check if C:/Qt/Qt5.3.0/5.3/msvc2013_opengl/ contains anything cmake related

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • G Offline
                G Offline
                GGILOYAN
                wrote on last edited by
                #7

                I have solved the problem writing this

                @set(CMAKE_PREFIX_PATH "C:\Qt\Qt5.3.0\5.3\msvc2013_opengl" CACHE PATH "")
                set(CMAKE_LIBRARY_PATH "C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86")
                set(Qt5Widgets_DIR "c:\Qt\Qt5.3.0\5.3\msvc2013_opengl\lib\cmake\Qt5Widgets\")@

                Thanks

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You're welcome !

                  Since you have it finding Qt 5 now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved