diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-01-18 07:36:07 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-01-18 07:36:54 -0800 |
| commit | b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4 (patch) | |
| tree | 18cdcabab3bb5a83ed4429faa2e0a831e2bec435 /scripts/cmake/vcpkg_configure_qmake.cmake | |
| parent | 51da0e25fa5af242331d0a5d8b0d8b4137d98fc5 (diff) | |
| download | vcpkg-b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4.tar.gz vcpkg-b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4.zip | |
[vcpkg-build-qmake][vcpkg-configure-qmake] Collapse config-specific versions.
Diffstat (limited to 'scripts/cmake/vcpkg_configure_qmake.cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_configure_qmake.cmake | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index 037197e48..4cc7bc9f7 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -2,11 +2,6 @@ # .. command:: vcpkg_configure_qmake # # Configure a qmake-based project. -# 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_build_qmake -# command. # # :: # vcpkg_configure_qmake(SOURCE_PATH <pro_file_path> @@ -17,28 +12,44 @@ # The path to the *.pro qmake project file. # ``OPTIONS`` # The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_configure_qmake) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - # Find qmake exectuable + # Find qmake executable find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS CONFIG+=staticlib) + endif() + # Cleanup build directories - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME config-${TARGET_TRIPLET} + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel ) - message(STATUS "Configuring ${TARGET_TRIPLET} done") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endfunction()
\ No newline at end of file |
