Skip to content

Fix header sorting for modules without headers#19913

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
mshabunin:fix-san-build
Apr 15, 2021
Merged

Fix header sorting for modules without headers#19913
opencv-pushbot merged 1 commit intoopencv:3.4from
mshabunin:fix-san-build

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

related #19819
There can exist modules without headers causing configuration issue:

CMake Error at /opencv/cmake/OpenCVModule.cmake:883 (list):
  list sub-command SORT requires list to be present.

@opencv-pushbot opencv-pushbot merged commit 8c2cf89 into opencv:3.4 Apr 15, 2021
Comment on lines 879 to +882
set(__module_headers ${OPENCV_MODULE_${the_module}_HEADERS})
list(SORT __module_headers) # fix headers order, useful for bindings
if(__module_headers)
list(SORT __module_headers) # fix headers order, useful for bindings
endif()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, Looks like this problem is related to old CMake only (reproduced with CMake 2.8.12, CMake 3.18 is OK):

Alternative fix of this problem is adding quotes "" in the set() call:

set(__module_headers "${OPENCV_MODULE_${the_module}_HEADERS}")
list(SORT __module_headers)

@alalek alalek mentioned this pull request Apr 15, 2021
@alalek alalek mentioned this pull request Jun 4, 2021
@mshabunin mshabunin deleted the fix-san-build branch July 10, 2023 08:14
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.

3 participants