mirror of
https://github.com/triqs/dft_tools
synced 2024-12-23 04:43:42 +01:00
[cmake] Use PROJECT_GIT_HASH instead to store git hash and adjust dependent files accordingly
This commit is contained in:
parent
99df95f853
commit
8d906ed6cc
@ -35,9 +35,9 @@ find_package(TRIQS 2.2 REQUIRED)
|
|||||||
find_package(Cpp2Py 1.6 REQUIRED)
|
find_package(Cpp2Py 1.6 REQUIRED)
|
||||||
|
|
||||||
# Get the git hash & print status
|
# 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} 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
|
# Enforce Consistent Versioning
|
||||||
if(NOT ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} VERSION_EQUAL ${TRIQS_VERSION_MAJOR}.${TRIQS_VERSION_MINOR})
|
if(NOT ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} VERSION_EQUAL ${TRIQS_VERSION_MAJOR}.${TRIQS_VERSION_MINOR})
|
||||||
|
@ -8,7 +8,7 @@ target_link_libraries(app4triqs_c PUBLIC triqs PRIVATE project_warnings)
|
|||||||
target_compile_options(app4triqs_c PUBLIC -fPIC)
|
target_compile_options(app4triqs_c PUBLIC -fPIC)
|
||||||
target_include_directories(app4triqs_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
|
target_include_directories(app4triqs_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
|
||||||
target_compile_definitions(app4triqs_c PUBLIC
|
target_compile_definitions(app4triqs_c PUBLIC
|
||||||
APP4TRIQS_GIT_HASH=${APP4TRIQS_GIT_HASH}
|
APP4TRIQS_GIT_HASH=${PROJECT_GIT_HASH}
|
||||||
TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
|
TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
|
||||||
$<$<CONFIG:Debug>:APP4TRIQS_DEBUG>
|
$<$<CONFIG:Debug>:APP4TRIQS_DEBUG>
|
||||||
$<$<CONFIG:Debug>:TRIQS_DEBUG>
|
$<$<CONFIG:Debug>:TRIQS_DEBUG>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
version = "@APP4TRIQS_VERSION@"
|
version = "@APP4TRIQS_VERSION@"
|
||||||
triqs_hash = "@TRIQS_GIT_HASH@"
|
triqs_hash = "@TRIQS_GIT_HASH@"
|
||||||
app4triqs_hash = "@APP4TRIQS_GIT_HASH@"
|
app4triqs_hash = "@PROJECT_GIT_HASH@"
|
||||||
|
|
||||||
def show_version():
|
def show_version():
|
||||||
print "\nYou are using app4triqs version %s\n"%version
|
print "\nYou are using app4triqs version %s\n"%version
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
set name app4triqs
|
set name app4triqs
|
||||||
set version @APP4TRIQS_VERSION@
|
set version @APP4TRIQS_VERSION@
|
||||||
set root @CMAKE_INSTALL_PREFIX@
|
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 url "https://github.com/TRIQS/app4triqs"
|
||||||
set description "An example application using cpp2py and triqs."
|
set description "An example application using cpp2py and triqs."
|
||||||
|
@ -8,7 +8,7 @@ set(APP4TRIQS_FOUND True)
|
|||||||
|
|
||||||
# version
|
# version
|
||||||
set(APP4TRIQS_VERSION @PROJECT_VERSION@)
|
set(APP4TRIQS_VERSION @PROJECT_VERSION@)
|
||||||
set(APP4TRIQS_GIT_HASH @APP4TRIQS_GIT_HASH@)
|
set(APP4TRIQS_GIT_HASH @PROJECT_GIT_HASH@)
|
||||||
|
|
||||||
# Root of the installation
|
# Root of the installation
|
||||||
set(APP4TRIQS_ROOT @CMAKE_INSTALL_PREFIX@)
|
set(APP4TRIQS_ROOT @CMAKE_INSTALL_PREFIX@)
|
||||||
@ -16,7 +16,7 @@ set(APP4TRIQS_ROOT @CMAKE_INSTALL_PREFIX@)
|
|||||||
# Include the exported targets of this project
|
# Include the exported targets of this project
|
||||||
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/app4triqs/app4triqs-targets.cmake)
|
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?
|
# Was the Project built with Documentation?
|
||||||
set(APP4TRIQS_WITH_DOCUMENTATION @Build_Documentation@)
|
set(APP4TRIQS_WITH_DOCUMENTATION @Build_Documentation@)
|
||||||
|
Loading…
Reference in New Issue
Block a user