diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index b4b9812115..8fdb80e2dd 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -272,3 +272,14 @@ function(add_python_module module) endif() endif() endfunction(add_python_module) + + +if(HAVE_PYTHON) + # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' + # as a package. + file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "") + + # The Interrogate path needs to be installed to the architecture-dependent + # Python directory. + install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_LIB_INSTALL_DIR}") +endif()