diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-17 14:47:16 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-17 14:47:16 -0700 |
| commit | 6e2aa89e8732b7eb5cda97e63a901f1a448b04d5 (patch) | |
| tree | 781760d5b09b4b5a861d072394fd8165afbe50dd /scripts | |
| parent | 63183677af91f1c58a812a7706fe0e149bb558d8 (diff) | |
| parent | 48128e5b4dc964a306737e829affe349d8c6956c (diff) | |
| download | vcpkg-6e2aa89e8732b7eb5cda97e63a901f1a448b04d5.tar.gz vcpkg-6e2aa89e8732b7eb5cda97e63a901f1a448b04d5.zip | |
Merge branch 'qt5_modular' of https://github.com/Barath-Kannan/vcpkg into Barath-Kannan-qt5_modular
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake.cmake | 11 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake_debug.cmake | 30 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake_release.cmake | 30 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_common_functions.cmake | 4 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_qmake_debug.cmake | 44 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_qmake_release.cmake | 43 |
6 files changed, 156 insertions, 6 deletions
diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 1c6358654..693f7841e 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,18 +15,17 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_LIB_BACKUP ENV{LIB}) - set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;$ENV{LIB}") + set(ENV_PATH_BACKUP "$ENV{PATH}") + 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}") - vcpkg_execute_required_process_repeat( - COUNT 2 + vcpkg_execute_required_process( COMMAND ${JOM} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} LOGNAME package-${TARGET_TRIPLET} ) message(STATUS "Package ${TARGET_TRIPLET} done") - # Restore the original value of ENV{LIB} - set(ENV{LIB} ENV_LIB_BACKUP) + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake new file mode 100644 index 000000000..a734e63cf --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -0,0 +1,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() diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake new file mode 100644 index 000000000..3daf9201b --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -0,0 +1,30 @@ +#.rst: +# .. command:: vcpkg_build_qmake_release +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake_release. +# +# :: +# vcpkg_build_qmake_release() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake_release) + 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}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${JOM} ${_csc_TARGETS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 81e8e5813..5dabd446e 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,11 +10,15 @@ include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) +include(vcpkg_build_qmake_debug) +include(vcpkg_build_qmake_release) include(vcpkg_install_cmake) include(vcpkg_install_meson) include(vcpkg_configure_cmake) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) +include(vcpkg_configure_qmake_debug) +include(vcpkg_configure_qmake_release) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake new file mode 100644 index 000000000..e3dfb0777 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -0,0 +1,44 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_debug +# +# Configure a qmake-based project. +# This sets the config variable to debug and outputs to +# a debug triplet directory. +# +# :: +# vcpkg_configure_qmake_debug(SOURCE_PATH <pro_file_path> +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# 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_debug) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/debug/tools/qt5) + + if(NOT QMAKE_COMMAND) + message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + 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} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + unset(QMAKE_COMMAND) + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) +endfunction()
\ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake new file mode 100644 index 000000000..cf9eacbd5 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -0,0 +1,43 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_release +# +# Configure a qmake-based project. +# This sets the config variable to release and outputs to +# a release triplet directory. +# +# :: +# vcpkg_configure_qmake_release(SOURCE_PATH <pro_file_path> +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# 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_release) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + 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() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + unset(QMAKE_COMMAND) + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) +endfunction()
\ No newline at end of file |
