3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-22 20:34:38 +01:00

[cmake] Use PROJECT_GIT_HASH instead to store git hash and adjust dependent files accordingly

This commit is contained in:
Nils Wentzell 2019-07-16 11:54:32 -04:00
parent 99df95f853
commit 8d906ed6cc
5 changed files with 7 additions and 7 deletions

View File

@ -35,9 +35,9 @@ find_package(TRIQS 2.2 REQUIRED)
find_package(Cpp2Py 1.6 REQUIRED)
# Get the git hash & print status
triqs_get_git_hash_of_source_dir(CMAKE_PROJECT_GIT_HASH)
triqs_get_git_hash_of_source_dir(PROJECT_GIT_HASH)
message(STATUS "${PROJECT_NAME} version : ${PROJECT_VERSION}")
message(STATUS "${PROJECT_NAME} Git hash: ${CMAKE_PROJECT_GIT_HASH}")
message(STATUS "${PROJECT_NAME} Git hash: ${PROJECT_GIT_HASH}")
# Enforce Consistent Versioning
if(NOT ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} VERSION_EQUAL ${TRIQS_VERSION_MAJOR}.${TRIQS_VERSION_MINOR})

View File

@ -8,7 +8,7 @@ target_link_libraries(app4triqs_c PUBLIC triqs PRIVATE project_warnings)
target_compile_options(app4triqs_c PUBLIC -fPIC)
target_include_directories(app4triqs_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
target_compile_definitions(app4triqs_c PUBLIC
APP4TRIQS_GIT_HASH=${APP4TRIQS_GIT_HASH}
APP4TRIQS_GIT_HASH=${PROJECT_GIT_HASH}
TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
$<$<CONFIG:Debug>:APP4TRIQS_DEBUG>
$<$<CONFIG:Debug>:TRIQS_DEBUG>

View File

@ -23,7 +23,7 @@
version = "@APP4TRIQS_VERSION@"
triqs_hash = "@TRIQS_GIT_HASH@"
app4triqs_hash = "@APP4TRIQS_GIT_HASH@"
app4triqs_hash = "@PROJECT_GIT_HASH@"
def show_version():
print "\nYou are using app4triqs version %s\n"%version

View File

@ -5,7 +5,7 @@
set name app4triqs
set version @APP4TRIQS_VERSION@
set root @CMAKE_INSTALL_PREFIX@
set git_hash @APP4TRIQS_GIT_HASH@
set git_hash @PROJECT_GIT_HASH@
set url "https://github.com/TRIQS/app4triqs"
set description "An example application using cpp2py and triqs."

View File

@ -8,7 +8,7 @@ set(APP4TRIQS_FOUND True)
# version
set(APP4TRIQS_VERSION @PROJECT_VERSION@)
set(APP4TRIQS_GIT_HASH @APP4TRIQS_GIT_HASH@)
set(APP4TRIQS_GIT_HASH @PROJECT_GIT_HASH@)
# Root of the installation
set(APP4TRIQS_ROOT @CMAKE_INSTALL_PREFIX@)
@ -16,7 +16,7 @@ set(APP4TRIQS_ROOT @CMAKE_INSTALL_PREFIX@)
# Include the exported targets of this project
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/app4triqs/app4triqs-targets.cmake)
message(STATUS "Found app4triqs-config.cmake with version @PROJECT_VERSION@, hash = @APP4TRIQS_GIT_HASH@")
message(STATUS "Found app4triqs-config.cmake with version @PROJECT_VERSION@, hash = @PROJECT_GIT_HASH@")
# Was the Project built with Documentation?
set(APP4TRIQS_WITH_DOCUMENTATION @Build_Documentation@)