<div dir="ltr">On Wed, Aug 13, 2008 at 3:50 AM, Yuri V. Timenkov <span dir="ltr">&lt;<a href="mailto:ytimenkov@parallels.com">ytimenkov@parallels.com</a>&gt;</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.&nbsp; The short answer to why I would prefer not to do this<br>
<br>1. It&#39;s safe to search for &quot;osgd&quot; and then fallback on &quot;osg&quot; for the _LIBRARY_DEBUG find_library() call on most platforms, but not on MSVC.&nbsp; On MSVC if the user links against &quot;osg.lib&quot; with a debug build the only indication they&#39;ll get that things aren&#39;t working is when they go to run their debug executable and it instantly crashes.&nbsp; This is exactly what will happen if they don&#39;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&#39;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&#39;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>