Skip to content

cmake: rework MAP_IMPORTED_CONFIG to prevent unintended build failures#10299

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
alalek:cmake_imported_configuration_remap
Dec 14, 2017
Merged

cmake: rework MAP_IMPORTED_CONFIG to prevent unintended build failures#10299
opencv-pushbot merged 1 commit intoopencv:masterfrom
alalek:cmake_imported_configuration_remap

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Dec 13, 2017

Introduce CMake variable OPENCV_MAP_IMPORTED_CONFIG which controls this behaviour
Added defaults for MSVS targets

resolves #10105

Introduce CMake variable OPENCV_MAP_IMPORTED_CONFIG which controls this behaviour
Added defaults for MSVS targets
@alalek
Copy link
Copy Markdown
Member Author

alalek commented Dec 13, 2017

@TobiasLangnerFUB @tfoote @pjreed @rokm @bblanchon
Could you please check this patch with your build configurations?

@bblanchon
Copy link
Copy Markdown
Contributor

@alalek I'm not able to test right now as I'm working on a different project.

However, it looks very complicated, so I think it would be more reasonable to simply revert my commit.
Users who want to use RelWithDebugInfo would just need to build OpenCV themselves; apparently, most of them are already doing that anyway.

@TobiasLangnerFUB
Copy link
Copy Markdown

@alalek The patch works for my configuration.

@pauldinh
Copy link
Copy Markdown

I'm also having success with this patch in my builds.

@tdenewiler
Copy link
Copy Markdown

My use case is building and using ROS packages that depend on OpenCV (my current environment is Ubuntu 16.04 with ROS Kinetic). I have OpenCV installed via ROS apt packages from their buildfarm (specifically ros-kinetic-opencv3). I normally build the entire ROS workspace with the -DCMAKE_BUILD_TYPE=RelWithDebInfo flag set. To test if this change works I naively applied the diff to my existing /opt/ros/kinetic/share/OpenCV-3.3.1/OpenCVConfig.cmake file. With the changes in this PR I was able to build my workspace and get the expected output from OpenCV calls.

This works for me.

@alalek
Copy link
Copy Markdown
Member Author

alalek commented Dec 13, 2017

Thanks all for testing that!

@bblanchon I tested this patch with MSVS CMake generator, Debug+Release OpenCV installation and RelWithDebugInfo config for simple application (without Qt) - it works.

@vpisarev vpisarev self-assigned this Dec 14, 2017
@vpisarev
Copy link
Copy Markdown
Contributor

👍

@alex-petrenko
Copy link
Copy Markdown

alex-petrenko commented May 30, 2018

@vpisarev Hello from itSeez3D!
This does not seem to work anymore. opencv_dnn module depends on some other 3rd party libs (such as protobuf) and my external project in RelWithDebInfo configuration tries to link with Debug build of libprotobuf. Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCVConfig.cmake: issue with imported target configuration remapping

8 participants