--- a/CMakeLists.txt Sat Jun 06 22:03:00 2015 +0300 +++ b/CMakeLists.txt Sat Jun 06 22:18:30 2015 +0300 @@ -76,6 +76,14 @@ ) endif() +add_custom_target (make_hginfo + COMMAND python + "${CMAKE_SOURCE_DIR}/updaterevision.py" + "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +add_dependencies (${PROJECT_NAME} make_hginfo) + # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword # which clang doesn't seem to like. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")