From c0d22c88ea7638d1b74339f9e9adfd37b0f525ed Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 23 Dec 2019 06:10:12 -0800 Subject: [PATCH] [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() --- docs/maintainers/portfile-functions.md | 11 ++-- docs/maintainers/vcpkg_build_nmake.md | 4 +- docs/maintainers/vcpkg_common_definitions.md | 12 +++- docs/maintainers/vcpkg_configure_make.md | 2 +- docs/maintainers/vcpkg_download_distfile.md | 2 +- .../vcpkg_extract_source_archive_ex.md | 4 ++ .../maintainers/vcpkg_find_acquire_program.md | 1 + docs/maintainers/vcpkg_install_nmake.md | 5 ++ docs/maintainers/vcpkg_install_qmake.md | 24 +++++++ ports/libqglviewer/CONTROL | 2 +- ports/libqglviewer/destdir.patch | 21 ++++++ ports/libqglviewer/portfile.cmake | 33 ++++------ ports/qcustomplot/CONTROL | 2 +- ports/qcustomplot/portfile.cmake | 32 +--------- ports/qscintilla/CONTROL | 2 +- ports/qscintilla/portfile.cmake | 22 +------ ports/qt5-base/CONTROL | 2 +- ports/qwt/CONTROL | 2 +- ports/qwt/portfile.cmake | 34 ++-------- scripts/ci.baseline.txt | 2 - scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_configure_qmake.cmake | 16 ++--- scripts/cmake/vcpkg_install_qmake.cmake | 64 +++++++++++++++++++ 23 files changed, 173 insertions(+), 127 deletions(-) create mode 100644 docs/maintainers/vcpkg_install_qmake.md create mode 100644 ports/libqglviewer/destdir.patch create mode 100644 scripts/cmake/vcpkg_install_qmake.cmake diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index dac417acf..9ff16fd96 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -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) diff --git a/docs/maintainers/vcpkg_build_nmake.md b/docs/maintainers/vcpkg_build_nmake.md index e5c177b1b..c9f4cc5d9 100644 --- a/docs/maintainers/vcpkg_build_nmake.md +++ b/docs/maintainers/vcpkg_build_nmake.md @@ -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}>] diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md index 3bb922b17..276e04190 100644 --- a/docs/maintainers/vcpkg_common_definitions.md +++ b/docs/maintainers/vcpkg_common_definitions.md @@ -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_ with being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if +VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "${VCPKG_HOST_PATH_SEPARATOR}"; 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 diff --git a/docs/maintainers/vcpkg_configure_make.md b/docs/maintainers/vcpkg_configure_make.md index 73b46bafc..a18621794 100644 --- a/docs/maintainers/vcpkg_configure_make.md +++ b/docs/maintainers/vcpkg_configure_make.md @@ -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 diff --git a/docs/maintainers/vcpkg_download_distfile.md b/docs/maintainers/vcpkg_download_distfile.md index 2e86b8f7c..18bdf9dc7 100644 --- a/docs/maintainers/vcpkg_download_distfile.md +++ b/docs/maintainers/vcpkg_download_distfile.md @@ -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) diff --git a/docs/maintainers/vcpkg_extract_source_archive_ex.md b/docs/maintainers/vcpkg_extract_source_archive_ex.md index 8f525c3ce..90dafb6be 100644 --- a/docs/maintainers/vcpkg_extract_source_archive_ex.md +++ b/docs/maintainers/vcpkg_extract_source_archive_ex.md @@ -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 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. diff --git a/docs/maintainers/vcpkg_find_acquire_program.md b/docs/maintainers/vcpkg_find_acquire_program.md index b868ea418..106bbe4b7 100644 --- a/docs/maintainers/vcpkg_find_acquire_program.md +++ b/docs/maintainers/vcpkg_find_acquire_program.md @@ -20,6 +20,7 @@ The current list of programs includes: - PERL - PYTHON2 - PYTHON3 +- GO - JOM - MESON - NASM diff --git a/docs/maintainers/vcpkg_install_nmake.md b/docs/maintainers/vcpkg_install_nmake.md index 3f397c195..e83b05ff7 100644 --- a/docs/maintainers/vcpkg_install_nmake.md +++ b/docs/maintainers/vcpkg_install_nmake.md @@ -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) diff --git a/docs/maintainers/vcpkg_install_qmake.md b/docs/maintainers/vcpkg_install_qmake.md new file mode 100644 index 000000000..cbf08aa3e --- /dev/null +++ b/docs/maintainers/vcpkg_install_qmake.md @@ -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) diff --git a/ports/libqglviewer/CONTROL b/ports/libqglviewer/CONTROL index 352c7708e..aca80eac2 100644 --- a/ports/libqglviewer/CONTROL +++ b/ports/libqglviewer/CONTROL @@ -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 diff --git a/ports/libqglviewer/destdir.patch b/ports/libqglviewer/destdir.patch new file mode 100644 index 000000000..d1cd4f3cc --- /dev/null +++ b/ports/libqglviewer/destdir.patch @@ -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 + } diff --git a/ports/libqglviewer/portfile.cmake b/ports/libqglviewer/portfile.cmake index 991f50d31..0c46c11c2 100644 --- a/ports/libqglviewer/portfile.cmake +++ b/ports/libqglviewer/portfile.cmake @@ -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) diff --git a/ports/qcustomplot/CONTROL b/ports/qcustomplot/CONTROL index 4b8223844..90eb89b22 100644 --- a/ports/qcustomplot/CONTROL +++ b/ports/qcustomplot/CONTROL @@ -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 diff --git a/ports/qcustomplot/portfile.cmake b/ports/qcustomplot/portfile.cmake index d35c67d01..ba153e79a 100644 --- a/ports/qcustomplot/portfile.cmake +++ b/ports/qcustomplot/portfile.cmake @@ -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 diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index 3e8d82c92..de1622354 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -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) diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index d979f3135..d34d5517c 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -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 diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 59fd6788c..7cd856203 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -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 diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 62235f3c3..639036550 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -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 diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index ca5762d42..dce59e8e5 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -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) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright) 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()