[Development] Installing Qt5Config.cmake from the Qt repo?

Thiago Macieira thiago.macieira at intel.com
Wed Nov 2 11:17:31 CET 2011


On Wednesday, 2 de November de 2011 11:09:36 Stephen Kelly wrote:
> On Tuesday, November 01, 2011 17:03:22 Thiago Macieira wrote:
> > On Tuesday, 1 de November de 2011 15:58:10 Stephen Kelly wrote:
> > > It is completely granular. Qt5Config.cmake and Qt5Use.cmake are just
> > > simple aggregators as discussed.
> > 
> > If you have one project per CMakeLists.txt file, yeah, it's useful.
> > 
> > If you have more than project with different requirements, you need to do
> > it differently.
> 
> I also don't understand this email.

Consider the following:

project(MyLib)
find_target(Qt5 REQUIRED QtCore QtGui QtDeclarative QtTest)
include(${Qt5Core_USE_FILE})
include(${Qt5Gui_USE_FILE})
include(${Qt5Declarative_USE_FILE})

add_library(mylib SHARED ${mylib_SRCS})
target_link_libraries(mylib
    ${Qt5Core_LIBRARY} 
    ${Qt5Gui_LIBRARY} 
    ${Qt5Declarative_LIBRARY}
)

add_executable(tst_mylib NOGUI ${tst_mylib_SRC})
target_link_libraries(mylib
    ${Qt5Core_LIBRARY} 
    ${Qt5Gui_LIBRARY} 
    ${Qt5Declarative_LIBRARY}
    ${Qt5Test_LIBRARY} 
)

The test does not compile because there is no -I$QTDIR/include/QtTest. How do 
I tell it to include those headers *only* when compiling the test, not when 
compiling the library?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111102/b732b236/attachment.sig>


More information about the Development mailing list