ros-visualization / python_qt_binding

http://wiki.ros.org/python_qt_binding
BSD 3-Clause "New" or "Revised" License
34 stars 54 forks source link

[Windows][kinetic] Handling build configuration keywords before passed to SIP #60

Closed seanyen closed 5 years ago

seanyen commented 5 years ago

In Windows build, the generated CMake Config for package could contain the configuration keywords and the sip_configure.py doesn't expect that. So use catkin_filter_libraries_for_build_configuration to normalize the content before it is passed to SIP.

FYI, here is an example what we saw from ${${PROJECT_NAME}_LIBRARIES}

"qt_gui_cpp;optimized;C:/opt/rosdeps/x64/lib/boost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/opt/rosdeps/x64/lib/boost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/opt/rosdeps/x64/lib/boost_system-vc141-mt-x64-1_66.lib;debug;C:/opt/rosdeps/x64/lib/boost_system-vc141-mt-gd-x64-1_66.lib;C:/opt/rosdeps/x64/lib/tinyxml.lib"

And without the fix, when it runs into the CMake config with configuration keywords, the linker could fail on the following errors:

        link /NOLOGO /DYNAMICBASE /NXCOMPAT /LIBPATH:C:/rviz_ws/devel_isolated/qt_gui_cpp/lib /DLL /MANIFEST /MANIFESTFILE:"C:/rviz_ws/devel_isolated/qt_gui_cpp/lib/site-packages/qt_gui_cpp\libqt_gui_cpp_sip".pyd.manifest /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /OUT:"C:/rviz_ws/devel_isolated/qt_gui_cpp/lib/site-packages/qt_gui_cpp\libqt_gui_cpp_sip".pyd @C:\Users\seanyen\AppData\Local\Temp\nmA71.tmp
LINK : fatal error LNK1181: cannot open input file 'optimized.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX64\x64\link.EXE"' : return code '0x49d'

This change is verified in https://aka.ms/ros project.

dirk-thomas commented 5 years ago

Can you please compare the proposed changes with the code on the crystal-devel branch which is used for ROS 2 and should already support Windows?

seanyen commented 5 years ago

@dirk-thomas Thank for the feedback. Do you want me to test ROS on Windows melodic distro with the crystal-devel python_qt_binding? Or are you suggesting me to cherry-pick the necessary changes from ROS2? Currently https://aka.ms/ros is still building ROS1 (melodic distro) and focused on upstreaming the minimum changes for melodic.

dirk-thomas commented 5 years ago

Do you want me to test ROS on Windows melodic distro with the crystal-devel python_qt_binding?

No.

are you suggesting me to cherry-pick the necessary changes from ROS2?

Yes, at least you should check the changes applied for ROS 2 and either cherry-pick them if they apply 1-to-1 or use a custom patch like the one in this PR but with a description why it needs to be different.

seanyen commented 5 years ago

Thanks for the clarification! I will be reworking on that.

seanyen commented 5 years ago

@dirk-thomas I separated out cherry-picking the crystal-devel Windows port into #61. This PR will be focused on the build configuration keyword filtering fix.

dirk-thomas commented 5 years ago

Thanks for the patch and for updating it so quickly.

seanyen commented 5 years ago

Thanks for the merge!