vcpkg/scripts/cmake/vcpkg_build_qmake.cmake

32 lines
1.1 KiB
CMake
Raw Normal View History

#.rst:
# .. command:: vcpkg_build_qmake
#
# Build a qmake-based project, previously configured using vcpkg_configure_qmake .
# As the CONFIG qmake option is assumed to be "debug_and_release" (the default value on Windows, see [1]),
# both the debug and release libraries are build in the same build tree.
#
# ::
# vcpkg_build_qmake()
#
#
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html
function(vcpkg_build_qmake)
vcpkg_find_acquire_program(JOM)
# Make sure that the linker finds the libraries used
2017-10-16 20:04:16 +08:00
set(ENV_PATH_BACKUP "$ENV{PATH}")
2017-10-15 21:40:25 +08:00
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}")
message(STATUS "Package ${TARGET_TRIPLET}")
2017-10-15 21:40:25 +08:00
vcpkg_execute_required_process(
COMMAND ${JOM}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}
LOGNAME package-${TARGET_TRIPLET}
)
message(STATUS "Package ${TARGET_TRIPLET} done")
2017-10-15 21:40:25 +08:00
# Restore the original value of ENV{PATH}
2017-10-16 20:04:16 +08:00
set(ENV{PATH} "${ENV_PATH_BACKUP}")
endfunction()