diff options
| author | Barath Kannan <barathsotd@gmail.com> | 2017-10-16 23:04:16 +1100 |
|---|---|---|
| committer | Barath Kannan <barathsotd@gmail.com> | 2017-10-16 23:04:16 +1100 |
| commit | 3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5 (patch) | |
| tree | f7946db2530760ea1e57af3e8cadb95fcba3f196 /scripts | |
| parent | 890a81bebc3642454e3833c789a35ba9a7989c9d (diff) | |
| download | vcpkg-3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5.tar.gz vcpkg-3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5.zip | |
working qt tools build
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake.cmake | 4 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake_debug.cmake | 29 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake_release.cmake | 29 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_common_functions.cmake | 4 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_qmake_debug.cmake | 41 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_qmake_release.cmake | 43 |
6 files changed, 148 insertions, 2 deletions
diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index bee5da7c9..693f7841e 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,7 +15,7 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP ENV{PATH}) + 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}") @@ -27,5 +27,5 @@ function(vcpkg_build_qmake) message(STATUS "Package ${TARGET_TRIPLET} done") # Restore the original value of ENV{PATH} - set(ENV{PATH} ENV_PATH_BACKUP) + 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..7e5625850 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -0,0 +1,29 @@ +#.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) + 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} + 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..6cfbcdc91 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -0,0 +1,29 @@ +#.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) + 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} + 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..0166973d2 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -0,0 +1,41 @@ +#.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") +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..67bdbdfb0 --- /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 PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) +endfunction()
\ No newline at end of file |
