diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fbada3757ab7ac6375e1d974a64216b3e499a41..c0d1a206408adb5f2cdbbb74760f84ecce92050e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,13 +92,6 @@ add_subdirectory(thirdparty) #------------------------------------------------------------------------------# add_subdirectory(source) -#------------------------------------------------------------------------------# -# Installation -#------------------------------------------------------------------------------# -install(DIRECTORY include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h" -) #------------------------------------------------------------------------------# # Examples #------------------------------------------------------------------------------# diff --git a/include/adios2.h b/include/adios2.h deleted file mode 100644 index f1e7d56c42115d723127ec88af5385fce2c90cfd..0000000000000000000000000000000000000000 --- a/include/adios2.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Distributed under the OSI-approved Apache License, Version 2.0. See - * accompanying file Copyright.txt for details. - * - * ADIOS_CPP.h - * - * Created on: Jan 9, 2017 - * Author: wfg - */ - -#ifndef ADIOS_CPP_H_ -#define ADIOS_CPP_H_ - -#include "ADIOS.h" -#include "ADIOSTypes.h" -#include "core/Method.h" - -#include "core/Engine.h" -#include "core/Transform.h" - -#endif /* ADIOS_CPP_H_ */ diff --git a/include/ADIOS.h b/source/ADIOS.h similarity index 100% rename from include/ADIOS.h rename to source/ADIOS.h diff --git a/include/ADIOS.inl b/source/ADIOS.inl similarity index 100% rename from include/ADIOS.inl rename to source/ADIOS.inl diff --git a/include/ADIOSMacros.h b/source/ADIOSMacros.h similarity index 100% rename from include/ADIOSMacros.h rename to source/ADIOSMacros.h diff --git a/include/ADIOSTypes.h b/source/ADIOSTypes.h similarity index 100% rename from include/ADIOSTypes.h rename to source/ADIOSTypes.h diff --git a/include/ADIOS_MPI.h b/source/ADIOS_MPI.h similarity index 100% rename from include/ADIOS_MPI.h rename to source/ADIOS_MPI.h diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8195f8e24bfca4904a04b363c371addedd0a00d8..b9481731c346c1fc43dc22d74aae811187a67860 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -5,7 +5,6 @@ add_library(adios2 ADIOS.cpp ADIOS.tcc - #ADIOS_C.cpp capsule/heap/STLVector.cpp capsule/shmem/ShmSystemV.cpp @@ -36,7 +35,9 @@ add_library(adios2 utilities/format/bp1/BP1Writer.tcc ) target_include_directories(adios2 - PUBLIC ${ADIOS_SOURCE_DIR}/include + PUBLIC + $<BUILD_INTERFACE:${ADIOS_BINARY_DIR}> + $<INSTALL_INTERFACE:include> PRIVATE ${ADIOS_SOURCE_DIR}/source ) @@ -51,7 +52,6 @@ if(ADIOS_USE_DataMan) target_compile_definitions(adios2 PRIVATE ADIOS_HAVE_DATAMAN) target_link_libraries(adios2 PRIVATE ${CMAKE_DL_LIBS}) endif() - if(ADIOS_USE_BZip2) find_package(BZip2 REQUIRED) @@ -60,7 +60,6 @@ if(ADIOS_USE_BZip2) target_link_libraries(adios2 PRIVATE BZip2::BZip2) endif() - if(ADIOS_USE_MPI) find_package(MPI COMPONENTS C REQUIRED) target_include_directories(adios2 PUBLIC ${MPI_C_INCLUDE_PATH}) @@ -88,9 +87,15 @@ endif() if(ADIOS_USE_HDF5) find_package(HDF5 REQUIRED) if(ADIOS_USE_MPI AND (NOT HDF5_IS_PARALLEL)) - message(FATAL_ERROR "A sequential version of HDF5 was detected but the parallel version of ADIOS is being built, which requires a parallel HDF5.") + message(FATAL_ERROR + "A sequential version of HDF5 was detected but the parallel version " + "of ADIOS is being built, which requires a parallel HDF5." + ) elseif((NOT ADIOS_USE_MPI) AND HDF5_IS_PARALLEL) - message(FATAL_ERROR "A parallel version of HDF5 was detected but the sequential version of ADIOS is being built, which requires a sequential HDF5.") + message(FATAL_ERROR + "A parallel version of HDF5 was detected but the sequential version " + "of ADIOS is being built, which requires a sequential HDF5." + ) endif() target_include_directories(adios2 PRIVATE ${HDF5_INCLUDE_DIRS}) @@ -101,3 +106,26 @@ if(ADIOS_USE_HDF5) target_compile_definitions(adios2 PRIVATE ADIOS_HAVE_HDF5) target_link_libraries(adios2 PRIVATE ${HDF5_C_LIBRARIES}) endif() + +# Main header when using the build directory +set(ADIOS_INCLUDE_DIR "${ADIOS_SOURCE_DIR}/source") +configure_file(adios2.h.in ${ADIOS_BINARY_DIR}/adios2.h) + +# Header installation +set(ADIOS_INCLUDE_DIR "adios2") +configure_file(adios2.h.in ${ADIOS_BINARY_DIR}/adios2.install.h) +install( + FILES ${ADIOS_BINARY_DIR}/adios2.install.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + RENAME adios2.h +) +install( + FILES + ADIOS.h ADIOSMacros.h ADIOS_MPI.h ADIOSTypes.h mpidummy.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/adios2 +) +install( + DIRECTORY core + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/adios2 + FILES_MATCHING PATTERN "*.h" PATTERN "*.inl" +) diff --git a/source/adios2.h.in b/source/adios2.h.in new file mode 100644 index 0000000000000000000000000000000000000000..6a0a8674b400c0be433c5e219d89998088174b60 --- /dev/null +++ b/source/adios2.h.in @@ -0,0 +1,15 @@ +/* + * Distributed under the OSI-approved Apache License, Version 2.0. See + * accompanying file Copyright.txt for details. + */ + +#ifndef ADIOS2_H_ +#define ADIOS2_H_ + +#include "@ADIOS_INCLUDE_DIR@/ADIOS.h" +#include "@ADIOS_INCLUDE_DIR@/ADIOSTypes.h" +#include "@ADIOS_INCLUDE_DIR@/core/Method.h" +#include "@ADIOS_INCLUDE_DIR@/core/Engine.h" +#include "@ADIOS_INCLUDE_DIR@/core/Transform.h" + +#endif /* ADIOS2_H_ */ diff --git a/include/core/Attribute.h b/source/core/Attribute.h similarity index 100% rename from include/core/Attribute.h rename to source/core/Attribute.h diff --git a/include/core/Capsule.h b/source/core/Capsule.h similarity index 100% rename from include/core/Capsule.h rename to source/core/Capsule.h diff --git a/include/core/Engine.h b/source/core/Engine.h similarity index 100% rename from include/core/Engine.h rename to source/core/Engine.h diff --git a/include/core/IOChrono.h b/source/core/IOChrono.h similarity index 100% rename from include/core/IOChrono.h rename to source/core/IOChrono.h diff --git a/include/core/Method.h b/source/core/Method.h similarity index 100% rename from include/core/Method.h rename to source/core/Method.h diff --git a/include/core/Selection.h b/source/core/Selection.h similarity index 100% rename from include/core/Selection.h rename to source/core/Selection.h diff --git a/include/core/SelectionBoundingBox.h b/source/core/SelectionBoundingBox.h similarity index 100% rename from include/core/SelectionBoundingBox.h rename to source/core/SelectionBoundingBox.h diff --git a/include/core/SelectionPoints.h b/source/core/SelectionPoints.h similarity index 100% rename from include/core/SelectionPoints.h rename to source/core/SelectionPoints.h diff --git a/include/core/Support.h b/source/core/Support.h similarity index 100% rename from include/core/Support.h rename to source/core/Support.h diff --git a/include/core/Timer.h b/source/core/Timer.h similarity index 100% rename from include/core/Timer.h rename to source/core/Timer.h diff --git a/include/core/Transform.h b/source/core/Transform.h similarity index 100% rename from include/core/Transform.h rename to source/core/Transform.h diff --git a/include/core/Transport.h b/source/core/Transport.h similarity index 100% rename from include/core/Transport.h rename to source/core/Transport.h diff --git a/include/core/Variable.h b/source/core/Variable.h similarity index 100% rename from include/core/Variable.h rename to source/core/Variable.h diff --git a/include/core/VariableBase.h b/source/core/VariableBase.h similarity index 100% rename from include/core/VariableBase.h rename to source/core/VariableBase.h diff --git a/include/core/VariableCompound.h b/source/core/VariableCompound.h similarity index 100% rename from include/core/VariableCompound.h rename to source/core/VariableCompound.h diff --git a/include/core/adiosFunctions.h b/source/core/adiosFunctions.h similarity index 100% rename from include/core/adiosFunctions.h rename to source/core/adiosFunctions.h diff --git a/include/core/adiosTemplates.h b/source/core/adiosTemplates.h similarity index 100% rename from include/core/adiosTemplates.h rename to source/core/adiosTemplates.h diff --git a/include/core/capsuleTemplates.h b/source/core/capsuleTemplates.h similarity index 100% rename from include/core/capsuleTemplates.h rename to source/core/capsuleTemplates.h diff --git a/source/engine/adios1/ADIOS1Reader.cpp b/source/engine/adios1/ADIOS1Reader.cpp index f7dff53eb52021fde4b94035cbfe0db934a7854d..376927bc0a22b6e994d6785e061130a913e5b082 100644 --- a/source/engine/adios1/ADIOS1Reader.cpp +++ b/source/engine/adios1/ADIOS1Reader.cpp @@ -9,7 +9,7 @@ */ #include "core/Support.h" -#include "core/adiosFunctions.h" // CSVToVector +#include "core/adiosFunctions.h" // CSVToVector #include "transport/file/FStream.h" // uses C++ fstream #include "transport/file/FileDescriptor.h" // uses POSIX #include "transport/file/FilePointer.h" // uses C FILE* diff --git a/source/engine/bp/BPFileReader.cpp b/source/engine/bp/BPFileReader.cpp index 20666551eb2a96becaa5aa56cedbc9957d32544e..265ab95bf72c22ae74f750c9b1e55866f0091d2e 100644 --- a/source/engine/bp/BPFileReader.cpp +++ b/source/engine/bp/BPFileReader.cpp @@ -11,7 +11,7 @@ #include "BPFileReader.h" #include "core/Support.h" -#include "core/adiosFunctions.h" // CSVToVector +#include "core/adiosFunctions.h" // CSVToVector #include "transport/file/FStream.h" // uses C++ fstream #include "transport/file/FileDescriptor.h" // uses POSIX #include "transport/file/FilePointer.h" // uses C FILE* diff --git a/source/engine/dataman/DataManReader.cpp b/source/engine/dataman/DataManReader.cpp index dc936720b858a8ef6cc0a9dddb9efa1d3a6a4e58..32cfdb9679013a93b3b3e5f6a02be8d13236c835 100644 --- a/source/engine/dataman/DataManReader.cpp +++ b/source/engine/dataman/DataManReader.cpp @@ -11,8 +11,8 @@ #include "DataManReader.h" #include "core/Support.h" -#include "external/json.hpp" #include "core/adiosFunctions.h" //CSVToVector +#include "external/json.hpp" // supported transports #include "transport/file/FStream.h" // uses C++ fstream diff --git a/include/mpidummy.h b/source/mpidummy.h similarity index 100% rename from include/mpidummy.h rename to source/mpidummy.h