-
Notifications
You must be signed in to change notification settings - Fork 345
Try to fix CMakeLists.txt #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can became an issue since this efb124d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can try following patch in github CI?
master...MBkkt:s2geometry:patch-11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The easiest way to test it is to make a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok: #434
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: