Conversation
I'm not CMake expert, but with current code and WITH_PYTHON not touched I have following error:
```
CMake Error at third_party/s2geometry/CMakeLists.txt:658 (if):
if given arguments:
"AND" "TRUE"
Unknown arguments specified
```
| endif() | ||
|
|
||
| if (${SWIG_FOUND} AND ${Python3_FOUND}) | ||
| if (SWIG_FOUND AND Python3_FOUND) |
There was a problem hiding this comment.
Odd since this hasn't changed in 5 years.
What's the exact command that fails for you and what cmake version?
There was a problem hiding this comment.
cmake version 3.28.3
I use s2 as submodule with quite complicated setup, so I probably cannot provide exact command.
It uses add_subdirectory(s2geometry)
Python3_FOUNDdefined because other components usefind_package(Python3...)beforeadd_subdirectory(s2geometry)WITH_PYTHONisn't defined soSWIG_FOUNDalso not defined
In general this condition looks quite unusual because
find_package(Some)
if (Some_FOUND)
quite popular cmake construction but not
find_package(Some)
if (${Some_FOUND})
because it will be syntax error if Some_FOUND not defined?
But as I said, I'm not cmake expert so feel free to close if you're thinking it's irrelevant/not necessary/etc
It wasn't issue for me before, because these lines was comment out in my fork
There was a problem hiding this comment.
It can became an issue since this efb124d
There was a problem hiding this comment.
Maybe you can try following patch in github CI?
master...MBkkt:s2geometry:patch-11
There was a problem hiding this comment.
The easiest way to test it is to make a PR.
There was a problem hiding this comment.
What's the difference between X and ${X} is in cmake?
Maybe the most obvious fix is to add WITH_PYTHON && or wrap in if (WITH_PYTHON).
There was a problem hiding this comment.
What's the difference between X and ${X} is in swig?
In cmake you mean?
If I understand right ${X} converts argument to string
There was a problem hiding this comment.
I think I find main difference in if (condition) https://cmake.org/cmake/help/latest/command/if.html#variable-expansion but still don't understand why if (${undefined_var} AND ${defined_as_true_var}) doesn't work
I'm not CMake expert, but with current code and WITH_PYTHON not touched I have following error: