Windows debug build and python library

Hi all,

What is the status with debug build of Slicer on Windows ? I am trying to build Slicer master (without SimpleITK) on MSVC2017 x64 in Debug with no luck.
I saw some recent changes from @lassoan. e.g. 49f3f0b8.

As I am about to stop trying, I would like to share with you my findings:

I have these kinds of warnings...
CMake Warning (dev) at C:/Work/R-b/vtkAddon/CMake/vtkMacroKitPythonWrap.cmake:242 (target_link_libraries):
Link library type specifier "optimized" is followed by specifier
"optimized" instead of a library name.  The first specifier will be ignored.
Call Stack (most recent call first):
C:/Work/R-b/vtkAddon/CMakeLists.txt:206 (vtkMacroKitPythonWrap)
This warning is for project developers.  Use -Wno-dev to suppress it.
and these kinds of errors...
1>CMake Error at C:/Work/R-b/slicersources-src/CMake/SlicerMacroBuildApplication.cmake:462 (get_filename_component):
get_filename_component unknown component
Call Stack (most recent call first):
C:/Work/RFC/RFCo/Src/rfviewer/Applications/RFViewerApp/CMakeLists.txt:87 (slicerMacroBuildApplication)

This is because the variable PYTHON_LIBRARY is equal to:

According to the following 3 interesting links…

… it seems (at least according to the last commit message) that it is ok to have PYTHON_LIBRARY=optimized;...;debug;...

Do you confirm ? Therefore should the fix done on FindPythonLibs be applied everywhere ? If so, what about the warnings ? And what about the erroneous debug python path found on system ?

For information, when configuring Slicer/CMakeLists.txt (inner build, not superbuild), it seems that PYTHON_LIBRARY is fine (i.e. C:/Work/R-b/python-install/libs/python36.lib) until find_package(CTK REQUIRED) is called. It is then equal to optimized;...;debug;...

Thanks for the detailed report :pray:

Could you try with this patch applied to CTK: ?

The PR referenced above will be integrated while finalizing the update to VTK9 (tracked in

I expect to work on this in the next t weeks.

1 Like