Add Version.h header file

This allows source files to use the VTK-m version.

Note that Configure.h does not include the version. This is intentional.
First, I don't want the entirety of VTK-m to recompile every time the
version is updated (which is every time a commit happens in git).
Second, it is important that external project source files be able to
get the VTK-m version without actually loading any VTK-m code.
This commit is contained in:
Kenneth Moreland 2017-01-26 10:33:42 -07:00
parent a575ec1d5b
commit a671963834
2 changed files with 37 additions and 0 deletions

@ -18,6 +18,14 @@
## this software.
##============================================================================
# Configure version file. (Other configuration in internal/Configure.h)
vtkm_get_kit_name(kit_name kit_dir)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in
${CMAKE_BINARY_DIR}/include/${kit_dir}/Version.h
@ONLY)
vtkm_install_headers(
vtkm ${CMAKE_BINARY_DIR}/include/${kit_dir}/Version.h)
set(headers
Assert.h
BinaryPredicates.h

29
vtkm/Version.h.in Normal file

@ -0,0 +1,29 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2017 Sandia Corporation.
// Copyright 2017 UT-Battelle, LLC.
// Copyright 2017 Los Alamos National Security.
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_Version_h
#define vtk_m_Version_h
#define VTKM_VERSION_MAJOR @VTKm_VERSION_MAJOR@
#define VTKM_VERSION_MINOR @VTKm_VERSION_MINOR@
#define VTKM_VERSION_PATCH @VTKm_VERSION_PATCH@
#define VTKM_VERSION_FULL "@VTKm_VERSION_FULL@"
#define VTKM_VERSION "@VTKm_VERSION@"
#endif //vtk_m_Version_h