[CMake] Choosing between debug and release variants of third-party libraries

Philip Lowman philip at yhbt.com
Thu Nov 8 21:02:47 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Torsten Martinsen wrote:
> I'm sure this is a FAQ, but I cannot find the answer anywhere.
> 
> Using VS 2003, given that I have a third-party library with debug and release variants:
> 
>     /path/to/lib/release/lib.lib
>     /path/to/lib/debug/lib.lib
> 
> how do I get CMake to link with the correct variant? Using an absolute path in TARGET_LINK_LIBRARIES() does not work, and I cannot use CMAKE_BUILD_TYPE at configure time.

#  TARGET_LINK_LIBRARIES: Link a target to given libraries.

  TARGET_LINK_LIBRARIES(target library1
                        <debug | optimized> library2
                        ...)

Specify a list of libraries to be linked into the specified target. The
debug and optimized strings may be used to indicate that the next
library listed is to be used only for that specific type of build

- --
Philip Lowman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHM7/He0tOktX6RKkRAnU6AJ95OnKvg0Ny18tfM7bwboIenhowawCfS6Gj
J1HR+FvK6zS5plAWRut7dBA=
=mahp
-----END PGP SIGNATURE-----


More information about the CMake mailing list