From fded520642292b1d9ef1fced1c9c556d5d90e6d4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 20 Mar 2017 16:10:45 -0700 Subject: [PATCH] [vcpkg-qmake] Tidy qmake-based builds. Search for qmake.exe inside tools. --- scripts/cmake/vcpkg_build_qmake.cmake | 6 +----- scripts/cmake/vcpkg_configure_qmake.cmake | 10 +++++----- .../cmake/vcpkg_execute_required_process_repeat.cmake | 7 ++++--- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 2632004236..1c63586547 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -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}) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index f51a2f4fbb..037197e483 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -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} ) diff --git a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake index d6fba132d3..0c77c3913b 100644 --- a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake +++ b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -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"