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 60e3dfc9..65fa674d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,25 +11,28 @@ 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 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 +) +set( + ADAPTER_HEADERS + 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 ) @@ -39,10 +42,9 @@ list(APPEND PCMS_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/pcms/version.h ${CMAKE_CURR 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 pcms/adapter/xgc/xgc_reverse_classification.h) endif() if(PCMS_ENABLE_OMEGA_H) list(APPEND PCMS_SOURCES @@ -53,11 +55,13 @@ if(PCMS_ENABLE_OMEGA_H) 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 + 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 ) @@ -96,6 +100,11 @@ 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 @@ -105,6 +114,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( @@ -158,7 +168,10 @@ install( INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms + FILE_SET adapters DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pcms ) + + # install external headers install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcms/external/ 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::