Only install the dew dependencies for the used configuration

This commit is contained in:
Henrique Gemignani Passos Lima 2019-06-14 01:54:28 +02:00
parent 69a9a6622b
commit 2f24473b44
1 changed files with 11 additions and 10 deletions

View File

@ -17,6 +17,15 @@ function(integrate_dew)
return() return()
endif() endif()
#
# Acquaint CMake with dew prefix
#
if ("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
set(dew_cmake_prefix_suffix debug)
else()
set(dew_cmake_prefix_suffix release)
endif()
# #
# Run dew update # Run dew update
# #
@ -32,22 +41,14 @@ function(integrate_dew)
message(FATAL_ERROR "Failed to install dew with pip: result: ${install_dew_result}.") message(FATAL_ERROR "Failed to install dew with pip: result: ${install_dew_result}.")
endif() endif()
message(STATUS "Building dew dependencies") message(STATUS "Building dew dependencies")
execute_process(COMMAND "${Python3_EXECUTABLE}" -m dew update WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" execute_process(COMMAND "${Python3_EXECUTABLE}" -m dew update --build-type ${dew_cmake_prefix_suffix}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE dew_res) RESULT_VARIABLE dew_res)
if(NOT dew_res EQUAL 0) if(NOT dew_res EQUAL 0)
message(FATAL_ERROR "Unable to run dew: ${dew_res}") message(FATAL_ERROR "Unable to run dew: ${dew_res}")
endif() endif()
endif() endif()
#
# Acquaint CMake with dew prefix
#
if ("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
set(dew_cmake_prefix_suffix debug)
else()
set(dew_cmake_prefix_suffix release)
endif()
set(dew_output_path "${CMAKE_CURRENT_SOURCE_DIR}/.dew") set(dew_output_path "${CMAKE_CURRENT_SOURCE_DIR}/.dew")
set(dew_cmake_prefix_path "${dew_output_path}/prefix-${dew_cmake_prefix_suffix}") set(dew_cmake_prefix_path "${dew_output_path}/prefix-${dew_cmake_prefix_suffix}")
set(dew_cmake_module_path "${dew_cmake_prefix_path}/share/cmake/Modules") set(dew_cmake_module_path "${dew_cmake_prefix_path}/share/cmake/Modules")