<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
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<br>
<br>
Philip Lowman wrote:
<blockquote
cite="mid:f168bb790911022011s38839abvf54cf9028de3e5c9@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Mon, Nov 2, 2009 at 7:36 PM, Roger
Dannenberg <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:rbd@cs.cmu.edu">rbd@cs.cmu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Tyler Roscoe wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mon, Nov 02, 2009 at 06:32:19PM -0500, Roger Dannenberg wrote:<br>
<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
set_target_properties(mylib-static PROPERTIES CMAKE_C_FLAGS_DEBUG
"/MTd")<br>
</blockquote>
<br>
</blockquote>
</div>
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?<br>
</blockquote>
<div><br>
Looks like there is a patch in the tracker for this very feature.<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/Bug/view.php?id=6493">http://public.kitware.com/Bug/view.php?id=6493</a><br>
<br>
Barring the above working, you might be able to adapt something from
options #2 or #3 below.<br>
<a moz-do-not-send="true"
href="http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F">http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F</a><br
clear="all">
</div>
</div>
<br>
-- <br>
Philip Lowman<br>
</blockquote>
<br>
</body>
</html>