[CMake] bug ? issue with EXPORT_LIBRARY_DEPENDENCIES
Bill Hoffman
bill.hoffman at kitware.com
Tue Nov 14 21:14:58 EST 2006
Alexander Neundorf wrote:
> Hi,
>
> it seems there's a problem with EXPORT_LIBRARY_DEPENDENCIES(). If there is a library where both the debug and the optimized version are available, both end up in the dependency lib, but not separated by the debug/optimized keywords.
> A testcase is attached. At first build and install demo/dbgtest/, and after that run cmake on demo/dbgtestapp/, then have a look at the file blub.deps.
> I think if you have something like
> set(SOMELIB optimized somelib debug somelibd)
> target_link_libraries(mycoollib ${SOMELIB})
> export_library_dependencies(depsfile)
>
> then it should be either
> SET(mycoollib_LIB_DEPENDS "optimized;somelib;debug;somelibd")
> or
> SET(mycoollib_LIB_DEPENDS "somelib") or SET(mycoollib_LIB_DEPENDS "somelibd") depending on which library was actually used when building.
>
> This affects building KDE on windows, since there both versions of QtCore are found and linked, and so there will be random crashes due to this from what I heard.
>
I just tried your example in VS 2005 and it seemed to work. When I
built release
it said it could not find dbgtest.lib:
1>------ Build started: Project: blubblub, Configuration: Release Win32
------
1>Compiling...
1>dbglib.c
1>Linking...
1>LINK : fatal error LNK1181: cannot open input file 'dbgtest.lib'
But if I build Debug: it fails to find dbgtestd.lib.
1>------ Build started: Project: blubblub, Configuration: Debug Win32 ------
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'dbgtestd.lib'
1>Build log was saved at "file://c:\hoffman\My
Builds\CMakeTests\package\demo\dbgapptest\b\blubblub.dir\Debug\BuildLog.htm"
1>blubblub - 1 error(s), 0 warning(s)
$ less blub.deps
SET(blubblub_LIB_DEPENDS "dbgtest;dbgtestd;")
SET(dbgtest_LINK_TYPE "optimized")
SET(dbgtestd_LINK_TYPE "debug")
library_LINK_TYPE is looked up before a library is output.
So, the example seems to be working ok...
-Bill
More information about the CMake
mailing list