Skip to content

CMakeList.txt Python find_package() #659

@JosuaCarl

Description

@JosuaCarl

For cMake version 3.12 or later, variable PythonInterp and PythonLibs has been changed into Python.

find_package(Python ${PY_VERSION} REQUIRED)

should be used, instead of:

find_package(PythonInterp ${PY_VERSION} REQUIRED) find_package(PythonLibs ${PY_VERSION} REQUIRED)

which is still present in the CMakeList.txt file. Otherwise, the presented error is:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PYTHON_LIBRARY (ADVANCED)
    linked by target "BALL" in directory /mnt/Data/Programs/BALL-1.4.2

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Changing the line 295 & 297 to the suggested statement fixed the problem (although the second if-statement should not be entered at all, then).

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