mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 13:25:04 +08:00
[vcpkg-qmake] Tidy qmake-based builds. Search for qmake.exe inside tools.
This commit is contained in:
parent
f17fd50a62
commit
fded520642
@ -12,11 +12,7 @@
|
||||
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html
|
||||
|
||||
function(vcpkg_build_qmake)
|
||||
vcpkg_find_acquire_program("JOM")
|
||||
|
||||
if(NOT JOM)
|
||||
BUILD_ERROR("vcpkg_install_qmake: impossible to find jom.")
|
||||
endif()
|
||||
vcpkg_find_acquire_program(JOM)
|
||||
|
||||
# Make sure that the linker finds the libraries used
|
||||
set(ENV_LIB_BACKUP ENV{LIB})
|
||||
|
@ -5,7 +5,7 @@
|
||||
# It is assume that the qmake project CONFIG variable is
|
||||
# "debug_and_release" (the default value on Windows, see [1]).
|
||||
# Using this option, only one Makefile for building both Release and Debug
|
||||
# libraries is generated, that then can be run using the vcpkg_install_qmake
|
||||
# libraries is generated, that then can be run using the vcpkg_build_qmake
|
||||
# command.
|
||||
#
|
||||
# ::
|
||||
@ -13,7 +13,7 @@
|
||||
# [OPTIONS arg1 [arg2 ...]]
|
||||
# )
|
||||
#
|
||||
# ``PROJECT_PATH``
|
||||
# ``SOURCE_PATH``
|
||||
# The path to the *.pro qmake project file.
|
||||
# ``OPTIONS``
|
||||
# The options passed to qmake.
|
||||
@ -24,10 +24,10 @@ function(vcpkg_configure_qmake)
|
||||
cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN})
|
||||
|
||||
# Find qmake exectuable
|
||||
find_program(QMAKE_COMMAND NAMES qmake)
|
||||
find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5)
|
||||
|
||||
if(NOT QMAKE_COMMAND)
|
||||
BUILD_ERROR("vcpkg_configure_qmake: impossible to find qmake.")
|
||||
message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.")
|
||||
endif()
|
||||
|
||||
# Cleanup build directories
|
||||
@ -36,7 +36,7 @@ function(vcpkg_configure_qmake)
|
||||
message(STATUS "Configuring ${TARGET_TRIPLET}")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${QMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS}
|
||||
COMMAND ${QMAKE_COMMAND} ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH}
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}
|
||||
LOGNAME config-${TARGET_TRIPLET}
|
||||
)
|
||||
|
@ -2,11 +2,12 @@
|
||||
function(vcpkg_execute_required_process_repeat)
|
||||
cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
||||
#debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})")
|
||||
set(SUCCESSFUL_EXECUTION FALSE)
|
||||
foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT})
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_execute_required_process_repeat_COMMAND}
|
||||
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log
|
||||
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err.log
|
||||
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out-${loop_count}.log
|
||||
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err-${loop_count}.log
|
||||
RESULT_VARIABLE error_code
|
||||
WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY})
|
||||
#debug_message("error_code=${error_code}")
|
||||
@ -16,7 +17,7 @@ function(vcpkg_execute_required_process_repeat)
|
||||
break()
|
||||
endif()
|
||||
endforeach(loop_count)
|
||||
if (NOT ${SUCCESSFUL_EXECUTION})
|
||||
if (NOT SUCCESSFUL_EXECUTION)
|
||||
message(FATAL_ERROR
|
||||
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n"
|
||||
" Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n"
|
||||
|
Loading…
Reference in New Issue
Block a user