aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_build_qmake_debug.cmake
blob: a734e63cf299bec37db84607eaea409f385beb57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#.rst:
# .. command:: vcpkg_build_qmake_debug
#
#  Build a qmake-based project, previously configured using vcpkg_configure_qmake_debug. 
#
#  ::
#  vcpkg_build_qmake_debug()
#
#
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html

function(vcpkg_build_qmake_debug)
    cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN})
    vcpkg_find_acquire_program(JOM)

    # Make sure that the linker finds the libraries used 
    set(ENV_PATH_BACKUP "$ENV{PATH}")
    set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/debug/tools/qt5;$ENV{PATH}")
    
    message(STATUS "Package ${TARGET_TRIPLET}-dbg")
    vcpkg_execute_required_process(
        COMMAND ${JOM} ${_csc_TARGETS}
        WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
        LOGNAME package-${TARGET_TRIPLET}-dbg
    )
    message(STATUS "Package ${TARGET_TRIPLET}-dbg done")
    
    # Restore the original value of ENV{PATH}
    set(ENV{PATH} "${ENV_PATH_BACKUP}")
endfunction()