2018-01-18 07:02:56 +08:00
|
|
|
set(_qt5base_port_dir "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
|
2019-03-22 16:08:50 +08:00
|
|
|
function(qt_modular_fetch_library NAME HASH TARGET_SOURCE_PATH)
|
2018-01-18 07:02:56 +08:00
|
|
|
string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
|
[many ports] improvements for linux/wsl (#6730)
* [many ports] improve compatibility with WSL and mixed case filesystems
* [treehopper] express dependency on libusb, which was not working on non-win32 platforms and is still broken there
* [libharu] add compatibility with non-win32 platforms
* [geogram] fix openblas on linux
[clapack] better integration with linux environment
[visit-struct] put cmake config file in the expected folder
[geogram] remove trailing underscore to enable compatibility with OpenBLAS
* [openblas] playing with underscore, without success
* [openblas/lapack] fix library integration
* [clapack] improve target handling in cmake module
* [openblas] promote self-generated config to default cmake module, otherwise internal ones thinks wrongly that openblas can also solve lapack libs
* [clapack,openblas] improve libraries integration
* [many ports] fix cmake unnecessary target paths, wrong config paths, empty default dependencies, unnecessary [core] tags
* [suitesparse] improve integration with new lapack/openblas mechanism
* [suitesparse] add no underscore postfix also for linux
* [ceres] fix integration with newer openblas/lapack configs
* [aws-c-event-stream] fix regression
* [systemc] fix regression
* [libwebp,geogram] trigger rebuild
* [libwebp,pthread4w] fix regressions
* [glbinding] fix cmake module installation
* [globjects] disentangle unnecessary dependency from qt5
* [jasper] remove broken and unnecessary patches
* [libwebp] fix regression
* [many ports] avoid using BUILD_SHARED_LIBS which is uninitialized in port files
* [clapack] correctly find dlls
* [clapack] use a generic blas as dependency
* [fizz,g2o] restore expected version
* fix mistake
* [many ports] remove WIN32, APPLE and UNIX (again, they keep creeping in) from ports since they are broken and usually break non-win32 ports
* [libressl,openssl] do not try to build one if the other is already installed
* [itk] update ref and patch to avoid regression
* [libressl,openssl] implement full strategy to fix CI
* [libwebp] disable components that are broken on macOS
* [ogre] enable macOS build
* [freeimage,jxrlib,ogre,openexr,protobuf] port patches from #5169
* [ogre] add missing install command
* [ffmpeg] enable wrapper for cmake module
* [ffmpeg] add avresample module finder
* [ffmpeg] improve module detection and exported symbols
* [ffmpeg] add variables to cache
* [thrift] remove unnecessary build option
* [allegro5] fix shared/static inversion
* [protobuf] cleanup
* [libressl] cleanup
* [moos-core] cleanup
* commented features must not be separated from other features, otherwise vcpkg complains
* [itk] fix regression
* [shogun,itk] fix regressions
* [ogre] fix regression
* [opusfile] add compatibility with non-win32
* [itk] fix regression
* [sndfile,libsndfile] remove duplicate, redirect sndfile to libsndfile
* add missing dependencies
* [ismrmrd] fix regression
* [ffmpeg] trigger rebuild
* [clapack,openblas,libogg] fix regressions on macOS
* [libtins] fix regression
* force rebuild windows regressions, unable to reproduce locally
* [mosquitto] enable non-win32 builds
* [json-dto] force rebuild, unable to reproduce regression locally
* [many ports] uniform naming and path length requests
* fix regression
* fix regression
* [ffmpeg] fixes for downstream projects
* clean up - thanks to reviewers
* trigger rebuild of regressions on macOS
* trigger rebuild of regressions on macOS - part2
* Add core back
* Use VCPKG_CONCURRENCY
* Add core back to suitesparse
* Add core back to curl
* Add core back to magnum
* Add core back to magnum
* Add core back to magnum
* Add core back to cgal
2019-06-21 10:11:54 +08:00
|
|
|
if(BUILDTREES_PATH_LENGTH GREATER 37 AND CMAKE_HOST_WIN32)
|
|
|
|
message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n"
|
2018-01-18 07:02:56 +08:00
|
|
|
"We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-01-17 06:54:59 +08:00
|
|
|
set(MAJOR_MINOR 5.12)
|
2019-05-09 06:15:26 +08:00
|
|
|
set(FULL_VERSION ${MAJOR_MINOR}.3)
|
2018-10-23 01:49:16 +08:00
|
|
|
set(ARCHIVE_NAME "${NAME}-everywhere-src-${FULL_VERSION}.tar.xz")
|
2018-01-18 07:02:56 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2018-10-23 01:49:16 +08:00
|
|
|
URLS "http://download.qt.io/official_releases/qt/${MAJOR_MINOR}/${FULL_VERSION}/submodules/${ARCHIVE_NAME}"
|
|
|
|
FILENAME ${ARCHIVE_NAME}
|
2018-01-18 07:02:56 +08:00
|
|
|
SHA512 ${HASH}
|
|
|
|
)
|
2018-10-23 01:49:16 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE_FILE}"
|
|
|
|
REF ${FULL_VERSION}
|
|
|
|
)
|
2018-01-18 07:02:56 +08:00
|
|
|
|
2019-03-22 16:08:50 +08:00
|
|
|
set(${TARGET_SOURCE_PATH} ${SOURCE_PATH} PARENT_SCOPE)
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(qt_modular_build_library SOURCE_PATH)
|
2018-01-18 07:02:56 +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")
|
|
|
|
|
|
|
|
#Store build paths
|
2019-05-01 00:29:41 +08:00
|
|
|
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
|
|
|
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
2018-01-18 07:02:56 +08:00
|
|
|
|
|
|
|
#Find Python and add it to the path
|
|
|
|
vcpkg_find_acquire_program(PYTHON2)
|
|
|
|
get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY)
|
2019-06-20 03:04:53 +08:00
|
|
|
vcpkg_add_to_path("${PYTHON2_EXE_PATH}")
|
2018-01-18 07:02:56 +08:00
|
|
|
|
|
|
|
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
|
|
|
|
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
|
2018-01-18 23:36:07 +08:00
|
|
|
|
2019-03-14 21:33:48 +08:00
|
|
|
if(WIN32)
|
|
|
|
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 2 -1 INSTALLED_DIR_WITHOUT_DRIVE)
|
|
|
|
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 2 -1 PACKAGES_DIR_WITHOUT_DRIVE)
|
|
|
|
else()
|
|
|
|
set(INSTALLED_DIR_WITHOUT_DRIVE ${NATIVE_INSTALLED_DIR})
|
|
|
|
set(PACKAGES_DIR_WITHOUT_DRIVE ${NATIVE_PACKAGES_DIR})
|
|
|
|
endif()
|
2019-01-17 06:54:59 +08:00
|
|
|
|
2018-01-18 23:36:07 +08:00
|
|
|
#Configure debug+release
|
|
|
|
vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH})
|
2019-07-18 02:39:54 +08:00
|
|
|
#Build debug+release
|
|
|
|
if (CMAKE_HOST_WIN32)
|
|
|
|
vcpkg_build_qmake()
|
|
|
|
else()
|
|
|
|
vcpkg_build_qmake(SKIP_MAKEFILES)
|
|
|
|
endif()
|
2018-01-18 07:02:56 +08:00
|
|
|
|
|
|
|
#Fix the cmake files if they exist
|
|
|
|
if(EXISTS ${RELEASE_DIR}/lib/cmake)
|
|
|
|
vcpkg_execute_required_process(
|
2018-02-22 21:31:28 +08:00
|
|
|
COMMAND ${PYTHON2} ${_qt5base_port_dir}/fixcmake.py ${PORT}
|
2018-01-18 07:02:56 +08:00
|
|
|
WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
|
|
|
|
LOGNAME fix-cmake
|
|
|
|
)
|
|
|
|
endif()
|
2018-01-18 23:36:07 +08:00
|
|
|
|
|
|
|
file(GLOB_RECURSE MAKEFILES ${DEBUG_DIR}/*Makefile* ${RELEASE_DIR}/*Makefile*)
|
|
|
|
|
|
|
|
foreach(MAKEFILE ${MAKEFILES})
|
2018-10-23 01:49:16 +08:00
|
|
|
file(READ "${MAKEFILE}" _contents)
|
|
|
|
#Set the correct install directory to packages
|
|
|
|
string(REPLACE "(INSTALL_ROOT)${INSTALLED_DIR_WITHOUT_DRIVE}" "(INSTALL_ROOT)${PACKAGES_DIR_WITHOUT_DRIVE}" _contents "${_contents}")
|
|
|
|
file(WRITE "${MAKEFILE}" "${_contents}")
|
2018-01-18 07:02:56 +08:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
#Install the module files
|
2018-01-18 23:36:07 +08:00
|
|
|
vcpkg_build_qmake(TARGETS install SKIP_MAKEFILES BUILD_LOGNAME install)
|
2018-01-18 07:02:56 +08:00
|
|
|
|
2019-07-18 02:39:54 +08:00
|
|
|
#Install cmake files
|
2018-01-18 07:02:56 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
|
|
|
endif()
|
2019-07-18 02:39:54 +08:00
|
|
|
#Remove extra cmake files
|
2018-01-18 07:02:56 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
|
|
|
|
endif()
|
|
|
|
|
2018-03-28 22:36:51 +08:00
|
|
|
file(GLOB_RECURSE PRL_FILES "${CURRENT_PACKAGES_DIR}/lib/*.prl" "${CURRENT_PACKAGES_DIR}/debug/lib/*.prl")
|
2019-04-26 05:30:39 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}/lib" CMAKE_RELEASE_LIB_PATH)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib" CMAKE_DEBUG_LIB_PATH)
|
|
|
|
endif()
|
2018-03-28 22:36:51 +08:00
|
|
|
foreach(PRL_FILE IN LISTS PRL_FILES)
|
|
|
|
file(READ "${PRL_FILE}" _contents)
|
|
|
|
string(REPLACE "${CMAKE_RELEASE_LIB_PATH}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}")
|
|
|
|
string(REPLACE "${CMAKE_DEBUG_LIB_PATH}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}")
|
|
|
|
file(WRITE "${PRL_FILE}" "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
2018-01-18 07:02:56 +08:00
|
|
|
file(GLOB RELEASE_LIBS "${CURRENT_PACKAGES_DIR}/lib/*")
|
|
|
|
if(NOT RELEASE_LIBS)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
endif()
|
|
|
|
file(GLOB DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/lib/*")
|
|
|
|
if(NOT DEBUG_FILES)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#Move release and debug dlls to the correct directory
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5)
|
[many ports] improvements for linux/wsl (#6730)
* [many ports] improve compatibility with WSL and mixed case filesystems
* [treehopper] express dependency on libusb, which was not working on non-win32 platforms and is still broken there
* [libharu] add compatibility with non-win32 platforms
* [geogram] fix openblas on linux
[clapack] better integration with linux environment
[visit-struct] put cmake config file in the expected folder
[geogram] remove trailing underscore to enable compatibility with OpenBLAS
* [openblas] playing with underscore, without success
* [openblas/lapack] fix library integration
* [clapack] improve target handling in cmake module
* [openblas] promote self-generated config to default cmake module, otherwise internal ones thinks wrongly that openblas can also solve lapack libs
* [clapack,openblas] improve libraries integration
* [many ports] fix cmake unnecessary target paths, wrong config paths, empty default dependencies, unnecessary [core] tags
* [suitesparse] improve integration with new lapack/openblas mechanism
* [suitesparse] add no underscore postfix also for linux
* [ceres] fix integration with newer openblas/lapack configs
* [aws-c-event-stream] fix regression
* [systemc] fix regression
* [libwebp,geogram] trigger rebuild
* [libwebp,pthread4w] fix regressions
* [glbinding] fix cmake module installation
* [globjects] disentangle unnecessary dependency from qt5
* [jasper] remove broken and unnecessary patches
* [libwebp] fix regression
* [many ports] avoid using BUILD_SHARED_LIBS which is uninitialized in port files
* [clapack] correctly find dlls
* [clapack] use a generic blas as dependency
* [fizz,g2o] restore expected version
* fix mistake
* [many ports] remove WIN32, APPLE and UNIX (again, they keep creeping in) from ports since they are broken and usually break non-win32 ports
* [libressl,openssl] do not try to build one if the other is already installed
* [itk] update ref and patch to avoid regression
* [libressl,openssl] implement full strategy to fix CI
* [libwebp] disable components that are broken on macOS
* [ogre] enable macOS build
* [freeimage,jxrlib,ogre,openexr,protobuf] port patches from #5169
* [ogre] add missing install command
* [ffmpeg] enable wrapper for cmake module
* [ffmpeg] add avresample module finder
* [ffmpeg] improve module detection and exported symbols
* [ffmpeg] add variables to cache
* [thrift] remove unnecessary build option
* [allegro5] fix shared/static inversion
* [protobuf] cleanup
* [libressl] cleanup
* [moos-core] cleanup
* commented features must not be separated from other features, otherwise vcpkg complains
* [itk] fix regression
* [shogun,itk] fix regressions
* [ogre] fix regression
* [opusfile] add compatibility with non-win32
* [itk] fix regression
* [sndfile,libsndfile] remove duplicate, redirect sndfile to libsndfile
* add missing dependencies
* [ismrmrd] fix regression
* [ffmpeg] trigger rebuild
* [clapack,openblas,libogg] fix regressions on macOS
* [libtins] fix regression
* force rebuild windows regressions, unable to reproduce locally
* [mosquitto] enable non-win32 builds
* [json-dto] force rebuild, unable to reproduce regression locally
* [many ports] uniform naming and path length requests
* fix regression
* fix regression
* [ffmpeg] fixes for downstream projects
* clean up - thanks to reviewers
* trigger rebuild of regressions on macOS
* trigger rebuild of regressions on macOS - part2
* Add core back
* Use VCPKG_CONCURRENCY
* Add core back to suitesparse
* Add core back to curl
* Add core back to magnum
* Add core back to magnum
* Add core back to magnum
* Add core back to cgal
2019-06-21 10:11:54 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/qt5 ${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
2019-05-01 00:29:41 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5)
|
2018-01-18 07:02:56 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/${PORT}/*.dll)
|
|
|
|
file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/*.dll)
|
|
|
|
if (RELEASE_DLLS)
|
|
|
|
file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE ${RELEASE_DLLS})
|
|
|
|
#Check if there are any binaries left over; if not - delete the directory
|
|
|
|
file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/${PORT}/*)
|
|
|
|
if(NOT RELEASE_BINS)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(DEBUG_DLLS)
|
|
|
|
file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
|
|
|
|
endif()
|
|
|
|
|
2019-05-01 00:29:41 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include)
|
|
|
|
endif()
|
2018-01-18 07:02:56 +08:00
|
|
|
|
2019-05-01 00:29:41 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
|
|
|
endif()
|
2018-01-18 07:02:56 +08:00
|
|
|
|
|
|
|
#Find the relevant license file and install it
|
|
|
|
if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3")
|
|
|
|
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3")
|
|
|
|
elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3")
|
|
|
|
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3")
|
|
|
|
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3")
|
|
|
|
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3")
|
|
|
|
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3")
|
|
|
|
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3")
|
2018-06-01 01:11:57 +08:00
|
|
|
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT")
|
|
|
|
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT")
|
2018-01-18 07:02:56 +08:00
|
|
|
endif()
|
|
|
|
file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2019-03-22 16:08:50 +08:00
|
|
|
endfunction()
|
2018-01-18 07:02:56 +08:00
|
|
|
|
2019-03-22 16:08:50 +08:00
|
|
|
function(qt_modular_library NAME HASH)
|
|
|
|
qt_modular_fetch_library(${NAME} ${HASH} TARGET_SOURCE_PATH)
|
|
|
|
qt_modular_build_library(${TARGET_SOURCE_PATH})
|
2019-01-17 06:54:59 +08:00
|
|
|
endfunction()
|