2016-10-25 09:39:50 +08:00
|
|
|
include(${CMAKE_TRIPLET_FILE})
|
2016-10-24 23:06:27 +08:00
|
|
|
include(vcpkg_common_functions)
|
2016-12-21 09:36:34 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.1)
|
2016-10-24 23:06:27 +08:00
|
|
|
set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
|
|
|
|
set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase)
|
|
|
|
set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}")
|
|
|
|
|
|
|
|
find_program(NMAKE nmake)
|
|
|
|
vcpkg_find_acquire_program(JOM)
|
2016-11-02 07:19:05 +08:00
|
|
|
vcpkg_find_acquire_program(PERL)
|
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
|
|
|
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
|
2016-10-24 23:06:27 +08:00
|
|
|
get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY)
|
2017-02-23 19:34:21 +08:00
|
|
|
set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${CURRENT_INSTALLED_DIR}/bin;$ENV{PATH};${PERL_EXE_PATH}")
|
2016-11-16 11:44:53 +08:00
|
|
|
set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
|
|
|
|
set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}")
|
2016-10-24 23:06:27 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2016-12-21 09:36:34 +08:00
|
|
|
URLS "http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.7z"
|
|
|
|
FILENAME "qt-5.7.1.7z"
|
|
|
|
SHA512 3ffcf490a1c0107a05113aebbf70015c50d05fbb35439273c243133ddb146d51aacae15ecd6411d563cc8cfe103df896394c365a69bc48fc86c3bce6a1af3107
|
2016-10-24 23:06:27 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
2016-12-21 09:36:34 +08:00
|
|
|
if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1)
|
|
|
|
file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.1)
|
2016-10-24 23:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
2017-02-23 19:34:21 +08:00
|
|
|
if(EXISTS ${OUTPUT_PATH})
|
|
|
|
file(REMOVE_RECURSE ${OUTPUT_PATH})
|
|
|
|
if(EXISTS ${OUTPUT_PATH})
|
|
|
|
message(FATAL_ERROR "Could not clean output directory.")
|
|
|
|
endif()
|
|
|
|
endif()
|
2016-10-24 23:06:27 +08:00
|
|
|
file(MAKE_DIRECTORY ${OUTPUT_PATH})
|
2016-10-25 13:14:21 +08:00
|
|
|
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static)
|
|
|
|
list(APPEND QT_RUNTIME_LINKAGE "-static")
|
|
|
|
list(APPEND QT_RUNTIME_LINKAGE "-static-runtime")
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch"
|
2017-01-07 06:04:20 +08:00
|
|
|
QUIET
|
2016-10-25 13:14:21 +08:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch"
|
2017-01-07 06:04:20 +08:00
|
|
|
QUIET
|
2016-10-25 13:14:21 +08:00
|
|
|
)
|
|
|
|
endif()
|
2016-10-25 09:39:50 +08:00
|
|
|
|
2016-10-25 17:56:02 +08:00
|
|
|
message(STATUS "Configuring ${TARGET_TRIPLET}")
|
2016-10-24 23:06:27 +08:00
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND "${SOURCE_PATH}/configure.bat"
|
2016-10-25 17:56:02 +08:00
|
|
|
-confirm-license -opensource -platform win32-msvc2015
|
2016-10-25 09:39:50 +08:00
|
|
|
-debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE}
|
2016-11-16 11:44:53 +08:00
|
|
|
-qt-zlib
|
2017-02-23 19:34:21 +08:00
|
|
|
-no-libjpeg
|
2016-12-24 22:26:58 +08:00
|
|
|
-no-libpng
|
|
|
|
-no-freetype
|
2016-12-29 17:59:02 +08:00
|
|
|
-qt-pcre
|
2016-12-24 22:26:58 +08:00
|
|
|
-no-harfbuzz
|
2017-02-23 19:34:21 +08:00
|
|
|
-no-angle
|
|
|
|
-no-inotify
|
|
|
|
-no-mtdev
|
|
|
|
-no-evdev
|
|
|
|
-system-doubleconversion
|
|
|
|
-no-iconv
|
2016-11-16 11:44:53 +08:00
|
|
|
-system-sqlite
|
2017-02-23 19:34:21 +08:00
|
|
|
-no-opengl
|
|
|
|
-no-style-windowsxp
|
|
|
|
-no-style-windowsvista
|
|
|
|
-no-style-fusion
|
|
|
|
-mp
|
2017-02-25 07:57:41 +08:00
|
|
|
-nomake examples -nomake tests -no-compile-examples
|
|
|
|
-skip webengine -skip declarative
|
2016-11-16 11:44:53 +08:00
|
|
|
-qt-sql-sqlite -qt-sql-psql
|
2016-10-30 10:45:09 +08:00
|
|
|
-prefix ${CURRENT_PACKAGES_DIR}
|
|
|
|
-bindir ${CURRENT_PACKAGES_DIR}/bin
|
2017-02-25 07:57:41 +08:00
|
|
|
-hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5
|
2016-10-30 10:45:09 +08:00
|
|
|
-archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5
|
|
|
|
-datadir ${CURRENT_PACKAGES_DIR}/share/qt5
|
2016-11-08 19:16:13 +08:00
|
|
|
-plugindir ${CURRENT_PACKAGES_DIR}/plugins
|
2016-10-24 23:06:27 +08:00
|
|
|
WORKING_DIRECTORY ${OUTPUT_PATH}
|
|
|
|
LOGNAME configure-${TARGET_TRIPLET}
|
|
|
|
)
|
|
|
|
message(STATUS "Configure ${TARGET_TRIPLET} done")
|
|
|
|
|
|
|
|
message(STATUS "Building ${TARGET_TRIPLET}")
|
2017-03-07 09:52:25 +08:00
|
|
|
# Multiple executions are required due to https://bugreports.qt.io/browse/QTBUG-53393
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(COUNT 1)
|
|
|
|
else()
|
|
|
|
set(COUNT 3)
|
|
|
|
endif()
|
|
|
|
vcpkg_execute_required_process_repeat(
|
|
|
|
COUNT ${COUNT}
|
2016-10-24 23:06:27 +08:00
|
|
|
COMMAND ${JOM}
|
|
|
|
WORKING_DIRECTORY ${OUTPUT_PATH}
|
|
|
|
LOGNAME build-${TARGET_TRIPLET}
|
|
|
|
)
|
|
|
|
message(STATUS "Build ${TARGET_TRIPLET} done")
|
|
|
|
|
|
|
|
message(STATUS "Installing ${TARGET_TRIPLET}")
|
|
|
|
vcpkg_execute_required_process(
|
2016-11-16 11:44:53 +08:00
|
|
|
COMMAND ${JOM} -j1 install
|
2016-10-24 23:06:27 +08:00
|
|
|
WORKING_DIRECTORY ${OUTPUT_PATH}
|
|
|
|
LOGNAME install-${TARGET_TRIPLET}
|
|
|
|
)
|
|
|
|
message(STATUS "Install ${TARGET_TRIPLET} done")
|
|
|
|
|
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET}")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
|
|
|
|
2016-10-25 17:56:02 +08:00
|
|
|
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
|
|
|
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
|
|
|
FILES_MATCHING PATTERN "*d.dll"
|
|
|
|
)
|
|
|
|
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
|
|
|
FILES_MATCHING PATTERN "*d.pdb"
|
|
|
|
)
|
|
|
|
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll")
|
|
|
|
file(REMOVE ${DEBUG_BIN_FILES})
|
|
|
|
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb")
|
|
|
|
file(REMOVE ${DEBUG_BIN_FILES})
|
2017-02-23 19:34:21 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll)
|
|
|
|
endif()
|
2016-10-25 17:56:02 +08:00
|
|
|
endif()
|
2016-10-24 23:06:27 +08:00
|
|
|
|
|
|
|
file(INSTALL ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
|
|
|
FILES_MATCHING PATTERN "*d.lib"
|
|
|
|
)
|
|
|
|
file(INSTALL ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
|
|
|
FILES_MATCHING PATTERN "*d.prl"
|
|
|
|
)
|
|
|
|
file(INSTALL ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
|
|
|
FILES_MATCHING PATTERN "*d.pdb"
|
|
|
|
)
|
|
|
|
file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.lib")
|
|
|
|
file(REMOVE ${DEBUG_LIB_FILES})
|
|
|
|
file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.prl")
|
|
|
|
file(REMOVE ${DEBUG_LIB_FILES})
|
|
|
|
file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.pdb")
|
2016-12-22 03:56:51 +08:00
|
|
|
if(DEBUG_LIB_FILES)
|
|
|
|
file(REMOVE ${DEBUG_LIB_FILES})
|
|
|
|
endif()
|
2017-02-23 19:34:21 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib)
|
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl)
|
|
|
|
endif()
|
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})
|
2016-11-08 19:16:13 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins")
|
|
|
|
file(GLOB_RECURSE DEBUG_PLUGINS
|
|
|
|
"${CURRENT_PACKAGES_DIR}/plugins/*d.dll"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/plugins/*d.pdb"
|
|
|
|
)
|
|
|
|
foreach(file ${DEBUG_PLUGINS})
|
|
|
|
get_filename_component(file_n ${file} NAME)
|
|
|
|
file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file})
|
|
|
|
get_filename_component(rel_dir ${file_rel} DIRECTORY)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}")
|
|
|
|
file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}")
|
|
|
|
endforeach()
|
2016-10-24 23:06:27 +08:00
|
|
|
|
2017-02-23 19:34:21 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll)
|
|
|
|
file(RENAME
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll
|
|
|
|
${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.dll)
|
2016-10-25 19:27:51 +08:00
|
|
|
endif()
|
2017-02-23 19:34:21 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb)
|
|
|
|
file(RENAME
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb
|
|
|
|
${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.pdb)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/lib/Qt5Bootstrap.lib AND EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrapd.lib)
|
|
|
|
# QT bug: https://bugreports.qt.io/browse/QTBUG-55499
|
|
|
|
# The release copy of Qt5Bootstrap.lib is not created when using -debug-and-release
|
|
|
|
# Comments from Oswald Buddenhagen indicate this is an internal library, so simply removing the mismatch should be safe.
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrapd.lib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5)
|
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)
|
|
|
|
|
2016-10-24 23:06:27 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2016-11-16 11:44:53 +08:00
|
|
|
|