[vtkusers] Generate debug libraries with _d postfix

Thales Luis Rodrigues Sabino tluisrs at gmail.com
Tue Feb 16 19:42:13 EST 2016


Well,

Configuring the Debug Post Fix in the CMake command line works fine with
me. I also use PCL and VTK 6.3.0.
This is the command line I use to build VTK

cmake -DCMAKE_DEBUG_POSTFIX=_d ../../Downloads/VTK-6.3.0

And the libraries are generated with _d suffix.

There is also the possibility of defining CMAKE_RELEASE_POSTFIX for a
suffix to be added in the release libraries.


On Tue, Feb 16, 2016 at 10:16 PM, Chungzuwalla <
richard at research.canon.com.au> wrote:

> 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.
> I use PCL which uses VTK.  PCL already uses different names for libraries
> (eg., pcl_xxx_debug.lib and pcl_xxx_release.lib).
> I wanted the PCL debug libs to link with VTK debug libs, and PCL release
> libs to link with VTK release libs.
>
> Find vtkModuleMacros.cmake, and find the line:
>   set_property(TARGET ${_name} PROPERTY OUTPUT_NAME
> ${_vtk}${_name}${_lib_suffix})
> I replaced this with:
>   set_property(TARGET ${_name} PROPERTY DEBUG_OUTPUT_NAME
> ${_vtk}${_name}${_lib_suffix}_d)
>   set_property(TARGET ${_name} PROPERTY RELEASE_OUTPUT_NAME
> ${_vtk}${_name}${_lib_suffix})
>
> The CMake documentation I referred to for these properties is here:
> https://cmake.org/cmake/help/v3.3/command/set_target_properties.html
> See the paragraph starting “Properties that affect the name of a target’s
> output file are as follows”.
>
> Then I opened VTK build in CMake-gui, re-ran “configure”, re-ran “generate”
> Opened the updated VTK build files in my IDE (Visual Studio 2015) (using
> Administrator mode, so that the install can succeed)
> Rebuilt INSTALL using “debug” configuration, then again using “release”
> configuration
> Checked in the VTK install directory, both debug and release libraries are
> there side by side.
>
> Then repeated all that for PCL: “configure”, “generate”, INSTALL debug,
> INSTALL release.
> 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.
> Which is exactly what I wanted.
>
> A final note: my project which uses PCL, uses the Visual Studio IDE build
> system directly (not CMake).
> So in the debug build, I had to manually add the “_d” suffix to the VTK
> import libraries.
> Otherwise my executable would have loaded both release and debug  versions
> of the same VTK DLL, causing chaos.
>
> Hope this helps.
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Generate-debug-libraries-with-d-postfix-tp5736543p5736601.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Thales Luis Rodrigues Sabino

PhD Student at PGMC-UFJF <http://www.ufjf.br/pgmc/>
Lattes <http://lattes.cnpq.br/0601030410417146> | LinkedIn
<https://br.linkedin.com/in/tluisrs> | ResearchGate
<https://www.researchgate.net/profile/Thales_Luis_Sabino>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160216/fabeaa32/attachment.html>


More information about the vtkusers mailing list