<div dir="ltr">On Wed, Aug 13, 2008 at 3:50 AM, Yuri V. Timenkov <span dir="ltr"><<a href="mailto:ytimenkov@parallels.com">ytimenkov@parallels.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why not find two libraries always and and then use<br>
set(${module_uc}_LIBRARY debug ${module_uc}_LIBRARY_DEBUG optimized ${module_uc}_LIBRARY_RELEASE)<br>
This way CMake will use proper libraries for debug and release modes in studio.</blockquote><div><br>Finding two libraries would certainly be the simplest approach. The short answer to why I would prefer not to do this<br>
<br>1. It's safe to search for "osgd" and then fallback on "osg" for the _LIBRARY_DEBUG find_library() call on most platforms, but not on MSVC. On MSVC if the user links against "osg.lib" with a debug build the only indication they'll get that things aren't working is when they go to run their debug executable and it instantly crashes. This is exactly what will happen if they don't have the debug libraries installed.<br>
<br>2. I see no reason to clutter the cache with additional _LIBRARY_DEBUG variables if the user doesn't desire them.<br><br>The compromise of setting *_LIBRARY_DEBUG to *_LIBRARY unless the user needs to selectively link against debug libraries seems to be a reasonable one to me (otherwise it greatly complicates TARGET_LINK_LIBRARIES())<br>
<br>I can have a control variable that determines whether or not these DEBUG variables are created in the cache, I just can't find an easy way to delete them if the user changes their mind after initial configure.<br>
<br></div></div><br>-- <br>Philip Lowman<br>
</div>