diff --git a/CMakeLists.txt b/CMakeLists.txt index dbc6f238..929aa9b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,8 @@ ################################################################################### #version number of the library -set (TRIQS_VERSION "1.0.0") +set (TRIQS_VERSION "1.0") +set (TRIQS_RELEASE "1.0.0") # Path for local cmake modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) diff --git a/cmake/TRIQSConfig.cmake.in b/cmake/TRIQSConfig.cmake.in index a98e522c..fd81a851 100644 --- a/cmake/TRIQSConfig.cmake.in +++ b/cmake/TRIQSConfig.cmake.in @@ -1,5 +1,6 @@ # version set(TRIQS_VERSION @TRIQS_VERSION@) +set(TRIQS_RELEASE @TRIQS_RELEASE@) set(TRIQS_GIT_HASH @TRIQS_GIT_HASH@) # definitions diff --git a/pytriqs/version.py.in b/pytriqs/version.py.in index beb6739f..e2233233 100644 --- a/pytriqs/version.py.in +++ b/pytriqs/version.py.in @@ -1,28 +1,26 @@ +################################################################################ +# +# TRIQS: a Toolbox for Research in Interacting Quantum Systems +# +# Copyright (C) 2011 by M. Ferrero, O. Parcollet +# +# TRIQS 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. +# +# TRIQS 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 +# TRIQS. If not, see . +# +################################################################################ -VersionNumber = "1.0" - -# if we use a git clone, then tag with the hash, else just the plain number -git_hash = "@GIT_HASH@" - -branch_info_all = [ b.strip() for b in """@GIT_BRANCHES@""".split('\n')] -try : - branch_info = [ b[1:].strip() for b in branch_info_all if b[0] == '*'][0] -except : - branch_info = "" - -revision = "branch = %s; commit = %s"%(branch_info, git_hash if git_hash else VersionNumber) - -def cmake_options() : - return open ("@CMAKE_BINARY_DIR@/CMakeCache.txt").read() - - -machine_info = """Code compiled on @myHostName@ under login @WhoAmI@ """ - -all_info = """ - Code revision : %s - %s - For all the configuration options, use cmake_options() - """%(revision,machine_info) - -greeting = """ Code revision : %s """%(revision) +triqs_version = "@TRIQS_VERSION@" +triqs_release = "@TRIQS_RELEASE@" +def show_version(): + print "\nYou are using the TRIQS library version %s, release %s\n"%(triqs_version, triqs_release) diff --git a/triqs/CMakeLists.txt b/triqs/CMakeLists.txt index b5dc6277..de12df52 100644 --- a/triqs/CMakeLists.txt +++ b/triqs/CMakeLists.txt @@ -24,6 +24,10 @@ target_link_libraries (triqs ${LINK_RT} ${TRIQS_LINK_LIBS} ) # Install library install(TARGETS triqs DESTINATION lib) +# Version file +configure_file(version.hpp.in version.hpp @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/version.hpp" DESTINATION "include/triqs/") + # all .hpp files... FILE(GLOB_RECURSE ALLHEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.hpp) diff --git a/triqs/version.hpp.in b/triqs/version.hpp.in new file mode 100644 index 00000000..3ce0ea99 --- /dev/null +++ b/triqs/version.hpp.in @@ -0,0 +1,7 @@ +#ifndef TRIQS_VERSION_HPP +#define TRIQS_VERSION_HPP + +#define TRIQS_VERSION "@TRIQS_VERSION@" +#define TRIQS_RELEASE "@TRIQS_RELEASE@" + +#endif