From 729e618baa0db0ada6a54174c19cd403c5f7b8d8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 3 Oct 2010 16:55:24 +0200 Subject: Buildsystem: Generate revision.h additionally during initial cmake run, also fixes displaying revision during run --HG-- branch : trunk --- CMakeLists.txt | 3 +++ cmake/genrev.cmake | 5 +++++ 2 files changed, 8 insertions(+) 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" -- cgit v1.2.3