Browse Source

Merge pull request #86 from CodeShark/build_info_h

Commit hash is stored in an automatically generated header file.
cl-refactor
Gav Wood 11 years ago
parent
commit
fa2589aa29
  1. 6
      CMakeLists.txt

6
CMakeLists.txt

@ -143,6 +143,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
link_directories(/usr/local/lib)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Generate header file containing useful build information
execute_process(COMMAND git --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git --work-tree=${CMAKE_CURRENT_SOURCE_DIR} rev-parse HEAD OUTPUT_VARIABLE commit_hash OUTPUT_STRIP_TRAILING_WHITESPACE)
message("Commit Hash: ${commit_hash}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.h "// This file was automatically generated by cmake\n#pragma once\n\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.h "#define COMMIT_HASH \"${commit_hash}\"\n")
add_subdirectory(secp256k1)
add_subdirectory(libethereum)
add_subdirectory(test)

Loading…
Cancel
Save