diff --git a/CMakeLists.txt b/CMakeLists.txt index 93f8f1a694..cd32c0ef0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,12 @@ if(WIN32) endif() +# Release channel ############################################################# +# +set(openPMD_RELEASE_CHANNEL "source" + CACHE STRING "Describes the method openPMD-api was installed with.") + + # Options and Variants ######################################################## # function(openpmd_option name description default) @@ -353,6 +359,9 @@ set(IO_ADIOS1_SOURCE add_library(openPMD ${CORE_SOURCE} ${IO_SOURCE}) add_library(openPMD::openPMD ALIAS openPMD) +# release channel +target_compile_definitions(openPMD PUBLIC "-DOPENPMD_RELEASE_CHANNEL=${openPMD_RELEASE_CHANNEL}") + # properties target_compile_features(openPMD PUBLIC cxx_std_11 @@ -1021,9 +1030,10 @@ endif() # message("") message("openPMD build configuration:") -message(" library Version: ${openPMD_VERSION}") -message(" openPMD Standard: ${openPMD_STANDARD_VERSION}") -message(" C++ Compiler: ${CMAKE_CXX_COMPILER_ID} " +message(" library version: ${openPMD_VERSION}") +message(" openPMD standard: ${openPMD_STANDARD_VERSION}") +message(" release channel: ${openPMD_RELEASE_CHANNEL}") +message(" C++ compiler: ${CMAKE_CXX_COMPILER_ID} " "${CMAKE_CXX_COMPILER_VERSION} " "${CMAKE_CXX_COMPILER_WRAPPER}") message(" ${CMAKE_CXX_COMPILER}") diff --git a/include/openPMD/version.hpp b/include/openPMD/version.hpp index 529f0970e7..b05b52b505 100644 --- a/include/openPMD/version.hpp +++ b/include/openPMD/version.hpp @@ -35,3 +35,8 @@ #define OPENPMD_STANDARD_MIN_MAJOR 1 #define OPENPMD_STANDARD_MIN_MINOR 0 #define OPENPMD_STANDARD_MIN_PATCH 0 + +// release channel +#if !defined(OPENPMD_RELEASE_CHANNEL) +# define OPENPMD_RELEASE_CHANNEL source +#endif diff --git a/openPMDConfig.cmake.in b/openPMDConfig.cmake.in index dcdd329d71..8f1a768bc3 100644 --- a/openPMDConfig.cmake.in +++ b/openPMDConfig.cmake.in @@ -10,6 +10,8 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") +set(openPMD_RELEASE_CHANNEL "@openPMD_RELEASE_CHANNEL@") + add_library(openPMD::thirdparty::mpark_variant INTERFACE IMPORTED) set(openPMD_USE_INTERNAL_VARIANT @openPMD_USE_INTERNAL_VARIANT@) if(NOT openPMD_USE_INTERNAL_VARIANT) diff --git a/src/binding/python/openPMD.cpp b/src/binding/python/openPMD.cpp index 64820379ba..7b60ae3316 100644 --- a/src/binding/python/openPMD.cpp +++ b/src/binding/python/openPMD.cpp @@ -84,6 +84,12 @@ PYBIND11_MODULE(openpmd_api, m) { openPMDapi << "-" << OPENPMDAPI_VERSION_LABEL; m.attr("__version__") = openPMDapi.str(); + // release channel + std::stringstream openPMD_release_channel; + if( std::string( "OPENPMDAPI_RELEASE_CHANNEL" ).size() > 0 ) + openPMD_release_channel << "OPENPMDAPI_RELEASE_CHANNEL"; + m.attr("release_channel") = openPMD_release_channel.str(); + // feature variants m.attr("variants") = std::map{ {"mpi", bool(openPMD_HAVE_MPI)},