Skip to content

cmake: map RelWithDebInfo and MinSizeRel configurations to Release#9656

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
bblanchon:RelWithDebInfo
Sep 19, 2017
Merged

cmake: map RelWithDebInfo and MinSizeRel configurations to Release#9656
opencv-pushbot merged 1 commit intoopencv:masterfrom
bblanchon:RelWithDebInfo

Conversation

@bblanchon
Copy link
Copy Markdown
Contributor

@bblanchon bblanchon commented Sep 18, 2017

resolves #5564

This Pull Request allows a user to compile her project with configurations RelWithDebInfo and MinSizeRel.
It was previously not possible as CMake was incorrectly linking with the Debug version of the library when using RelWithDebInfo or MinSizeRel.

See #9161 (comment) for initial motivation.
@alalek, I didn't added a condition on MSVC, as this feature is not specific to Visual Studio.

Note that, this is not the same as #6496 because this Pull Request doesn't add new configurations to OpenCV, it only allows all configuration in the user's project.

@bblanchon bblanchon changed the title cmake: map RelWithDebInfo and MinSizeRel configuration to Release cmake: map RelWithDebInfo and MinSizeRel configurations to Release Sep 18, 2017
@vpisarev vpisarev assigned vpisarev and unassigned vpisarev Sep 19, 2017
@vpisarev
Copy link
Copy Markdown
Contributor

@bblanchon, thanks, that's a nice feature! @alalek, could you review it, please? Is it compatible with all the CMake versions that we support?

@bblanchon
Copy link
Copy Markdown
Contributor Author

@vpisarev MAP_IMPORTED_CONFIG_ is present in CMake 2.6's documentation, but I cannot find it in 2.4.
However, since it's just a property that we set, it'll be ignored by earlier versions.

@alalek
Copy link
Copy Markdown
Member

alalek commented Sep 19, 2017

Thank you! Looks good to me 👍

@opencv-pushbot opencv-pushbot merged commit 2d0611b into opencv:master Sep 19, 2017
@alalek alalek mentioned this pull request Oct 9, 2017
@TobiasLangnerFUB
Copy link
Copy Markdown

It looks like a MSVC condition is necessary after all. On my machine with Ubuntu 16.04 and OpenCV 3.3.1 the changes of @bblanchon cause compile errors , when my build target is set to DebWithRelInfo.

make[2]: *** No rule to make target 'opencv_calib3d-NOTFOUND'

If I build my project as Debug or Release it compiles. If I remove the changes from the pull request, it will also compile for RelWithDebInfo.

I don't know if it is relevant, but It seems like there are no Imported Configurations available. I have added this to OpenCVConfig.cmake:

get_target_property(foo ${__cvcomponent} IMPORTED_CONFIGURATIONS)
MESSAGE("IMPORTED_CONFIGURATIONS ${foo}")

Then CMake will output: "IMPORTED_CONFIGURATIONS NONE"

But shouldn't the MAP_IMPORTED_CONFIG_ property be ignored in this case?

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 11, 2017

@TobiasLangnerFUB The latest discussion is here: #10105

@TobiasLangnerFUB
Copy link
Copy Markdown

I have seen that issue, but it doesn't fit my scenario. I haven't build OpenCV on my own, but use the opencv3 package for ROS Kinetic. The website http://wiki.ros.org/opencv3 lists the changes they have made to the CMake configuration. It doesn't look like it was built as RelWithDebInfo.

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

Labels

port/backport done Label for maintainers. Authors of PR can ignore this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildPyramid crashes on VS 2013 when running in RelWithDebInfo mode.

5 participants