Commit 91d5f430 authored by Lynn Garren's avatar Lynn Garren
Browse files

get ClhepVersion.h

parent 59e477f4
......@@ -4,16 +4,24 @@
# Recommended use:
# clhep_copy_headers( <package_list> )
include(ParseVersion)
macro (clhep_copy_headers )
foreach( package ${ARGN} )
message(STATUS "checking for headers in ${package}")
string(TOUPPER ${package} UPACKAGE )
set( PACKAGE ${package} )
if( found_drand48 )
set( DRAND48_DEF "#define HAVE_DRAND48 1" )
else()
set( DRAND48_DEF "#undef HAVE_DRAND48" )
endif()
FILE( GLOB headers
${CLHEP_SOURCE_DIR}/${package}/${package}/*.h
${CLHEP_SOURCE_DIR}/${package}/${package}/*.hh
${CLHEP_SOURCE_DIR}/${package}/${package}/*.icc )
FILE( GLOB defs ${CLHEP_SOURCE_DIR}/${package}/${package}/cmake-defs.h.in )
foreach( defhdr ${defs} )
set( PACKAGE ${package} )
##message(STATUS "process ${defhdr} to create ${CLHEP_BINARY_DIR}/CLHEP/${package}/defs.h")
# this copies the file and creates directories if necessary
CONFIGURE_FILE( ${defhdr} ${CLHEP_BINARY_DIR}/CLHEP/${package}/defs.h @ONLY )
......@@ -29,5 +37,11 @@ macro (clhep_copy_headers )
CONFIGURE_FILE( ${hdr} ${output_file} COPYONLY)
endforeach( hdr )
endforeach(package)
# get ClhepVersion.h
parse_version( CLHEP ${VERSION} )
CONFIGURE_FILE( ${CLHEP_SOURCE_DIR}/cmake/Templates/ClhepVersion.h.in
${CLHEP_BINARY_DIR}/CLHEP/ClhepVersion.h @ONLY )
INSTALL (FILES ${CLHEP_BINARY_DIR}/CLHEP/ClhepVersion.h
DESTINATION include/CLHEP )
endmacro (clhep_copy_headers)
#ifndef CLHEP_VERSION_H
#define CLHEP_VERSION_H 1
//
// ClhepVersion.h
//
// Sample Usage:
// std::string version = CLHEP::Version::String()
// int mjr = CLHEP::Version::Major();
//
#include <string>
namespace CLHEP {
struct Version {
static std::string String() { return "@VERSION@"; }
static int Major() { return @CLHEP_Major@; }
static int SubMajor() { return @CLHEP_SubMajor@; }
static int Minor() { return @CLHEP_Minor@; }
static int SubMinor() { return @CLHEP_SubMinor@; }
};
} // namespace
#endif // CLHEP_VERSION_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment