Commit 324ca977 authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'version' into 'master'

Extend Version Reporting

See merge request allpix-squared/allpix-squared!547
parents 80c5c100 057d75f0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ stages:

# Hidden key to define the default compile job:
.compile:
    variables:
        ALLPIX_BUILD_ENV: "CI/CD"
    stage: compilation
    needs: []
    script:
@@ -566,6 +568,8 @@ deploy-cvmfs:

deploy-docker-latest:
    stage: deployment
    variables:
        ALLPIX_BUILD_ENV: "Docker"
    tags:
        - docker-image-build
    dependencies: []
@@ -578,6 +582,8 @@ deploy-docker-latest:

deploy-docker-tag:
    stage: deployment
    variables:
        ALLPIX_BUILD_ENV: "Docker"
    tags:
        - docker-image-build
    dependencies: []
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,11 @@ PROJECT(
ADD_DEFINITIONS(-DALLPIX_PROJECT_NAME="${CMAKE_PROJECT_NAME}" -DALLPIX_PROJECT_VERSION="${ALLPIX_VERSION}"
                -DALLPIX_BUILD_TIME="${BUILD_TIME}")

# Read possible build environment
IF(DEFINED ENV{ALLPIX_BUILD_ENV})
    ADD_DEFINITIONS(-DALLPIX_BUILD_ENV=\"$ENV{ALLPIX_BUILD_ENV}\")
ENDIF()

# Include a generated configuration file
# FIXME: this should be combined with the ADD_DEFINITIONS
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.h" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
@@ -350,6 +355,7 @@ ADD_SUBDIRECTORY(src/modules)
# Build geant4 interface library if needed by modules
IF(${ALLPIX_BUILD_GEANT4_INTERFACE})
    ADD_SUBDIRECTORY(src/tools/geant4)
    ADD_DEFINITIONS(-DALLPIX_GEANT4_AVAILABLE)
ENDIF()

# Build the executable
+20 −3
Original line number Diff line number Diff line
@@ -16,13 +16,18 @@
#include <string>
#include <utility>

#include <boost/version.hpp>

#include "core/Allpix.hpp"
#include "core/config/ConfigManager.hpp"
#include "core/geometry/GeometryManager.hpp"
#include "core/utils/exceptions.h"

#include "core/utils/log.h"

#ifdef ALLPIX_GEANT4_AVAILABLE
#include <G4Version.hh>
#endif

using namespace allpix;

void clean();
@@ -104,10 +109,22 @@ int main(int argc, const char* argv[]) {
        if(arg == "-h") {
            print_help = true;
        } else if(strcmp(argv[i], "--version") == 0) {
            std::cout << "Allpix Squared version " << ALLPIX_PROJECT_VERSION << std::endl;
            std::cout << "Allpix Squared version " << ALLPIX_PROJECT_VERSION;
#ifdef ALLPIX_BUILD_ENV
            std::cout << " (" << ALLPIX_BUILD_ENV << ")";
#endif
            std::cout << std::endl;
            std::cout << "               built on " << ALLPIX_BUILD_TIME << std::endl;
            std::cout << "               using Boost.Random " << BOOST_VERSION / 100000 << "." // major version
                      << BOOST_VERSION / 100 % 1000 << "."                                     // minor version
                      << BOOST_VERSION % 100                                                   // patch level
                      << std::endl;
            std::cout << "                     ROOT " << ROOT_RELEASE << std::endl;
#ifdef ALLPIX_GEANT4_AVAILABLE
            std::cout << "                     Geant4 " << G4VERSION_NUMBER << std::endl;
#endif
            std::cout << std::endl;
            std::cout << "Copyright (c) 2017-2020 CERN and the Allpix Squared authors." << std::endl << std::endl;
            std::cout << "Copyright (c) 2017-2021 CERN and the Allpix Squared authors." << std::endl << std::endl;
            std::cout << "This software is distributed under the terms of the MIT License." << std::endl;
            std::cout << "In applying this license, CERN does not waive the privileges and immunities" << std::endl;
            std::cout << "granted to it by virtue of its status as an Intergovernmental Organization" << std::endl;