[vcpkg-qmake] Tidy qmake-based builds. Search for qmake.exe inside tools.

This commit is contained in:
Robert Schumacher 2017-03-20 16:10:45 -07:00
parent f17fd50a62
commit fded520642
3 changed files with 10 additions and 13 deletions

View File

@ -12,11 +12,7 @@
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html # [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html
function(vcpkg_build_qmake) function(vcpkg_build_qmake)
vcpkg_find_acquire_program("JOM") vcpkg_find_acquire_program(JOM)
if(NOT JOM)
BUILD_ERROR("vcpkg_install_qmake: impossible to find jom.")
endif()
# Make sure that the linker finds the libraries used # Make sure that the linker finds the libraries used
set(ENV_LIB_BACKUP ENV{LIB}) set(ENV_LIB_BACKUP ENV{LIB})

View File

@ -5,7 +5,7 @@
# It is assume that the qmake project CONFIG variable is # It is assume that the qmake project CONFIG variable is
# "debug_and_release" (the default value on Windows, see [1]). # "debug_and_release" (the default value on Windows, see [1]).
# Using this option, only one Makefile for building both Release and Debug # 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. # command.
# #
# :: # ::
@ -13,7 +13,7 @@
# [OPTIONS arg1 [arg2 ...]] # [OPTIONS arg1 [arg2 ...]]
# ) # )
# #
# ``PROJECT_PATH`` # ``SOURCE_PATH``
# The path to the *.pro qmake project file. # The path to the *.pro qmake project file.
# ``OPTIONS`` # ``OPTIONS``
# The options passed to qmake. # The options passed to qmake.
@ -24,10 +24,10 @@ function(vcpkg_configure_qmake)
cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN})
# Find qmake exectuable # 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) if(NOT QMAKE_COMMAND)
BUILD_ERROR("vcpkg_configure_qmake: impossible to find qmake.") message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.")
endif() endif()
# Cleanup build directories # Cleanup build directories
@ -36,7 +36,7 @@ function(vcpkg_configure_qmake)
message(STATUS "Configuring ${TARGET_TRIPLET}") message(STATUS "Configuring ${TARGET_TRIPLET}")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
vcpkg_execute_required_process( 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} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}
LOGNAME config-${TARGET_TRIPLET} LOGNAME config-${TARGET_TRIPLET}
) )

View File

@ -2,11 +2,12 @@
function(vcpkg_execute_required_process_repeat) function(vcpkg_execute_required_process_repeat)
cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) 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})") #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}) foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT})
execute_process( execute_process(
COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} COMMAND ${vcpkg_execute_required_process_repeat_COMMAND}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.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.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err-${loop_count}.log
RESULT_VARIABLE error_code RESULT_VARIABLE error_code
WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY})
#debug_message("error_code=${error_code}") #debug_message("error_code=${error_code}")
@ -16,7 +17,7 @@ function(vcpkg_execute_required_process_repeat)
break() break()
endif() endif()
endforeach(loop_count) endforeach(loop_count)
if (NOT ${SUCCESSFUL_EXECUTION}) if (NOT SUCCESSFUL_EXECUTION)
message(FATAL_ERROR message(FATAL_ERROR
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n" " Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n"
" Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n" " Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n"