[CMake] FindQt in a Specific place?

Tyler Roscoe tyler at cryptio.net
Wed Jan 13 14:44:53 EST 2010


On Wed, Jan 13, 2010 at 12:07:47PM -0600, James Willis wrote:
> Like say you did:
> set(QT_QMAKE_LOCATION /home/myself/qt4.6.0/bin)
> so that I later upgrade and do:
> set(QT_QMAKE_LOCATION /home/myself/qt4.6.1/bin) later without having to muck with my path, but still have findQt find Qt there?

I'll add my answer to the list of possibilities even though it's vaguely
abusive of the Find* paradigm:

if (NOT TP_LIBQT_ROOT)
    if (UNIX)
        set (TP_LIBQT_ROOT "${TP_3RDPARTYLIBS_ROOT}/Qt/4.3.3/build/${TP_PLATFORM}/release")
    elseif (WINDOWS)
        # Default to locally installed default location because using Qt
        # installed on a network share is super-duper slow.
        set (TP_LIBQT_ROOT "C:/Qt/4.3.3")
    endif ()
endif ()

set (CMAKE_PREFIX_PATH ${TP_LIBQT_ROOT})
set (QT_USE_QTOPENGL 1)
find_package (Qt4 REQUIRED)


More information about the CMake mailing list