Add DEW_AUTOUPDATE option to have dew automatically invoked

This commit is contained in:
Jack Andersen 2019-05-28 11:39:16 -10:00
parent 5011e7d26b
commit ab80c0113c
2 changed files with 27 additions and 2 deletions

View File

@ -17,6 +17,31 @@ function(integrate_dew)
return()
endif()
#
# Run dew update
#
option(DEW_AUTOUPDATE "Automatically update dew prefixes as part of cmake generation." ON)
if (DEW_AUTOUPDATE)
find_package(Python3 COMPONENTS Interpreter REQUIRED)
message(STATUS "Installing dew")
execute_process(
COMMAND "${Python3_EXECUTABLE}" -m pip install --user dew-pacman
RESULT_VARIABLE install_dew_result
)
if (NOT install_dew_result EQUAL 0)
message(FATAL_ERROR "Failed to install dew with pip: result: ${install_dew_result}.")
endif()
message(STATUS "Building dew dependencies")
execute_process(COMMAND "${Python3_EXECUTABLE}" -m dew update WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE dew_res)
if(NOT ${dew_res} EQUAL 0)
message(FATAL_ERROR "Unable to run dew: ${dew_res}")
endif()
endif()
#
# Acquaint CMake with dew prefix
#
if ("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
set(dew_cmake_prefix_suffix debug)
else()

View File

@ -34,14 +34,14 @@
"url": "https://github.com/jackoalan/CodeGen",
"type": "git",
"head": "cmake",
"ref": "e5df94de136afc93c4edcce48030ffdd22250308"
"ref": "3103ec4e9c4ae71b05c9e5ca46ee14f8682162a0"
},
{
"name": "LibCommon",
"url": "https://github.com/jackoalan/LibCommon",
"type": "git",
"head": "dew",
"ref": "8c4a1e7818b625bb26c1efa55d5d9a7c946f5402"
"ref": "a36312e91be8d6489d6b34447281dabb5422f96f"
},
{
"name": "lzo",