CMake: Avoid call of find_package(Git) for every compile with buildinfo enabled

This is a bit tricky, find_package(Git) was only used to check if git is installed
and actual git command was assumed to be in the PATH (while ideally it should have
been GIT_COMMAND variable).

This commit makes re-compile output cleaner, especially when using Ninja.

Adding proper GIT_COMMAND to buildinfo.cmake is also possible via argument.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1847
This commit is contained in:
Sergey Sharybin
2016-03-11 13:05:44 +05:00
parent e7eb91365b
commit cc2138888a
2 changed files with 100 additions and 97 deletions

View File

@@ -704,6 +704,13 @@ else()
set(COMPILER_SSE2_FLAG)
endif()
if(WITH_BUILDINFO)
find_package(Git)
if(NOT GIT_FOUND)
set(WITH_BUILDINFO OFF)
endif()
endif()
TEST_SHARED_PTR_SUPPORT()
TEST_UNORDERED_MAP_SUPPORT()