From 48310cf8d4e7cd74ce91f992d4c1abe44920a4be Mon Sep 17 00:00:00 2001 From: Gerry Chen Date: Wed, 20 Apr 2022 16:33:50 -0400 Subject: [PATCH] fix bug that python utils files don't regenerate upon edit --- python/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index f5869b1450..d3cbff32d5 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -98,11 +98,15 @@ set(GTSAM_MODULE_PATH ${GTSAM_PYTHON_BUILD_DIRECTORY}/gtsam) copy_directory("${CMAKE_CURRENT_SOURCE_DIR}/gtsam" "${GTSAM_MODULE_PATH}") -# Hack to get python test files copied every time they are modified +# Hack to get python test and util files copied every time they are modified file(GLOB GTSAM_PYTHON_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gtsam/tests/*.py") foreach(test_file ${GTSAM_PYTHON_TEST_FILES}) configure_file(${test_file} "${GTSAM_MODULE_PATH}/tests/${test_file}" COPYONLY) endforeach() +file(GLOB GTSAM_PYTHON_UTIL_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gtsam/utils/*.py") +foreach(util_file ${GTSAM_PYTHON_UTIL_FILES}) + configure_file(${util_file} "${GTSAM_MODULE_PATH}/utils/${test_file}" COPYONLY) +endforeach() # Common directory for data/datasets stored with the package. # This will store the data in the Python site package directly. @@ -160,7 +164,7 @@ if(GTSAM_UNSTABLE_BUILD_PYTHON) # Hack to get python test files copied every time they are modified file(GLOB GTSAM_UNSTABLE_PYTHON_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gtsam_unstable/tests/*.py") - foreach(test_file ${GTSAM_PYTHON_TEST_FILES}) + foreach(test_file ${GTSAM_UNSTABLE_PYTHON_TEST_FILES}) configure_file(${test_file} "${GTSAM_UNSTABLE_MODULE_PATH}/tests/${test_file}" COPYONLY) endforeach()