Skip to content

Use consistent Python:: or Python3:: targets, in find_package, and in find_dependency #912

@wdconinc

Description

@wdconinc

Ah, this probably should have been in the Python:: namespace since that's what is added as a dependency in the config

if(NOT "@REQUIRE_PYTHON_VERSION@" STREQUAL "")
find_dependency(Python @REQUIRE_PYTHON_VERSION@ COMPONENTS Interpreter Development)
else()
find_dependency(Python COMPONENTS Interpreter Development)
endif()

and in the PODIO_GENERATE_DATAMODEL module:
COMMAND ${Python_EXECUTABLE} ${podio_PYTHON_DIR}/podio_class_generator.py ${CLANG_FORMAT_ARG} ${SCHEMA_EVOLUTION_ARG} ${UPSTREAM_EDM_ARG} ${YAML_FILE} ${ARG_OUTPUT_FOLDER} ${datamodel} ${ARG_IO_BACKEND_HANDLERS} ${LANGUAGE_ARG} ${VERSION_ARG} ${OLD_DESCRIPTION_ARG}

Then again, the package that is found is Python3...

if(NOT PODIO_RELAX_PYVER)
find_package(Python3 ${REQUIRE_PYTHON_VERSION} EXACT REQUIRED COMPONENTS Development Interpreter)
else()
find_package(Python3 ${REQUIRE_PYTHON_VERSION} REQUIRED COMPONENTS Development Interpreter)

Originally posted by @wdconinc in #908

The mixed use of Python:: and Python3:: targets is confusing and should be harmonized. In this case, I think(!) it's ok for downstream users since find_dependency and PODIO_GENERATE_DATAMODEL are consistent...

Leaving up to @tmadlener to decide which way to go here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions