FindPythonLibs errors on Windows when both debug and release python libraries are installed
Found with 3.7.2 binaries from the website.
It prints:
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPythonLibs.cmake:171 (get_filename_component):
get_filename_component unknown component
C:/Users/shawn.waldon/AppData/Local/Programs/Python/Python36/libs/python36.lib
Call Stack (most recent call first):
CMake/FindITKPythonLibs.cmake:34 (find_package)
Wrapping/Generators/Python/CMakeLists.txt:4 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPythonLibs.cmake:172 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMake/FindITKPythonLibs.cmake:34 (find_package)
Wrapping/Generators/Python/CMakeLists.txt:4 (find_package)
The issue is that it is calling get_filename_components on PYTHON_LIBRARY, which is constructed with select_library_configurations and contains the value:
optimized;C:/Users/shawn.waldon/AppData/Local/Programs/Python/Python36/libs/python36.lib;debug;C:/Users/shawn.waldon/AppData/Local/Programs/Python/Python36/libs/python36_d.lib
It may be okay for the first configure, because the PYTHON_LIBRARY value is not computed yet, but any subsequent configures will fail.