aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-17 00:22:15 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-17 00:22:15 -0800
commit875bb9a6611d51c0cd6b476983e0f220203a603d (patch)
tree8844f9b73204964a6e1cd1ccf4392d25ae57af80 /scripts
parentc4ca996583c61d311bf15c40dbbb261ce5f59047 (diff)
parentb959f70a9969551a132d691fbd12046d5ea0702e (diff)
downloadvcpkg-875bb9a6611d51c0cd6b476983e0f220203a603d.tar.gz
vcpkg-875bb9a6611d51c0cd6b476983e0f220203a603d.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.cmake11
-rw-r--r--scripts/cmake/vcpkg_build_qmake_debug.cmake30
-rw-r--r--scripts/cmake/vcpkg_build_qmake_release.cmake30
-rw-r--r--scripts/cmake/vcpkg_common_functions.cmake5
-rw-r--r--scripts/cmake/vcpkg_configure_qmake_debug.cmake44
-rw-r--r--scripts/cmake/vcpkg_configure_qmake_release.cmake43
-rw-r--r--scripts/cmake/vcpkg_replace_string.cmake14
7 files changed, 171 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 7ef87f2ea..258b8f64a 100644
--- a/scripts/cmake/vcpkg_common_functions.cmake
+++ b/scripts/cmake/vcpkg_common_functions.cmake
@@ -10,14 +10,19 @@ 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)
include(vcpkg_get_program_files_32_bit)
include(vcpkg_get_program_files_platform_bitness)
include(vcpkg_get_windows_sdk)
+include(vcpkg_replace_string) \ No newline at end of file
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
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()