From df36a36566cf56f614a8bdd569c2271decf2878b Mon Sep 17 00:00:00 2001 From: Gangwar Date: Thu, 19 Feb 2026 17:25:29 -0500 Subject: [PATCH 1/5] add_adapter_headers --- examples/external-usage-example/main.cpp | 1 + src/CMakeLists.txt | 26 +++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/examples/external-usage-example/main.cpp b/examples/external-usage-example/main.cpp index 51c8127f..a92aa25c 100644 --- a/examples/external-usage-example/main.cpp +++ b/examples/external-usage-example/main.cpp @@ -1,5 +1,6 @@ #include #include +#include int main() { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 454b46ca..340a5c91 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,5 @@ + + # TODO split out the field transfer library set( PCMS_HEADERS @@ -15,46 +17,42 @@ set( pcms/coupler.h pcms/coordinate_system.h pcms/field_layout.h - pcms/adapter/point_cloud/point_cloud_layout.h - pcms/adapter/point_cloud/point_cloud.h - pcms/adapter/omega_h/omega_h_field_layout.h - pcms/adapter/omega_h/omega_h_field2.h ) set( PCMS_SOURCES pcms.cpp pcms/create_field.cpp - pcms/adapter/xgc/xgc_field_adapter.h pcms/adapter/point_cloud/point_cloud_layout.cpp pcms/adapter/point_cloud/point_cloud.cpp pcms/adapter/omega_h/omega_h_field_layout.cpp pcms/adapter/omega_h/omega_h_field2.cpp - pcms/adapter/xgc/xgc_field_adapter.h ) - +set( + ADAPTER_HEADERS + ${CMAKE_SOURCE_DIR}/src/pcms/adapter/point_cloud +) configure_file(pcms/version.h.in pcms/version.h) configure_file(pcms/configuration.h.in pcms/configuration.h) list(APPEND PCMS_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/pcms/version.h ${CMAKE_CURRENT_BINARY_DIR}/pcms/configuration.h) add_subdirectory(pcms/utility) - if(PCMS_ENABLE_XGC) list(APPEND PCMS_SOURCES pcms/adapter/xgc/xgc_reverse_classification.cpp) - list(APPEND PCMS_HEADERS pcms/adapter/xgc/xgc_reverse_classification.h) + list(APPEND ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/pcms/adapter/xgc) endif() if(PCMS_ENABLE_OMEGA_H) list(APPEND PCMS_SOURCES pcms/point_search.cpp) list( APPEND PCMS_HEADERS - pcms/adapter/omega_h/omega_h_field.h pcms/transfer_field.h pcms/transfer_field2.h pcms/uniform_grid.h pcms/point_search.h ) + list(APPEND ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/pcms/adapter/omega_h) endif() find_package(Kokkos REQUIRED) @@ -147,6 +145,14 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms ) + +# Mirror the src tree for adapter headers +foreach(hdr IN LISTS ADAPTER_HEADERS) + install(DIRECTORY ${hdr} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/adapter + FILES_MATCHING PATTERN "*.h") +endforeach () + # install external headers install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcms/external/ From 6519d089b7f1eeb70b278b421c529d50fad0cbad Mon Sep 17 00:00:00 2001 From: Gangwar Date: Fri, 27 Feb 2026 15:46:32 -0500 Subject: [PATCH 2/5] use_FILE_SET --- src/CMakeLists.txt | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 340a5c91..c720976e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ - - # TODO split out the field transfer library set( PCMS_HEADERS @@ -30,8 +28,13 @@ set( ) set( ADAPTER_HEADERS - ${CMAKE_SOURCE_DIR}/src/pcms/adapter/point_cloud + pcms/adapter/point_cloud/point_cloud_layout.h + pcms/adapter/point_cloud/point_cloud.h + pcms/adapter/omega_h/omega_h_field_layout.h + pcms/adapter/omega_h/omega_h_field2.h + pcms/adapter/xgc/xgc_field_adapter.h ) + configure_file(pcms/version.h.in pcms/version.h) configure_file(pcms/configuration.h.in pcms/configuration.h) list(APPEND PCMS_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/pcms/version.h ${CMAKE_CURRENT_BINARY_DIR}/pcms/configuration.h) @@ -40,7 +43,7 @@ add_subdirectory(pcms/utility) if(PCMS_ENABLE_XGC) list(APPEND PCMS_SOURCES pcms/adapter/xgc/xgc_reverse_classification.cpp) - list(APPEND ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/pcms/adapter/xgc) + list(APPEND ADAPTER_HEADERS pcms/adapter/xgc/xgc_reverse_classification.h) endif() if(PCMS_ENABLE_OMEGA_H) list(APPEND PCMS_SOURCES pcms/point_search.cpp) @@ -52,7 +55,7 @@ if(PCMS_ENABLE_OMEGA_H) pcms/uniform_grid.h pcms/point_search.h ) - list(APPEND ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/pcms/adapter/omega_h) + list(APPEND ADAPTER_HEADERS pcms/adapter/omega_h/omega_h_field.h) endif() find_package(Kokkos REQUIRED) @@ -88,6 +91,12 @@ target_include_directories( "$" "$" ) +target_sources(pcms_core PUBLIC + FILE_SET adapters + TYPE HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/pcms + FILES ${ADAPTER_HEADERS} +) install( TARGETS pcms_core EXPORT pcms_core-targets @@ -97,6 +106,7 @@ install( INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms + FILE_SET adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms ) configure_package_config_file( @@ -144,14 +154,9 @@ install( INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms + FILE_SET adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms ) -# Mirror the src tree for adapter headers -foreach(hdr IN LISTS ADAPTER_HEADERS) - install(DIRECTORY ${hdr} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/adapter - FILES_MATCHING PATTERN "*.h") -endforeach () # install external headers install( From 69c442d7bae2107b5fdde61ea1d067d950ad44cc Mon Sep 17 00:00:00 2001 From: Gangwar Date: Wed, 4 Mar 2026 17:32:06 -0500 Subject: [PATCH 3/5] install_layout_comm --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c720976e..a794daa1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ set( pcms/field_communicator.h pcms/field_communicator2.h pcms/field_evaluation_methods.h + pcms/field_layout_communicator.h pcms/partition.h pcms/coupler.h pcms/coordinate_system.h From ac2b5788f3bbd12d579f1cd54e41ed805c8141ee Mon Sep 17 00:00:00 2001 From: Gangwar Date: Wed, 4 Mar 2026 19:13:32 -0500 Subject: [PATCH 4/5] added_uniform_grid_to_FILE_SET --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3715c6aa..e7f2e5ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,10 +59,12 @@ if(PCMS_ENABLE_OMEGA_H) pcms/transfer_field2.h pcms/uniform_grid.h pcms/point_search.h + ) + list(APPEND ADAPTER_HEADERS + pcms/adapter/omega_h/omega_h_field.h pcms/adapter/uniform_grid/uniform_grid_field_layout.h pcms/adapter/uniform_grid/uniform_grid_field.h ) - list(APPEND ADAPTER_HEADERS pcms/adapter/omega_h/omega_h_field.h) endif() find_package(Kokkos REQUIRED) From 141639ce64d7953fe50a1410eb8ef73708feca01 Mon Sep 17 00:00:00 2001 From: Gangwar Date: Fri, 6 Mar 2026 14:43:34 -0500 Subject: [PATCH 5/5] capi_FILE_SET --- src/CMakeLists.txt | 3 +-- src/pcms/capi/CMakeLists.txt | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7f2e5ca..65fa674d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -104,8 +104,7 @@ target_sources(pcms_core PUBLIC FILE_SET adapters TYPE HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/pcms - FILES ${ADAPTER_HEADERS} -) + FILES ${ADAPTER_HEADERS}) install( TARGETS pcms_core EXPORT pcms_core-targets diff --git a/src/pcms/capi/CMakeLists.txt b/src/pcms/capi/CMakeLists.txt index bfe94fc2..ab768b71 100644 --- a/src/pcms/capi/CMakeLists.txt +++ b/src/pcms/capi/CMakeLists.txt @@ -18,13 +18,17 @@ set(CAPI_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/client.h set_target_properties( pcms_capi_core PROPERTIES PUBLIC_HEADER "${CAPI_CORE_HEADERS}" OUTPUT_NAME pcmscapicore EXPORT_NAME capi::core) - +target_sources(pcms_capi_core PUBLIC + FILE_SET core + TYPE HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES ${CAPI_CORE_HEADERS}) add_library(pcms_capi_interpolator mesh.cpp interpolator.cpp kokkos.cpp) add_library(pcms::capi::interpolator ALIAS pcms_capi_interpolator) target_link_libraries(pcms_capi_interpolator PUBLIC MPI::MPI_C PRIVATE pcms::interpolator) target_include_directories(pcms_capi_interpolator PUBLIC - "$" # this makes the module path cpms/capi + "$" # this makes the module path pcms/capi "$") set(CAPI_INTERPOLATOR_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/interpolator.h ${CMAKE_CURRENT_SOURCE_DIR}/mesh.h) @@ -32,7 +36,11 @@ set_target_properties(pcms_capi_interpolator PROPERTIES PUBLIC_HEADERS "${CAPI_INTERPOLATOR_HEADERS}" OUTPUT_NAME pcmscapiinterpolator EXPORT_NAME capi::interpolator) - +target_sources(pcms_capi_interpolator PUBLIC + FILE_SET interpolator + TYPE HEADERS + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} + FILES ${CAPI_INTERPOLATOR_HEADERS}) # high level interface target add_library(pcms_capi INTERFACE) add_library(pcms::capi ALIAS pcms_capi) @@ -63,7 +71,7 @@ install( RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/capi/) + FILE_SET core DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms) install( EXPORT pcms_capi_core-targets NAMESPACE pcms:: @@ -77,7 +85,7 @@ install( RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms/capi/) + FILE_SET interpolator DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms) install( EXPORT pcms_capi_interpolator-targets NAMESPACE pcms::