[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()
This commit is contained in:
Robert Schumacher 2019-12-23 06:10:12 -08:00 committed by GitHub
parent 5e88eec627
commit c0d22c88ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 173 additions and 127 deletions

View File

@ -6,14 +6,14 @@
- [vcpkg\_add\_to\_path](vcpkg_add_to_path.md)
- [vcpkg\_apply\_patches](vcpkg_apply_patches.md)
- [vcpkg\_build\_cmake](vcpkg_build_cmake.md)
- [vcpkg\_build\_msbuild](vcpkg_build_msbuild.md)
- [vcpkg\_build\_make](vcpkg_build_make.md)
- [vcpkg\_build\_make](vcpkg_build_make.md)
- [vcpkg\_build\_msbuild](vcpkg_build_msbuild.md)
- [vcpkg\_build\_nmake](vcpkg_build_nmake.md)
- [vcpkg\_check\_features](vcpkg_check_features.md)
- [vcpkg\_check\_linkage](vcpkg_check_linkage.md)
- [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md)
- [vcpkg\_common\_definitions](vcpkg_common_definitions.md)
- [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md)
- [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md)
- [vcpkg\_configure\_make](vcpkg_configure_make.md)
- [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md)
- [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md)
@ -29,8 +29,9 @@
- [vcpkg\_from\_github](vcpkg_from_github.md)
- [vcpkg\_from\_gitlab](vcpkg_from_gitlab.md)
- [vcpkg\_install\_cmake](vcpkg_install_cmake.md)
- [vcpkg\_install\_msbuild](vcpkg_install_msbuild.md)
- [vcpkg\_install\_make](vcpkg_install_make.md)
- [vcpkg\_install\_make](vcpkg_install_make.md)
- [vcpkg\_install\_msbuild](vcpkg_install_msbuild.md)
- [vcpkg\_install\_nmake](vcpkg_install_nmake.md)
- [vcpkg\_install\_qmake](vcpkg_install_qmake.md)
- [vcpkg\_prettify\_command](vcpkg_prettify_command.md)
- [vcpkg\_test\_cmake](vcpkg_test_cmake.md)

View File

@ -7,8 +7,8 @@ Build a msvc makefile project.
vcpkg_build_nmake(
SOURCE_PATH <${SOURCE_PATH}>
[NO_DEBUG]
PROJECT_SUBPATH <${SUBPATH}>
PROJECT_NAME <${MAKEFILE_NAME}>
[PROJECT_SUBPATH <${SUBPATH}>]
[PROJECT_NAME <${MAKEFILE_NAME}>]
[PRERUN_SHELL <${SHELL_PATH}>]
[PRERUN_SHELL_DEBUG <${SHELL_PATH}>]
[PRERUN_SHELL_RELEASE <${SHELL_PATH}>]

View File

@ -5,14 +5,22 @@ File contains helpful variabls for portfiles which are commonly needed or used.
## The following variables are available:
```cmake
VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if <target>
VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "")
VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host
VCPKG_TARGET_EXECUTABLE_SUFFIX executable suffix of the target
VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX)
VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX)
VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX)
VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX)
VCPKG_TARGET_IMPORT_LIBRARY_PREFIX import library prefix for target (same as CMAKE_IMPORT_LIBRARY_PREFIX)
VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX import library suffix for target (same as CMAKE_IMPORT_LIBRARY_SUFFIX)
VCPKG_FIND_LIBRARY_PREFIXES target dependent prefixes used for find_library calls in portfiles
VCPKG_FIND_LIBRARY_SUFFIXES target dependent suffixes used for find_library calls in portfiles
```
CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that
portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports.
CMAKE_STATIC_LIBRARY_(PREFIX|SUFFIX), CMAKE_SHARED_LIBRARY_(PREFIX|SUFFIX) and CMAKE_IMPORT_LIBRARY_(PREFIX|SUFFIX) are defined for the target
Furthermore the variables CMAKE_FIND_LIBRARY_(PREFIXES|SUFFIXES) are also defined for the target so that
portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports.
## Source

View File

@ -1,6 +1,6 @@
# vcpkg_configure_make
Configure `configure` for Debug and Release builds of a project.
Configure configure for Debug and Release builds of a project.
## Usage
```cmake

View File

@ -45,7 +45,7 @@ The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downlo
* [apr](https://github.com/Microsoft/vcpkg/blob/master/ports/apr/portfile.cmake)
* [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake)
* [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
* [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake)
## Source
[scripts/cmake/vcpkg_download_distfile.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_download_distfile.cmake)

View File

@ -5,6 +5,7 @@ Extract an archive into the source directory. Replaces [`vcpkg_extract_source_ar
## Usage
```cmake
vcpkg_extract_source_archive_ex(
SKIP_PATCH_CHECK
OUT_SOURCE_PATH <SOURCE_PATH>
ARCHIVE <${ARCHIVE}>
[REF <1.0.0>]
@ -14,6 +15,9 @@ vcpkg_extract_source_archive_ex(
)
```
## Parameters
### SKIP_PATCH_CHECK
If this option is set the failure to apply a patch is ignored.
### OUT_SOURCE_PATH
Specifies the out-variable that will contain the extracted location.

View File

@ -20,6 +20,7 @@ The current list of programs includes:
- PERL
- PYTHON2
- PYTHON3
- GO
- JOM
- MESON
- NASM

View File

@ -56,5 +56,10 @@ See [`vcpkg_build_nmake()`](vcpkg_build_nmake.md).
## Notes:
This command transparently forwards to [`vcpkg_build_nmake()`](vcpkg_build_nmake.md), adding `ENABLE_INSTALL`
## Examples
* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
## Source
[scripts/cmake/vcpkg_install_nmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_nmake.cmake)

View File

@ -0,0 +1,24 @@
# 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)
## Source
[scripts/cmake/vcpkg_install_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_qmake.cmake)

View File

@ -1,4 +1,4 @@
Source: libqglviewer
Version: 2.7.2
Version: 2.7.2-2
Description: libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers.
Build-Depends: qt5-base

View File

@ -0,0 +1,21 @@
diff --git a/QGLViewer/QGLViewer.pro b/QGLViewer/QGLViewer.pro
index 263a141..51e3359 100644
--- a/QGLViewer/QGLViewer.pro
+++ b/QGLViewer/QGLViewer.pro
@@ -38,7 +38,6 @@ SOURCES = \
HEADERS *= $${QGL_HEADERS}
DISTFILES *= qglviewer-icon.xpm
-DESTDIR = $${PWD}
TRANSLATIONS = qglviewer_fr.ts
@@ -273,7 +272,7 @@ win32 {
QMAKE_CXXFLAGS *= -TP -GR
DEFINES += NOMINMAX
win32-msvc {
- QMAKE_CXXFLAGS *= -EHs -FS
+ QMAKE_CXXFLAGS *= -EHs -FS
} else {
QMAKE_CXXFLAGS *= -EHs
}

View File

@ -1,33 +1,24 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO GillesDebunne/libQGLViewer
REF fee0916f2af3d0993df51956d2e5a51bbaf0c1f0 #v2.7.2
REF fee0916f2af3d0993df51956d2e5a51bbaf0c1f0 #v2.7.2
SHA512 449bf4ccadaf50d4333bd91050e9b50f440a64229391827aaf4a80ade2c3f5fc60501d2baee885cf1214f7e2a8a04615bafe9ac7da9f866ffa4ebe33b9b999d8
HEAD_REF master
PATCHES
use-default-config-on-all-platforms.patch
destdir.patch
)
vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH}/QGLViewer/QGLViewer.pro)
vcpkg_build_qmake()
file(INSTALL ${SOURCE_PATH}/QGLViewer DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
if(CMAKE_HOST_WIN32)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewer2.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewerd2.dll ${SOURCE_PATH}/QGLViewer/QGLViewerd2.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewer2.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewerd2.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
else()
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewer.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${SOURCE_PATH}/QGLViewer/QGLViewerd.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
endif()
elseif(CMAKE_HOST_APPLE)
file(INSTALL ${SOURCE_PATH}/QGLViewer/libQGLViewer.a DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${SOURCE_PATH}/QGLViewer/libQGLViewer.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(OPTIONS CONFIG*=staticlib)
endif()
vcpkg_configure_qmake(
SOURCE_PATH ${SOURCE_PATH}/QGLViewer/QGLViewer.pro
OPTIONS ${OPTIONS}
)
vcpkg_install_qmake()
file(INSTALL ${SOURCE_PATH}/QGLViewer DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libqglviewer RENAME copyright)

View File

@ -1,4 +1,4 @@
Source: qcustomplot
Version: 2.0.1-1
Version: 2.0.1-3
Description: QCustomPlot is a Qt C++ widget for plotting and data visualization.
Build-Depends: qt5-base

View File

@ -24,46 +24,16 @@ vcpkg_configure_qmake(SOURCE_PATH
${SOURCE_PATH}/qcustomplot-sharedlib/sharedlib-compilation/sharedlib-compilation.pro
)
vcpkg_build_qmake(
vcpkg_install_qmake(
RELEASE_TARGETS release-all
DEBUG_TARGETS debug-all
)
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
# Install header file
file(INSTALL ${SOURCE_PATH}/qcustomplot.h
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
# Install module files
macro(_install_module_file source_dir target_dir filename_regex)
file(GLOB _files ${source_dir}/*)
list(FILTER _files INCLUDE REGEX ${filename_regex})
file(INSTALL ${_files} DESTINATION ${target_dir})
endmacro()
_install_module_file(${DEBUG_DIR}/debug
${CURRENT_PACKAGES_DIR}/debug/lib
"qcustomplotd[2]*\.(lib|a)$")
_install_module_file(${RELEASE_DIR}/release
${CURRENT_PACKAGES_DIR}/lib
"qcustomplot[2]*\.(lib|a)$")
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(INSTALL
${DEBUG_DIR}/debug/qcustomplotd2.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(INSTALL
${RELEASE_DIR}/release/qcustomplot2.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
endif()
vcpkg_copy_pdbs()
# Handle copyright

View File

@ -1,5 +1,5 @@
Source: qscintilla
Version: 2.10-9
Version: 2.10-11
Homepage: https://sourceforge.net/projects/pyqt
Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin)
Build-Depends: qt5-base, qt5-macextras (osx), qt5-winextras (windows)

View File

@ -19,10 +19,6 @@ vcpkg_add_to_path(PREPEND ${PYTHON_PATH})
vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin)
vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin)
#Store build paths
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
vcpkg_configure_qmake(
SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5
OPTIONS
@ -32,31 +28,17 @@ vcpkg_configure_qmake(
)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_build_qmake(
vcpkg_install_qmake(
RELEASE_TARGETS release
DEBUG_TARGETS debug
)
else()
vcpkg_build_qmake()
vcpkg_install_qmake()
endif()
file(GLOB HEADER_FILES ${SOURCE_PATH}/Qt4Qt5/Qsci/*)
file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/Qsci)
if(VCPKG_TARGET_IS_WINDOWS)
configure_file(${RELEASE_DIR}/release/qscintilla2_qt5.lib ${CURRENT_PACKAGES_DIR}/lib/qscintilla2.lib COPYONLY)
configure_file(${DEBUG_DIR}/debug/qscintilla2_qt5.lib ${CURRENT_PACKAGES_DIR}/debug/lib/qscintilla2.lib COPYONLY)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(COPY ${RELEASE_DIR}/release/qscintilla2_qt5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(COPY ${DEBUG_DIR}/debug/qscintilla2_qt5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
elseif(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
configure_file(${RELEASE_DIR}/libqscintilla2_qt5.a ${CURRENT_PACKAGES_DIR}/lib/libqscintilla2.a COPYONLY)
configure_file(${DEBUG_DIR}/libqscintilla2_qt5.a ${CURRENT_PACKAGES_DIR}/debug/lib/libqscintilla2.a COPYONLY)
endif()
vcpkg_copy_pdbs()
# Handle copyright

View File

@ -1,5 +1,5 @@
Source: qt5-base
Version: 5.12.5-3
Version: 5.12.5-7
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl

View File

@ -1,5 +1,5 @@
Source: qwt
Version: 6.1.3-8
Version: 6.1.3-10
Homepage: https://sourceforge.net/projects/qwt
Description: Qt widgets library for technical applications
Build-Depends: qt5-base, qt5-svg, qt5-tools

View File

@ -12,52 +12,28 @@ vcpkg_extract_source_archive_ex(
PATCHES fix-dynamic-static.patch
)
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
vcpkg_configure_qmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
CONFIG+=${VCPKG_LIBRARY_LINKAGE}
)
if (CMAKE_HOST_WIN32)
vcpkg_build_qmake(
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_install_qmake(
RELEASE_TARGETS sub-src-release_ordered
DEBUG_TARGETS sub-src-debug_ordered
)
elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
vcpkg_build_qmake(
else ()
vcpkg_install_qmake(
RELEASE_TARGETS sub-src-all-ordered
DEBUG_TARGETS sub-src-all-ordered
)
endif()
#Set the correct install directory to packages
foreach(MAKEFILE ${RELEASE_MAKEFILES} ${DEBUG_MAKEFILES})
vcpkg_replace_string(${MAKEFILE} "(INSTALL_ROOT)${INSTALLED_DIR_WITHOUT_DRIVE}" "(INSTALL_ROOT)${PACKAGES_DIR_WITHOUT_DRIVE}")
endforeach()
#Install the header files
file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h)
file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/qwt)
#Install the module files
if (CMAKE_HOST_WIN32)
file(INSTALL ${RELEASE_DIR}/lib/qwt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${DEBUG_DIR}/lib/qwtd.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(INSTALL ${RELEASE_DIR}/lib/qwt.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${DEBUG_DIR}/lib/qwtd.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
vcpkg_copy_pdbs()
elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
file(INSTALL ${RELEASE_DIR}/lib/libqwt.a DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${DEBUG_DIR}/lib/libqwt.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
endif()
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qwt)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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()