From 459ac9f2e17340e10e3cb8a66f956c59541d5fdd Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 00:40:25 +1100 Subject: qt5tools package --- scripts/cmake/vcpkg_build_qmake.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 1c6358654..bee5da7c9 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() -- cgit v1.2.3 From 3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:04:16 +1100 Subject: working qt tools build --- scripts/cmake/vcpkg_build_qmake.cmake | 4 +-- scripts/cmake/vcpkg_build_qmake_debug.cmake | 29 +++++++++++++++ scripts/cmake/vcpkg_build_qmake_release.cmake | 29 +++++++++++++++ scripts/cmake/vcpkg_common_functions.cmake | 4 +++ scripts/cmake/vcpkg_configure_qmake_debug.cmake | 41 +++++++++++++++++++++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 43 +++++++++++++++++++++++ 6 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake (limited to 'scripts') 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 +# [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 +# [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 -- cgit v1.2.3 From d28de4a13edca249086e3ccf8d34e92ecb10006d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:56:47 +1100 Subject: qt5winextras --- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 3 +++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 + 2 files changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index 0166973d2..e3dfb0777 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -38,4 +38,7 @@ function(vcpkg_configure_qmake_debug) 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 index 67bdbdfb0..8ab5340e9 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -38,6 +38,7 @@ function(vcpkg_configure_qmake_release) 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 -- cgit v1.2.3 From c147fc78c919d6084e5f98a574484346d590f00d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 03:15:30 +1100 Subject: further fixes --- scripts/cmake/vcpkg_build_qmake_debug.cmake | 3 ++- scripts/cmake/vcpkg_build_qmake_release.cmake | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake index 7e5625850..a734e63cf 100644 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -10,6 +10,7 @@ # [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 @@ -18,7 +19,7 @@ function(vcpkg_build_qmake_debug) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${JOM} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake index 6cfbcdc91..3daf9201b 100644 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -10,15 +10,16 @@ # [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} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) -- cgit v1.2.3 From 62b62d9f35cfb1e81971f56d4f33f369ed9af53c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 20:02:26 +1100 Subject: minor clean up and configuration --- scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index 8ab5340e9..cf9eacbd5 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,7 +22,6 @@ function(vcpkg_configure_qmake_release) # 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() -- cgit v1.2.3 From 9bb4817e32a14647093876cabaf62bbd2be63fc6 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:24:29 +1100 Subject: use install target in Makefiles; make all portfile uniform --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_replace_string.cmake | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 scripts/cmake/vcpkg_replace_string.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 5dabd446e..e48b5e442 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -26,3 +26,4 @@ include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) include(vcpkg_acquire_depot_tools) +include(vcpkg_replace_string) diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake new file mode 100644 index 000000000..3eb18d0bf --- /dev/null +++ b/scripts/cmake/vcpkg_replace_string.cmake @@ -0,0 +1,14 @@ +#.rst: +# .. command:: vcpkg_replace_string +# +# Replace a string in a file. +# +# :: +# vcpkg_replace_string(filename match_string replace_string) +# +# +function(vcpkg_replace_string filename match_string replace_string) + file(READ ${filename} _contents) + string(REPLACE "${match_string}" "${replace_string}" _contents "${_contents}") + file(WRITE ${filename} "${_contents}") +endfunction() -- cgit v1.2.3 From 3a5b383bbec74dbaf0f1056e1a5d315e43d79375 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:31:24 +1100 Subject: resolve conflict on non-existant vcpkg_acquire_depot_tools --- scripts/cmake/vcpkg_common_functions.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index e48b5e442..40111542d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -25,5 +25,4 @@ include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) -include(vcpkg_acquire_depot_tools) include(vcpkg_replace_string) -- cgit v1.2.3 From eec26f68fc0f380118b2de7670c98f7a639d9d4b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 20 Nov 2017 17:07:03 -0800 Subject: [qt5] Reduce duplication in modular build by extracting qt5modularscripts --- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 6 ++++-- scripts/cmake/vcpkg_configure_qmake_release.cmake | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index e3dfb0777..3eeb42cb3 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -21,7 +21,7 @@ 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) + 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.") @@ -30,10 +30,12 @@ function(vcpkg_configure_qmake_debug) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/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} + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index cf9eacbd5..60750060b 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,6 +22,7 @@ function(vcpkg_configure_qmake_release) # 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() @@ -29,10 +30,12 @@ function(vcpkg_configure_qmake_release) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + 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} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + 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 ) -- cgit v1.2.3 From b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 07:36:07 -0800 Subject: [vcpkg-build-qmake][vcpkg-configure-qmake] Collapse config-specific versions. --- scripts/cmake/vcpkg_build_qmake.cmake | 76 +++++++++++++++++++---- scripts/cmake/vcpkg_build_qmake_debug.cmake | 30 --------- scripts/cmake/vcpkg_build_qmake_release.cmake | 30 --------- scripts/cmake/vcpkg_common_functions.cmake | 4 -- scripts/cmake/vcpkg_configure_qmake.cmake | 41 +++++++----- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 46 -------------- scripts/cmake/vcpkg_configure_qmake_release.cmake | 46 -------------- 7 files changed, 89 insertions(+), 184 deletions(-) delete mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 693f7841e..194ab8206 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -1,31 +1,81 @@ #.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. +# Build a qmake-based project, previously configured using vcpkg_configure_qmake. # # :: # vcpkg_build_qmake() # -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake) + cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_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}/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( - COMMAND ${JOM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME package-${TARGET_TRIPLET} - ) - message(STATUS "Package ${TARGET_TRIPLET} done") + set(DEBUG_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(RELEASE_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) + + list(APPEND _csc_RELEASE_TARGETS ${_csc_TARGETS}) + list(APPEND _csc_DEBUG_TARGETS ${_csc_TARGETS}) + + if(NOT _csc_BUILD_LOGNAME) + set(_csc_BUILD_LOGNAME build) + endif() + + function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") + vcpkg_execute_required_process( + COMMAND ${JOM} ${TARGETS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} + LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} + ) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} done") + endfunction() + + # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings + set(ENV_CL_BACKUP "$ENV{_CL_}") + set(ENV{_CL_} "/utf-8") + + #First generate the makefiles so we can modify them + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles dbg) + + #Store debug makefiles path + file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) + + foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) + file(READ "${DEBUG_MAKEFILE}" _contents) + string(REPLACE "zlib.lib" "zlibd.lib" _contents "${_contents}") + string(REPLACE "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") + file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_DEBUG_TARGETS}" ${_csc_BUILD_LOGNAME} dbg) + + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles rel) + + #Store release makefile path + file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) + + foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_RELEASE_TARGETS}" ${_csc_BUILD_LOGNAME} rel) # Restore the original value of ENV{PATH} set(ENV{PATH} "${ENV_PATH_BACKUP}") + set(ENV{_CL_} "${ENV_CL_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake deleted file mode 100644 index a734e63cf..000000000 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.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 deleted file mode 100644 index 3daf9201b..000000000 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.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 258b8f64a..27dd0732d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,15 +10,11 @@ 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.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 @@ -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 diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake deleted file mode 100644 index 3eeb42cb3..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.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 -# [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}/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) - - configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/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}-rel/qt.conf" - 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 deleted file mode 100644 index 60750060b..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.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 -# [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) - - 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} 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}-rel done") - unset(QMAKE_COMMAND) - unset(QMAKE_COMMAND PARENT_SCOPE) - unset(QMAKE_COMMAND CACHE) -endfunction() \ No newline at end of file -- cgit v1.2.3