Skip to content

Commit

Permalink
Refs #11117. Generate header file with Poco version.
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Feb 19, 2015
1 parent 0e799c6 commit 8be0db9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Code/Mantid/Build/CMake/FindPoco.cmake
Expand Up @@ -61,13 +61,25 @@ if( POCO_INCLUDE_DIR )
file ( STRINGS ${VERSION_FILE} POCO_VERSION REGEX ${VERS_REGEX} )
# pull out just the part after the 0x
string( REGEX REPLACE ${VERS_REGEX} "\\1" POCO_VERSION ${POCO_VERSION} )

# Pretty format
string( SUBSTRING ${POCO_VERSION} 0 2 POCO_VERSION_MAJOR )
string( REGEX REPLACE "^0" "" POCO_VERSION_MAJOR ${POCO_VERSION_MAJOR} )
if ("${POCO_VERSION_MAJOR}" STREQUAL "")
set( POCO_VERSION_MAJOR "0")
endif()

string( SUBSTRING ${POCO_VERSION} 2 2 POCO_VERSION_MINOR )
string( REGEX REPLACE "^0" "" POCO_VERSION_MINOR ${POCO_VERSION_MINOR} )
if ("${POCO_VERSION_MINOR}" STREQUAL "")
set( POCO_VERSION_MINOR "0")
endif()

string( SUBSTRING ${POCO_VERSION} 4 2 POCO_VERSION_PATCH )
string( REGEX REPLACE "^0" "" POCO_VERSION_PATCH ${POCO_VERSION_PATCH} )
if ("${POCO_VERSION_PATCH}" STREQUAL "")
set( POCO_VERSION_PATCH "0")
endif()

set ( POCO_VERSION "${POCO_VERSION_MAJOR}.${POCO_VERSION_MINOR}.${POCO_VERSION_PATCH}" )
endif()
Expand Down
8 changes: 8 additions & 0 deletions Code/Mantid/Framework/Kernel/CMakeLists.txt
Expand Up @@ -196,6 +196,7 @@ set ( INC_FILES
inc/MantidKernel/NullValidator.h
inc/MantidKernel/ParaViewVersion.h
inc/MantidKernel/PhysicalConstants.h
inc/MantidKernel/PocoVersion.h
inc/MantidKernel/ProgressBase.h
inc/MantidKernel/ProgressText.h
inc/MantidKernel/Property.h
Expand Down Expand Up @@ -416,6 +417,13 @@ if ( NOT NOT_GIT_REPO OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersio
)
endif ()

###########################################################################
# This section deals with creating the PocoVersion implementation
###########################################################################
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h.in
${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h
)

###########################################################################
# This section deals with creating the ParaViewVersion implementation
###########################################################################
Expand Down
33 changes: 33 additions & 0 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/PocoVersion.h.in
@@ -0,0 +1,33 @@
#ifndef MANTID_KERNEL_POCOVERSION_H_
#define MANTID_KERNEL_POCOVERSION_H_

/** Macros defining Poco version used to compile Mantid.

Copyright © 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source

This file is part of Mantid.

Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
/// Major version of Poco used to build Mantid.
#define POCO_VERSION_MAJOR @POCO_VERSION_MAJOR@
/// Minor version of Poco used to build Mantid.
#define POCO_VERSION_MINOR @POCO_VERSION_MINOR@
/// Patch version of Poco used to build Mantid.
#define POCO_VERSION_PATCH @POCO_VERSION_PATCH@
#endif /* MANTID_KERNEL_POCOVERSION_H_ */

0 comments on commit 8be0db9

Please sign in to comment.