From 912e64757550990b00bc50fe9ac9b074db2564f3 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 25 Oct 2025 17:55:22 -0700 Subject: [PATCH] CMake: Install Python Wrappers w/o Test The Python wrapper files and classes should be always installed, not only when tests are performed. Also, ideally before the examples are copied in --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10e731e15..aa6aa33ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -493,6 +493,13 @@ if(ImpactX_PYTHON) ${ImpactX_CUSTOM_TARGET_PREFIX}pip_wheel ) + # copy Python wrapper library to build directory + add_custom_command(TARGET pyImpactX POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${ImpactX_SOURCE_DIR}/src/python/impactx + $ + ) + # copy examples into pip package, e.g., for dashboard GUI add_custom_command(TARGET pyImpactX POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory @@ -513,14 +520,6 @@ if(BUILD_TESTING) endif() # unit tests - if(ImpactX_PYTHON) - # copy Python wrapper library to build directory - add_custom_command(TARGET pyImpactX POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${ImpactX_SOURCE_DIR}/src/python/impactx - $ - ) - endif() add_subdirectory(tests) endif()