[CMake] selecting different libraries for different configuration types?
Roger Dannenberg
rbd at cs.cmu.edu
Wed Nov 11 00:17:25 EST 2009
Just to bring this to closure, I ended up creating a special directory
just to separate the static library target from the dynamic library
target. Both targets use the same sources, so there's some undesirable
redundancy between the two CMakeLists.txt files, but at least I was able
to get different flags for the four versions: static, static-debug,
dynamic, dynamic-debug. The "How can I build my MSVC application with a
static runtime" link was very helpful. -Roger
Philip Lowman wrote:
> On Mon, Nov 2, 2009 at 7:36 PM, Roger Dannenberg <rbd at cs.cmu.edu
> <mailto:rbd at cs.cmu.edu>> wrote:
>
> Tyler Roscoe wrote:
>
> On Mon, Nov 02, 2009 at 06:32:19PM -0500, Roger Dannenberg wrote:
>
>
> set_target_properties(mylib-static PROPERTIES
> CMAKE_C_FLAGS_DEBUG "/MTd")
>
>
>
> Thanks again. COMPILE_FLAGS seems to pass target-specific flags
> and overrides CMAKE_C_FLAGS_<config>, but COMPILE_FLAGS_<config>
> doesn't do anything. I looked at the code in
> cmLocalVisualStudio7Generator.cxx and found where it adds
> COMPILE_FLAGS, but I don't see anything that would support flags
> that are both configuration-specific and target-specific. I hope
> I'm missing something. Any other ideas?
>
>
> Looks like there is a patch in the tracker for this very feature.
> http://public.kitware.com/Bug/view.php?id=6493
>
> Barring the above working, you might be able to adapt something from
> options #2 or #3 below.
> http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
>
> --
> Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091111/63be8ee0/attachment.htm>
More information about the CMake
mailing list