From fc54251f61c1bbee7314576a248dab317f9dd5b0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 23 Aug 2019 17:50:43 -0600 Subject: [PATCH] CMake: Fix PandaModules.py not copying --- cmake/scripts/CopyPython.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/scripts/CopyPython.cmake b/cmake/scripts/CopyPython.cmake index b9fad3ef92..1a3c98839a 100644 --- a/cmake/scripts/CopyPython.cmake +++ b/cmake/scripts/CopyPython.cmake @@ -36,10 +36,11 @@ if(DEFINED SOURCE_DIR) file(TIMESTAMP "${OUTPUT_DIR}/${py_file}" dst_stamp) # The file is only copied if: - # - there's an __init__.py in its dir (i.e. file belongs to a package), and + # - there's an __init__.py in its dir (or file is in the root) (i.e. file belongs to a package), and # - the modification timestamp differs (i.e. file changed or never copied) - if(EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py" - AND NOT src_stamp STREQUAL dst_stamp) + if((py_file_parent STREQUAL "." OR NOT py_file_parent + OR EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py") + AND NOT src_stamp STREQUAL dst_stamp) file(COPY "${SOURCE_DIR}/${py_file}" DESTINATION "${OUTPUT_DIR}/${py_file_parent}") set(changed YES)