Enhance FindDepotTools.cmake, include it before looking for Python

This commit is contained in:
Axel Isouard 2017-02-05 06:14:42 -08:00
parent 704267abcb
commit 29b4333904
No known key found for this signature in database
GPG key ID: D30914735883C824
2 changed files with 16 additions and 11 deletions

View file

@ -9,13 +9,16 @@ if (CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release)
endif (CMAKE_CONFIGURATION_TYPES)
#
# Required packages
find_package(Git REQUIRED)
find_package(DepotTools REQUIRED)
if (WIN32)
set(PYTHON_EXECUTABLE ${CMAKE_SOURCE_DIR}/depot_tools/python.bat)
else (WIN32)
find_package(PythonInterp REQUIRED)
endif (WIN32)
find_package(DepotTools REQUIRED)
#
# Set the project's version

View file

@ -1,12 +1,14 @@
if (WIN32)
find_program(DEPOTTOOLS_GCLIENT_EXECUTABLE
NAMES gclient.bat
NAMES gclient gclient.bat
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools)
else (WIN32)
find_program(DEPOTTOOLS_GCLIENT_EXECUTABLE
NAMES gclient
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools)
endif (WIN32)
find_path(DEPOTTOOLS_PATH
NAMES gclient gclient.py gclient.bat
gn gn.py gn.bat
ninja ninja.exe ninja-linux32 ninja-linux64 ninja-mac
download_from_google_storage download_from_google_storage.bat
download_from_google_storage.py
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(DepotTools