[CMake] restricting Qt include and library linking to 1 library/project

Hicham Mouline hicham at mouline.org
Thu Dec 31 17:16:09 EST 2009


>> -----Original Message-----
<> From: Clinton Stimpson [mailto:clinton at elemtech.com]
><snip>

>ADD_LIBRARY(plot STATIC
>...
>...
>...)
>TARGET_LINK_LIBRARIES(plot "C:/Progra~2/Qt/4.6.0/lib/QtCored4.lib")

>1. from cmd dos: dir "C:/Progra~2/Qt/4.6.0/lib/QtCored4.lib"  => nothing
>   But dir "C:\Progra~2\Qt\4.6.0\lib\QtCored4.lib"  => works

>2. I tried all the following:
>TARGET_LINK_LIBRARIES(plot "C:/Progra~2/Qt/4.6.0/lib/QtCored4.lib")
>TARGET_LINK_LIBRARIES(plot C:/Progra~2/Qt/4.6.0/lib/QtCored4.lib)

>Neither generates a plot.vcjproj containing this .lib at all

>TARGET_LINK_LIBRARIES(plot "C:\Progra~2\Qt\4.6.0\lib\QtCored4.lib")
>TARGET_LINK_LIBRARIES(plot C:\Progra~2\Qt\4.6.0\lib\QtCored4.lib)
>Fail with a syntax error by cmake.

I then tried 

FILE (TO_CMAKE_PATH "C:\\Program Files (x86)\\Qt\\4.6.0\\lib\\QtCored4.lib"
MY_QTCORELIB)
TARGET_LINK_LIBRARIES(plot MY_QTCORELIB)

But still not QtCored4.lib in the vcproj

Rds,



More information about the CMake mailing list