Skip to content

build: set cmake policy for if(IN_LIST) support#26320

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
mshabunin:fix-cmake-in-list
Oct 17, 2024
Merged

build: set cmake policy for if(IN_LIST) support#26320
asmorkalov merged 1 commit intoopencv:4.xfrom
mshabunin:fix-cmake-in-list

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Oct 16, 2024

I've got a warning and an error with cmake 3.29 from MSVC:

Warning:

1> [CMake] CMake Warning (dev) at modules/python/python_loader.cmake:104 (if):
1> [CMake]   Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
1> [CMake]   --help-policy CMP0057" for policy details.  Use the cmake_policy command to
1> [CMake]   set the policy and suppress this warning.
1> [CMake] 
1> [CMake]   IN_LIST will be interpreted as an operator when the policy is set to NEW.
1> [CMake]   Since the policy is not set the OLD behavior will be used.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   modules/python/python_loader.cmake:118 (ocv_add_python_files_from_path)
1> [CMake]   modules/python/bindings/CMakeLists.txt:12 (include)
1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.

Following error:

1> [CMake] CMake Error at modules/python/python_loader.cmake:104 (if):
1> [CMake]   if given arguments:
1> [CMake] 
1> [CMake]     "NOT" "misc" "IN_LIST" "extra_modules"
1> [CMake] 
1> [CMake]   Unknown arguments specified

@asmorkalov asmorkalov merged commit d20c456 into opencv:4.x Oct 17, 2024
@mshabunin mshabunin deleted the fix-cmake-in-list branch October 17, 2024 08:52
@asmorkalov asmorkalov mentioned this pull request Oct 23, 2024
@dkurt dkurt added this to the 4.11.0 milestone Dec 26, 2024
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