<div dir="ltr"><div>Hello.</div>This solution worked for me as expected!<div>I only had to edit the file and rerun configure-generate-compile-install.<br><div>Thank you very much.</div><div><br></div><div>Fernando.</div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-17 0:48 GMT+01:00 Richard Ling <span dir="ltr"><<a href="mailto:Richard.Ling@cisra.canon.com.au" target="_blank">Richard.Ling@cisra.canon.com.au</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-AU" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I also needed to do this recently.  I am no expert on CMake or VTK, but I was able to find a way that worked for me.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I use PCL which uses VTK.  PCL already uses different names for libraries (eg., pcl_xxx_debug.lib and pcl_xxx_release.lib).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I wanted the PCL debug libs to link with VTK debug libs, and PCL release libs to link with VTK release libs.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Find vtkModuleMacros.cmake, and find the line:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">  set_property(TARGET ${_name} PROPERTY OUTPUT_NAME ${_vtk}${_name}${_lib_suffix})<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I replaced this with:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">  set_property(TARGET ${_name} PROPERTY DEBUG_OUTPUT_NAME ${_vtk}${_name}${_lib_suffix}_d)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">  set_property(TARGET ${_name} PROPERTY RELEASE_OUTPUT_NAME ${_vtk}${_name}${_lib_suffix})<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The CMake documentation I referred to for these properties is here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="https://cmake.org/cmake/help/v3.3/command/set_target_properties.html" target="_blank">https://cmake.org/cmake/help/v3.3/command/set_target_properties.html</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">See the paragraph starting “</span>Properties that affect the name of a target’s output file are as follows”.<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Then I opened VTK build in CMake-gui, re-ran “configure”, re-ran “generate”<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Opened the updated VTK build files in my IDE (Visual Studio 2015) (using Administrator mode, so that the install can succeed)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Rebuilt INSTALL using “debug” configuration, then again using “release” configuration<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Checked in the VTK install directory, both debug and release libraries are there side by side.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Then repeated all that for PCL: “configure”, “generate”, INSTALL debug, INSTALL release.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">When I opened the updated PCL build files in the IDE, I could see that the debug build of PCL was linking the VTK libs with the “_d” suffix.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Which is exactly what I wanted.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">A final note: my project which uses PCL, uses the Visual Studio IDE build system directly (not CMake).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So in the debug build, I had to manually add the “_d” suffix to the VTK import libraries.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Otherwise my executable would have loaded both release and debug  versions of the same VTK DLL, causing chaos.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hope this helps.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> vtkusers [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>]
<b>On Behalf Of </b>Fernando Nellmeldin<br>
<b>Sent:</b> Tuesday, 16 February 2016 3:28 AM<br>
<b>To:</b> <a href="mailto:ben.boeckel@kitware.com" target="_blank">ben.boeckel@kitware.com</a><br>
<b>Cc:</b> vtk-users<br>
<b>Subject:</b> Re: [vtkusers] Generate debug libraries with _d postfix<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Thank you for your response. <u></u><u></u></p>
<div>
<p class="MsoNormal">I checked the file with the function name, but I didn't know what to do.<u></u><u></u></p>
<div>
<p class="MsoNormal">For the current time, I guess I could do it manually. It is just a quick find & rename that shouldn't take long.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Fernando.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2016-02-12 17:43 GMT+01:00 Ben Boeckel <<a href="mailto:ben.boeckel@kitware.com" target="_blank">ben.boeckel@kitware.com</a>>:<u></u><u></u></p>
<p class="MsoNormal">On Fri, Feb 12, 2016 at 10:26:18 +0100, Fernando Nellmeldin wrote:<br>
> However, that doesn't work for VTK 6.3.0 nor VTK 7.0.0. (for 5.10 does just<br>
> what I want).<br>
<br>
Probably due to the module system changes for VTK6.<br>
<br>
> Any thoughts of how to do the same on these versions?<br>
<br>
Some logic could be added to CMake/vtkModuleMacros.cmake:624 or so<br>
(inside of vtk_module_library) to do this for Windows.<br>
<br>
> PS: I'm using CMake with VS2010 generator under windows8, but I think the<br>
> solution should be general.<br>
<br>
Well, at least on Windows. Other platforms don't have the debug/release<br>
runtime library split and such things are annoying to work with<br>
elsewhere (I regularly debug a single library and not having to build<br>
the entire stack because the library name changed is a big plus).<br>
<span style="color:#888888"><br>
<span>--Ben</span></span><u></u><u></u></p>
</div>
</div>
</div>
</div></div></div>
The information contained in this email message and any attachments may be confidential and may also be the subject to legal professional privilege. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is
 unauthorised and prohibited. If you have received this email in error, please immediately advise the sender by return email and delete the information from your system.
</div>

</blockquote></div><div><br></div>
</div></div></div>