diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/genrev.cmake | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2847f3d8499..c9a4c1a742c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,9 @@ if( UNIX ) find_package(BZip2) endif() +# Find revision ID and hash of the sourcetree +include(cmake/genrev.cmake) + # print out the results before continuing include(cmake/showoptions.cmake) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index ecc9c282c9e..860e6d98709 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -56,6 +56,11 @@ if(NOT hg_rev_id_str MATCHES "Archive") endif() string(REPLACE "+" "" hg_rev_hash ${hg_rev_hash_str}) +# Its not set during initial run +if(NOT BUILDDIR) + set(BUILDDIR ${CMAKE_BINARY_DIR}) +endif() + # Create the actual revision.h file from the above params configure_file( "${CMAKE_SOURCE_DIR}/revision.h.in.cmake" |