From 6ad9eeb5a1dd98384a951d9f6883d0d0acf1fe8c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 30 Apr 2020 21:37:35 +0200 Subject: [PATCH] CMake: generate panda3d.dist-info directory This makes pip recognise that Panda3D has been installed and setuptools recognise the build_apps and bdist_apps commands. --- cmake/templates/METADATA.in | 7 +++++++ panda/CMakeLists.txt | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cmake/templates/METADATA.in diff --git a/cmake/templates/METADATA.in b/cmake/templates/METADATA.in new file mode 100644 index 0000000000..8d0cd6cc84 --- /dev/null +++ b/cmake/templates/METADATA.in @@ -0,0 +1,7 @@ +Metadata-Version: 2.0 +Name: Panda3D +Version: ${PROJECT_VERSION} +License: BSD +Home-page: https://www.panda3d.org/ +Author: Panda3D Team +Author-email: etc-panda3d@lists.andrew.cmu.edu diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index cd00f49525..83a796c82d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -145,6 +145,16 @@ from .interrogatedb import * file(WRITE "${PROJECT_BINARY_DIR}/panda3d/dtoolconfig.py" ${dtoolconfig_file}) endif() + # Also generate a panda3d.dist-info directory. + set(entry_points_file "[distutils.commands] +build_apps = direct.dist.commands:build_apps +bdist_apps = direct.dist.commands:bdist_apps +") + + configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/METADATA.in" + "${PROJECT_BINARY_DIR}/panda3d.dist-info/METADATA") + file(WRITE "${PROJECT_BINARY_DIR}/panda3d.dist-info/entry_points.txt" ${entry_points_file}) + if(HAVE_BULLET) add_python_module(panda3d.bullet p3bullet IMPORT panda3d.core COMPONENT BulletPython)