Skip to content

COMP: Prefer to use find_package(Python3 ) #92

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

Open
wants to merge 1 commit into
base: patched-v3.6.1-2025-06-13-a2687828e
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ endif()
#-----------------------------------------------------------------------------
# Python libraries

find_package(PythonLibs REQUIRED)
include_directories("${PYTHON_INCLUDE_DIR}")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider specifying a minimum Python version (for example, find_package(Python3 3.8 COMPONENTS Interpreter Development REQUIRED)) to enforce consistent ABI and feature availability across developer environments.

Suggested change
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
find_package(Python3 3.8 COMPONENTS Interpreter Development REQUIRED)

Copilot uses AI. Check for mistakes.

include_directories("${Python3_INCLUDE_DIRS}")
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

[nitpick] Instead of using the global include_directories command, link against the Python3 imported target (e.g., Python3::Python) via target_link_libraries. This automatically brings in the correct include paths and libraries, aligning with modern CMake practices.

Copilot uses AI. Check for mistakes.

add_definitions(
-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK
-DPYTHONQT_SUPPORT_NAME_PROPERTY
Expand Down
Loading