[CMake] TARGET_LINK_DIRECTORIES, ADD_SUBDIRECTORY, winpaths and vs2008
Clinton Stimpson
clinton at elemtech.com
Fri Jan 1 10:51:49 EST 2010
On 01/01/2010 08:00 AM, Hicham Mouline wrote:
>
> Hello,
>
> I branch this question out of another post that I posted earlier.
>
> My top-level cmakelists.txt :
>
> ...
>
> ADD_SUBDIRECTORY(lib3)
>
> ...
>
> In the source tree, the lib3 directory includes a CMakeListst.xt:
>
> ADD_LIBRARY(lib3 .....)
>
> FILE(TO_CMAKE_PATH "C:\\Program Files
> (x86)\\Qt\\4.6.0\\lib\\QtCored4.lib" MY_QTCORELIB)
>
> MESSAGE(STATUS "MY_QTCORELIB=${MY_QTCORELIB}")
>
> TARGET_LINK_LIBRARIES(lib3 ${MY_QTCORELIB})
>
> I expect the lib3.vcproj to include the QtCored4.lib, or in the IDE to
> appear in Librarian/General/Additional Dependencies.
>
> But it doesn't,
>
Because its a static library, and static libraries don't link against
other libraries.
But you did tell CMake that lib3 depends on Qt, so when lib3 is linked
into an executable, you'll see the Qt libraries linked then too.
Clint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100101/567e4a6b/attachment.htm>
More information about the CMake
mailing list