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) set(CMAKE_CONFIGURATION_TYPES Debug Release)
endif (CMAKE_CONFIGURATION_TYPES) endif (CMAKE_CONFIGURATION_TYPES)
#
# Required packages
find_package(Git REQUIRED) find_package(Git REQUIRED)
find_package(DepotTools REQUIRED)
if (WIN32) if (WIN32)
set(PYTHON_EXECUTABLE ${CMAKE_SOURCE_DIR}/depot_tools/python.bat) set(PYTHON_EXECUTABLE ${CMAKE_SOURCE_DIR}/depot_tools/python.bat)
else (WIN32) else (WIN32)
find_package(PythonInterp REQUIRED) find_package(PythonInterp REQUIRED)
endif (WIN32) endif (WIN32)
find_package(DepotTools REQUIRED)
# #
# Set the project's version # Set the project's version

View file

@ -1,14 +1,16 @@
if (WIN32) find_program(DEPOTTOOLS_GCLIENT_EXECUTABLE
find_program(DEPOTTOOLS_GCLIENT_EXECUTABLE NAMES gclient gclient.bat
NAMES gclient.bat PATHS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools)
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools)
else (WIN32) find_path(DEPOTTOOLS_PATH
find_program(DEPOTTOOLS_GCLIENT_EXECUTABLE NAMES gclient gclient.py gclient.bat
NAMES gclient gn gn.py gn.bat
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/depot_tools) ninja ninja.exe ninja-linux32 ninja-linux64 ninja-mac
endif (WIN32) 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) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(DepotTools find_package_handle_standard_args(DepotTools
REQUIRED_VARS DEPOTTOOLS_GCLIENT_EXECUTABLE REQUIRED_VARS DEPOTTOOLS_GCLIENT_EXECUTABLE
FAIL_MESSAGE "Could not find the gclient executable.") FAIL_MESSAGE "Could not find the gclient executable.")