Skip to content
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

Use FindPython from CMake 3.12. #180

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Use FindPython from CMake 3.12. #180

merged 2 commits into from
Sep 18, 2023

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jun 15, 2020

To facilitate the writing of a vcpkg port, this updates the PyHSPlasma CMake to use the FindPython module from CMake 3.12. The previously used module has since been deprecated. To manually specify artifacts from a specific python version, set the keys Python_INCLUDE_DIR and Python_LIBRARY. Note the casing has changed from PYTHON (deprecated) to Python.

I think these changes were previously included in #166, but the ability to manually specify the artifacts did not land until CMake 3.16.

@Hoikas Hoikas force-pushed the find_python branch 5 times, most recently from 188d3f5 to 56b360f Compare June 15, 2020 02:38
CMakeLists.txt Outdated Show resolved Hide resolved
@zrax
Copy link
Member

zrax commented Jun 1, 2021

This needs to be rebased after #199 is merged

@Hoikas
Copy link
Member Author

Hoikas commented Aug 10, 2023

Per the CMake 3.27.0 release notes:

The “FindPythonInterp” and “FindPythonLibs” modules, which have been deprecated since CMake 3.12, have been removed by policy “CMP0148”. Port projects to “FindPython3”, “FindPython2”, or “FindPython”.

I should probably rebase this 😞

@Hoikas Hoikas force-pushed the find_python branch 2 times, most recently from 71b2f3e to 9d48bc0 Compare September 16, 2023 23:59
@Hoikas Hoikas marked this pull request as draft September 16, 2023 23:59
@Hoikas Hoikas force-pushed the find_python branch 3 times, most recently from b48b258 to 9c9394c Compare September 17, 2023 00:38
@Hoikas Hoikas marked this pull request as ready for review September 17, 2023 00:58
@Hoikas
Copy link
Member Author

Hoikas commented Sep 17, 2023

This is ready to go for CMake 3.27 compatibility.

The `distutils` module will be tossed in Python 3.12, so compensate for
that.
install(TARGETS PyHSPlasma
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
LIBRARY DESTINATION bin
Copy link
Member Author

Choose a reason for hiding this comment

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

CMake's FindPython3 (source of Python3_add_library) thinks Python extension modules are libraries. 🙄

@zrax zrax merged commit ed9c2d4 into H-uru:master Sep 18, 2023
9 checks passed
@Hoikas Hoikas deleted the find_python branch June 23, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants