Skip to content

[WIP] Remember Release Channel #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down
5 changes: 5 additions & 0 deletions include/openPMD/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions openPMDConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/binding/python/openPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, bool>{
{"mpi", bool(openPMD_HAVE_MPI)},
Expand Down