2016-10-24 23:06:27 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-06-07 02:39:00 +08:00
|
|
|
string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
|
|
|
|
if(BUILDTREES_PATH_LENGTH GREATER 27)
|
|
|
|
message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n"
|
|
|
|
"We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-07-04 10:08:24 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.")
|
|
|
|
endif()
|
|
|
|
|
2017-04-26 21:35:17 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
include(configure_qt)
|
|
|
|
include(install_qt)
|
|
|
|
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.8.0)
|
2016-10-24 23:06:27 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2017-04-26 21:35:17 +08:00
|
|
|
URLS "http://download.qt.io/official_releases/qt/5.8/5.8.0/single/qt-everywhere-opensource-src-5.8.0.7z"
|
|
|
|
FILENAME "qt-5.8.0.7z"
|
|
|
|
SHA512 4c8e7931f0c48318871242c12c2d6f5406be40e037f18690017198a79ef40a72d4319ecb1b8fb5f97c080dbe30174ceb5fd604b3fab22489f977cbeee3e8abe7
|
2016-10-24 23:06:27 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
2017-04-26 21:35:17 +08:00
|
|
|
if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.8.0)
|
|
|
|
file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.8.0 ${CURRENT_BUILDTREES_DIR}/src/qt-5.8.0)
|
2016-10-24 23:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
2017-04-26 21:35:17 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-qalgorithms-vs2017.patch" "${CMAKE_CURRENT_LIST_DIR}/fix-commandline-overrides.patch"
|
|
|
|
)
|
2016-10-25 09:39:50 +08:00
|
|
|
|
2017-05-15 11:04:12 +08:00
|
|
|
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
|
|
|
|
set(ENV{_CL_} "/utf-8")
|
|
|
|
|
2017-04-26 21:35:17 +08:00
|
|
|
configure_qt(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
|
|
|
-confirm-license
|
|
|
|
-opensource
|
|
|
|
-system-zlib
|
|
|
|
-system-libjpeg
|
|
|
|
-system-libpng
|
|
|
|
-system-freetype
|
|
|
|
-system-pcre
|
|
|
|
-system-harfbuzz
|
2017-02-23 19:34:21 +08:00
|
|
|
-system-doubleconversion
|
2016-11-16 11:44:53 +08:00
|
|
|
-system-sqlite
|
2017-04-26 21:35:17 +08:00
|
|
|
-sql-sqlite
|
|
|
|
-sql-psql
|
|
|
|
-nomake examples -nomake tests
|
|
|
|
-skip webengine
|
2017-03-21 06:28:40 +08:00
|
|
|
-opengl desktop # other options are "-no-opengl" and "-opengl angle"
|
2017-02-23 19:34:21 +08:00
|
|
|
-mp
|
2017-04-26 21:35:17 +08:00
|
|
|
LIBJPEG_LIBS="-ljpeg"
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
ZLIB_LIBS="-lzlib"
|
|
|
|
LIBPNG_LIBS="-llibpng16"
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
ZLIB_LIBS="-lzlibd"
|
|
|
|
LIBPNG_LIBS="-llibpng16d"
|
|
|
|
PCRE_LIBS="-lpcre16d"
|
|
|
|
PSQL_LIBS="-llibpqd"
|
|
|
|
FREETYPE_LIBS="-lfreetyped"
|
2016-10-24 23:06:27 +08:00
|
|
|
)
|
2017-04-26 21:35:17 +08:00
|
|
|
install_qt()
|
2016-10-24 23:06:27 +08:00
|
|
|
|
2017-06-05 17:34:31 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/lib/cmake
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/add-private-header-paths.patch"
|
|
|
|
)
|
2016-10-24 23:06:27 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
2017-04-26 21:35:17 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2016-10-24 23:06:27 +08:00
|
|
|
|
|
|
|
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe")
|
2017-02-23 19:34:21 +08:00
|
|
|
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
|
2016-10-30 10:45:09 +08:00
|
|
|
file(REMOVE ${BINARY_TOOLS})
|
2017-04-26 21:35:17 +08:00
|
|
|
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
|
|
|
|
file(REMOVE ${BINARY_TOOLS})
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2016-10-30 10:45:09 +08:00
|
|
|
|
|
|
|
vcpkg_execute_required_process(
|
2016-11-02 07:19:05 +08:00
|
|
|
COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py
|
2016-10-30 10:45:09 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake
|
|
|
|
LOGNAME fix-cmake
|
|
|
|
)
|
|
|
|
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright)
|
2017-03-31 19:27:03 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/plugins)
|
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins)
|
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins)
|
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/plugins)
|
|
|
|
endif()
|