aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-12-23 06:10:12 -0800
committerGitHub <noreply@github.com>2019-12-23 06:10:12 -0800
commitc0d22c88ea7638d1b74339f9e9adfd37b0f525ed (patch)
tree2475474c4825663531b1e60490d350a85c68a1a5 /scripts
parent5e88eec627c2e007624f69f34acdaabafa239a0f (diff)
downloadvcpkg-c0d22c88ea7638d1b74339f9e9adfd37b0f525ed.tar.gz
vcpkg-c0d22c88ea7638d1b74339f9e9adfd37b0f525ed.zip
[vcpkg_install_qmake] Add vcpkg_install_qmake (#9412)
* [vcpkg_install_qmake] Add vcpkg_install_qmake and convert existing ports to use it. [vcpkg_configure_qmake] Add 'staticlib' to CONFIG in static builds * [vcpkg_configure_qmake] Don't specify DESTDIR * [libqglviewer][vcpkg_configure_qmake] Add staticlib CONFIG only for libqglviewer * [qt5-base] Increment version to track changes in vcpkg_configure_qmake()
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ci.baseline.txt2
-rw-r--r--scripts/cmake/vcpkg_common_functions.cmake1
-rw-r--r--scripts/cmake/vcpkg_configure_qmake.cmake16
-rw-r--r--scripts/cmake/vcpkg_install_qmake.cmake64
4 files changed, 73 insertions, 10 deletions
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index c39b453ad..c53c3e314 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -599,8 +599,6 @@ hypre:x64-osx=fail
icu:arm64-windows=fail
icu:arm-uwp=fail
icu:x64-uwp=fail
-ignition-math4:x64-uwp=fail
-ignition-math4:x64-windows-static=fail
ignition-msgs1:arm64-windows=fail
ignition-msgs1:arm-uwp=fail
ignition-msgs1:x64-uwp=fail
diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake
index 4aa115f47..564ac9421 100644
--- a/scripts/cmake/vcpkg_common_functions.cmake
+++ b/scripts/cmake/vcpkg_common_functions.cmake
@@ -26,6 +26,7 @@ include(vcpkg_install_meson)
include(vcpkg_install_msbuild)
include(vcpkg_install_make)
include(vcpkg_install_nmake)
+include(vcpkg_install_qmake)
include(vcpkg_configure_cmake)
include(vcpkg_configure_meson)
include(vcpkg_configure_qmake)
diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake
index a04a4c8f6..ad5682a3d 100644
--- a/scripts/cmake/vcpkg_configure_qmake.cmake
+++ b/scripts/cmake/vcpkg_configure_qmake.cmake
@@ -26,7 +26,7 @@ function(vcpkg_configure_qmake)
message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.")
endif()
- if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND _csc_OPTIONS "CONFIG-=shared")
list(APPEND _csc_OPTIONS "CONFIG*=static")
else()
@@ -35,10 +35,10 @@ function(vcpkg_configure_qmake)
list(APPEND _csc_OPTIONS_DEBUG "CONFIG*=separate_debug_info")
endif()
- if(VCPKG_TARGET_IS_WINDOWS AND ${VCPKG_CRT_LINKAGE} STREQUAL "static")
+ if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static")
list(APPEND _csc_OPTIONS "CONFIG*=static-runtime")
endif()
-
+
# Cleanup build directories
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
@@ -55,9 +55,9 @@ function(vcpkg_configure_qmake)
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_RELEASE})
endif()
vcpkg_execute_required_process(
- COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release
- ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH}
- -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf"
+ COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release
+ ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH}
+ -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf"
${BUILD_OPT}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME config-${TARGET_TRIPLET}-rel
@@ -74,8 +74,8 @@ function(vcpkg_configure_qmake)
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_DEBUG})
endif()
vcpkg_execute_required_process(
- COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug
- ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH}
+ COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug
+ ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH}
-qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf"
${BUILD_OPT}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
diff --git a/scripts/cmake/vcpkg_install_qmake.cmake b/scripts/cmake/vcpkg_install_qmake.cmake
new file mode 100644
index 000000000..571b55a68
--- /dev/null
+++ b/scripts/cmake/vcpkg_install_qmake.cmake
@@ -0,0 +1,64 @@
+## # vcpkg_install_qmake
+##
+## Build and install a qmake project.
+##
+## ## Usage:
+## ```cmake
+## vcpkg_install_qmake(...)
+## ```
+##
+## ## Parameters:
+## See [`vcpkg_build_qmake()`](vcpkg_build_qmake.md).
+##
+## ## Notes:
+## This command transparently forwards to [`vcpkg_build_qmake()`](vcpkg_build_qmake.md).
+##
+## Additionally, this command will copy produced .libs/.dlls/.as/.dylibs/.sos to the appropriate
+## staging directories.
+##
+## ## Examples
+##
+## * [libqglviewer](https://github.com/Microsoft/vcpkg/blob/master/ports/libqglviewer/portfile.cmake)
+
+function(vcpkg_install_qmake)
+ vcpkg_build_qmake(${ARGN})
+ file(GLOB_RECURSE RELEASE_LIBS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.a
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so.*
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dylib
+ )
+ file(GLOB_RECURSE RELEASE_BINS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll
+ )
+ file(GLOB_RECURSE DEBUG_LIBS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.a
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so.*
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dylib
+ )
+ file(GLOB_RECURSE DEBUG_BINS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll
+ )
+ if(NOT RELEASE_LIBS AND NOT DEBUG_LIBS)
+ message(FATAL_ERROR "Build did not appear to produce any libraries. If this is intended, use `vcpkg_build_qmake()` directly.")
+ endif()
+ if(RELEASE_LIBS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib)
+ file(COPY ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+ endif()
+ if(DEBUG_LIBS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib)
+ file(COPY ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+ endif()
+ if(RELEASE_BINS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
+ file(COPY ${RELEASE_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+ endif()
+ if(DEBUG_BINS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(COPY ${DEBUG_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+ endif()
+endfunction()