Bump minimum required version of CMake to 3.16 and update CMake SWIG policies #732
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the error due to a bump of the minimum requirement of CMake that is being proposed in #731.
The problem is that recent CMake releases set by default the NEW version of policy
CMP0078
that affects the naming of the target and the resulting library. This change breaks the old CMake structure.In addition to this fix, I also applied the NEW version of policy
CMP0086
that allows removing the genericCMAKE_SWIG_FLAGS
replacing it withset_property
calls.P.S. I never used SWIG bindings in a multi-thread application and I'm not sure what's the best way to handle the SWIG flags. It seems that the
-threads
option that was already enabled is enough to disable the GIL, however as discussed in swig/swig#927 maybe it is not enough and other options should be added in the.i
file. Let's keep things as they were before but also keep it in mind in case of multi-threading problems.