diff options
45 files changed, 723 insertions, 95 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5550c2f..057b8fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,6 +186,29 @@ build:linux-x86_64-package: variables: RSYNC_DESTINATION: dev +build:linux-aarch64-package: + extends: + - .linux_package_aarch64 + - .cmake_build_linux_package + - .cmake_release_artifacts + - .linux_builder_tags_aarch64 + - .run_only_for_package + dependencies: + - prep:doc-package + needs: + - prep:doc-package + +.upload:linux-aarch64-package: + extends: + - .rsync_upload + - .run_only_for_package + dependencies: + - build:linux-aarch64-package + needs: + - build:linux-aarch64-package + variables: + RSYNC_DESTINATION: dev + # macOS builds build:macos-ninja: @@ -261,6 +284,18 @@ build:macos-package: variables: RSYNC_DESTINATION: dev +build:macos10.10-package: + extends: + - .macos10.10_package + - .cmake_build_macos_package + - .cmake_release_artifacts + - .macos_builder_tags_package + - .run_only_for_package + dependencies: + - prep:doc-package + needs: + - prep:doc-package + # Windows builds build:windows-vs2019-x64-ninja: diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index 589b16c..87828e1 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -74,7 +74,8 @@ paths: # Any packages made. - build/cmake-*-Linux-x86_64.* - - build/cmake-*-macos-universal.* + - build/cmake-*-Linux-aarch64.* + - build/cmake-*-macos*-universal.* # Any source packages made. - build/cmake-*.tar.gz - build/cmake-*.zip diff --git a/.gitlab/ci/configure_macos10.10_package.cmake b/.gitlab/ci/configure_macos10.10_package.cmake new file mode 100644 index 0000000..f01e6c8 --- /dev/null +++ b/.gitlab/ci/configure_macos10.10_package.cmake @@ -0,0 +1,4 @@ +set(CPACK_SYSTEM_NAME "macos10.10-universal" CACHE STRING "") +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake") diff --git a/.gitlab/ci/configure_macos_package.cmake b/.gitlab/ci/configure_macos_package.cmake index a1dbdb9..380e44c 100644 --- a/.gitlab/ci/configure_macos_package.cmake +++ b/.gitlab/ci/configure_macos_package.cmake @@ -1,28 +1,4 @@ -set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "") - -# Set up install destinations as expected by the packaging scripts. -set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "") -set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "") - -# Settings for CMake packages for macOS. -set(CPACK_DMG_FORMAT "UDBZ" CACHE STRING "") -set(CMAKE_CXX_FLAGS "-stdlib=libc++" CACHE STRING "") -set(CMAKE_C_STANDARD "11" CACHE STRING "") -set(CMAKE_CXX_STANDARD "14" CACHE STRING "") -set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "") -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "") -set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "") set(CPACK_SYSTEM_NAME "macos-universal" CACHE STRING "") -set(BUILD_CursesDialog "ON" CACHE BOOL "") -set(BUILD_QtDialog "TRUE" CACHE BOOL "") -set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "") -set(CMake_INSTALL_DEPENDENCIES "ON" CACHE BOOL "") -set(CMAKE_SKIP_RPATH "TRUE" CACHE BOOL "") -set(CMake_TEST_NO_FindPackageModeMakefileTest "TRUE" CACHE BOOL "") - -# XXX(sccache): restore sccache when it works for multiple architectures: -# https://github.com/mozilla/sccache/issues/847 -set(configure_no_sccache 1) +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake") diff --git a/.gitlab/ci/configure_macos_package_common.cmake b/.gitlab/ci/configure_macos_package_common.cmake new file mode 100644 index 0000000..3aa8ae2 --- /dev/null +++ b/.gitlab/ci/configure_macos_package_common.cmake @@ -0,0 +1,26 @@ +set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "") + +# Set up install destinations as expected by the packaging scripts. +set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "") +set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "") + +# Settings for CMake packages for macOS. +set(CPACK_DMG_FORMAT "UDBZ" CACHE STRING "") +set(CMAKE_CXX_FLAGS "-stdlib=libc++" CACHE STRING "") +set(CMAKE_C_STANDARD "11" CACHE STRING "") +set(CMAKE_CXX_STANDARD "14" CACHE STRING "") +set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "") +set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "") +set(BUILD_CursesDialog "ON" CACHE BOOL "") +set(BUILD_QtDialog "TRUE" CACHE BOOL "") +set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "") +set(CMake_INSTALL_DEPENDENCIES "ON" CACHE BOOL "") +set(CMAKE_SKIP_RPATH "TRUE" CACHE BOOL "") +set(CMake_TEST_NO_FindPackageModeMakefileTest "TRUE" CACHE BOOL "") + +# XXX(sccache): restore sccache when it works for multiple architectures: +# https://github.com/mozilla/sccache/issues/847 +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake index 4a33f12..76c693d 100644 --- a/.gitlab/ci/download_qt.cmake +++ b/.gitlab/ci/download_qt.cmake @@ -48,7 +48,11 @@ if (qt_platform STREQUAL "windows_x86") set(qt_subdir "${qt_version}/msvc${msvc_year}_64") elseif (qt_platform STREQUAL "mac_x64") - if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "package") + if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_package") + list(APPEND qt_files + "qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz") + set(qt_subdir "qt-5.15.2-macosx10.13-x86_64-arm64") + elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos10.10_package") list(APPEND qt_files "qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz") set(qt_subdir "qt-5.9.9-macosx10.10-x86_64-arm64") diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake index 832fa98..afbc081 100644 --- a/.gitlab/ci/download_qt_hashes.cmake +++ b/.gitlab/ci/download_qt_hashes.cmake @@ -11,3 +11,4 @@ set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Window set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1) set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1) +set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b) diff --git a/.gitlab/ci/sccache.sh b/.gitlab/ci/sccache.sh index af24710..77bedaa 100755 --- a/.gitlab/ci/sccache.sh +++ b/.gitlab/ci/sccache.sh @@ -2,21 +2,30 @@ set -e -case "$( uname -s )" in - Linux) +readonly kernel="$(uname -s)-$(uname -m)" +case $kernel in + Linux-x86_64) version="0.2.13" shatool="sha256sum" sha256sum="28a5499e340865b08b632306b435913beb590fbd7b49a3f887a623b459fabdeb" platform="x86_64-unknown-linux-musl" ;; - Darwin) + Linux-aarch64) + version="g6628e1f" + shatool="sha256sum" + sha256sum="bb88adbb5a29c166ecaa78d0593493b609a7f84d91d1228502a908f319b513f0" + platform="aarch64-unknown-linux-musl" + url="https://github.com/hwinit/sccache/releases/download/$version" + ;; + Darwin-x86_64) version="gfe63078" shatool="shasum -a 256" sha256sum="60a0302b1d7227f7ef56abd82266353f570d27c6e850c56c6448bf62def38888" platform="x86_64-apple-darwin" + url="https://paraview.org/files/dependencies" ;; *) - echo "Unrecognized platform $( uname -s )" + echo "Unrecognized platform $kernel" exit 1 ;; esac @@ -28,9 +37,7 @@ readonly platform readonly filename="sccache-$version-$platform" readonly tarball="$filename.tar.gz" -if [ "$( uname -s )" = "Darwin" ]; then - url="https://paraview.org/files/dependencies" -else +if [ -z "$url" ]; then url="https://github.com/mozilla/sccache/releases/download/$version" fi readonly url diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index c69302a..bfd164b 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -17,18 +17,21 @@ variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" -.linux_package: +.linux_package_x86_64: + image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157" + variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" LAUNCHER: "scl enable devtoolset-6 rh-python36 --" + CMAKE_ARCH: x86_64 -.linux_package_x86_64: - extends: .linux_package - - image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157" +.linux_package_aarch64: + image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af" variables: - CMAKE_ARCH: x86_64 + GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" + LAUNCHER: "scl enable devtoolset-7 --" + CMAKE_ARCH: aarch64 ### Debian @@ -160,6 +163,13 @@ - docker - linux +.linux_builder_tags_aarch64: + tags: + - cmake + - build + - docker + - linux-aarch64 + ## Linux-specific scripts .before_script_linux: &before_script_linux diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 8a006b1..450bae7 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -7,7 +7,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID" # TODO: Factor this out so that each job selects the Xcode version to # use so that different versions can be tested in a single pipeline. - DEVELOPER_DIR: "/Applications/Xcode-12.2.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode-12.3.app/Contents/Developer" # Avoid conflicting with other projects running on the same machine. SCCACHE_SERVER_PORT: 4227 @@ -47,6 +47,14 @@ CTEST_NO_WARNINGS_ALLOWED: 1 CMake_SKIP_INSTALL: 1 +.macos10.10_package: + extends: .macos_build + + variables: + CMAKE_CONFIGURATION: macos10.10_package + CTEST_NO_WARNINGS_ALLOWED: 1 + CMake_SKIP_INSTALL: 1 + ### External testing .macos_xcode: @@ -63,7 +71,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos - shell - - xcode-12.2 + - xcode-12.3 - nonconcurrent .macos_builder_tags_package: @@ -71,7 +79,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos - shell - - xcode-12.2 + - xcode-12.3 - nonconcurrent - finder @@ -80,7 +88,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos - shell - - xcode-12.2 + - xcode-12.3 - concurrent ## macOS-specific scripts diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml index 6bfa763..8b8daa1 100644 --- a/.gitlab/upload.yml +++ b/.gitlab/upload.yml @@ -15,4 +15,4 @@ - dnf install -y --setopt=install_weak_deps=False rsync openssh-clients - chmod 400 $RSYNC_BINARY_KEY - ssh-keygen -y -f $RSYNC_BINARY_KEY > $RSYNC_BINARY_KEY.pub - - rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@public.kitware.com:$RSYNC_DESTINATION/ + - rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@cmake.org:$RSYNC_DESTINATION/ diff --git a/Help/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE.rst b/Help/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE.rst index 2a79bca..836cc6b 100644 --- a/Help/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE.rst +++ b/Help/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE.rst @@ -31,6 +31,7 @@ Possible values are: * ``KNOWN_LOCATION`` The "Link Binary With Libraries" build phase will be used to link to another target under the same conditions as with ``BUILT_ONLY`` and also: + - Imported library targets except those of type ``UNKNOWN``. - Any non-target library specified directly with a path. diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst index 60a8ecc..7ad27c8 100644 --- a/Help/release/3.19.rst +++ b/Help/release/3.19.rst @@ -385,3 +385,18 @@ Changes made since CMake 3.19.0 include the following. * The :variable:`CMAKE_ISPC_HEADER_SUFFIX` variable and corresponding :prop_tgt:`ISPC_HEADER_SUFFIX` target property were added to control the header suffix used by ``ISPC`` compiler generated headers. + +3.19.3 +------ + +* A precompiled Linux ``aarch64`` binary is now provided on ``cmake.org``. + +* Two precompiled macOS binaries are now provided on ``cmake.org``: + + * The naming pattern ``cmake-$ver-macos-universal`` is a universal + binary with ``x86_64`` and ``arm64`` architectures. It requires + macOS 10.13 or newer. + + * The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal + binary with ``x86_64`` and ``arm64`` architectures. It requires + macOS 10.10 or newer. diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index 40cc362..c81b371 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -1053,7 +1053,14 @@ function(FetchContent_Populate contentName) # so no population is required. The build directory may still be specified # by the declared details though. - if(NOT EXISTS "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}") + if(NOT IS_ABSOLUTE "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}") + # Don't check this directory because we don't know what location it is + # expected to be relative to. We can't make this a hard error for backward + # compatibility reasons. + message(WARNING "Relative source directory specified. This is not safe, " + "as it depends on the calling directory scope.\n" + " FETCHCONTENT_SOURCE_DIR_${contentNameUpper} --> ${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}") + elseif(NOT EXISTS "${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}") message(FATAL_ERROR "Manually specified source directory is missing:\n" " FETCHCONTENT_SOURCE_DIR_${contentNameUpper} --> ${FETCHCONTENT_SOURCE_DIR_${contentNameUpper}}") endif() diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 0c1e93b..25f5a1f 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -991,10 +991,10 @@ if (HDF5_FOUND) add_library(HDF5::HDF5 INTERFACE IMPORTED) string(REPLACE "-D" "" _hdf5_definitions "${HDF5_DEFINITIONS}") set_target_properties(HDF5::HDF5 PROPERTIES - INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}" INTERFACE_COMPILE_DEFINITIONS "${_hdf5_definitions}") unset(_hdf5_definitions) + target_link_libraries(HDF5::HDF5 INTERFACE ${HDF5_LIBRARIES}) endif () foreach (hdf5_lang IN LISTS HDF5_LANGUAGE_BINDINGS) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index b531e47..789a72e 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -646,6 +646,7 @@ function (_MPI_interrogate_compiler LANG) foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) string(REGEX REPLACE "^ ?${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + string(REPLACE "'" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") endforeach() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 799b2fc..0f9f8e8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 19) -set(CMake_VERSION_PATCH 2) +set(CMake_VERSION_PATCH 3) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 452a303..0f0c39a 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -57,6 +57,9 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) endmacro() if(APPLE) install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + if(TARGET Qt5::QMacStylePlugin) + install_qt5_plugin("Qt5::QMacStylePlugin" QT_PLUGINS) + endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "[Paths]\nPlugins = ${_qt_plugin_dir}\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" @@ -129,6 +132,7 @@ qt5_wrap_cpp(MOC_SRCS WarningMessagesDialog.h ) qt5_add_resources(RC_SRCS CMakeSetup.qrc) +add_library(CMakeGUIQRCLib OBJECT ${RC_SRCS}) if (FALSE) # CMake's bootstrap binary does not support automoc set(CMAKE_AUTOMOC 1) @@ -137,8 +141,7 @@ if (FALSE) # CMake's bootstrap binary does not support automoc else () list(APPEND SRCS ${UI_SRCS} - ${MOC_SRCS} - ${RC_SRCS}) + ${MOC_SRCS}) endif () if(USE_LGPL) @@ -161,6 +164,7 @@ target_link_libraries(CMakeGUIMainLib PUBLIC CMakeGUILib) add_executable(cmake-gui WIN32 MACOSX_BUNDLE CMakeGUIExec.cxx ${MANIFEST_FILE}) target_link_libraries(cmake-gui CMakeGUIMainLib Qt5::Core) +target_sources(CMakeGUIMainLib INTERFACE $<TARGET_OBJECTS:CMakeGUIQRCLib>) if(WIN32) target_sources(CMakeGUIMainLib INTERFACE $<TARGET_OBJECTS:CMakeVersion> CMakeSetup.rc) endif() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7ee94b2..df45b35 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -18,6 +18,7 @@ #include "cmsys/RegularExpression.hxx" #include "cmComputeLinkInformation.h" +#include "cmCryptoHash.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmCustomCommandLines.h" @@ -797,9 +798,10 @@ void cmGlobalXCodeGenerator::addObject(std::unique_ptr<cmXCodeObject> obj) } cmXCodeObject* cmGlobalXCodeGenerator::CreateObject( - cmXCodeObject::PBXType ptype) + cmXCodeObject::PBXType ptype, cm::string_view key) { - auto obj = cm::make_unique<cmXCode21Object>(ptype, cmXCodeObject::OBJECT); + auto obj = cm::make_unique<cmXCode21Object>(ptype, cmXCodeObject::OBJECT, + this->GetObjectId(ptype, key)); auto ptr = obj.get(); this->addObject(std::move(obj)); return ptr; @@ -807,7 +809,9 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateObject( cmXCodeObject* cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type) { - auto obj = cm::make_unique<cmXCodeObject>(cmXCodeObject::None, type); + auto obj = cm::make_unique<cmXCodeObject>( + cmXCodeObject::None, type, + "Temporary cmake object, should not be referred to in Xcode file"); auto ptr = obj.get(); this->addObject(std::move(obj)); return ptr; @@ -1725,13 +1729,13 @@ void cmGlobalXCodeGenerator::CreateCustomCommands( if (this->XcodeBuildSystem >= BuildSystem::Twelve) { // create prebuild phase preBuildPhase = - this->CreateRunScriptBuildPhase("CMake PreBuild Rules", prebuild); + this->CreateRunScriptBuildPhase("CMake PreBuild Rules", gtgt, prebuild); // create prelink phase preLinkPhase = - this->CreateRunScriptBuildPhase("CMake PreLink Rules", prelink); + this->CreateRunScriptBuildPhase("CMake PreLink Rules", gtgt, prelink); // create postbuild phase - postBuildPhase = - this->CreateRunScriptBuildPhase("CMake PostBuild Rules", postbuild); + postBuildPhase = this->CreateRunScriptBuildPhase("CMake PostBuild Rules", + gtgt, postbuild); } else { std::vector<cmSourceFile*> classes; if (!gtgt->GetConfigCommonSourceFiles(classes)) { @@ -1859,7 +1863,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase( } cmXCodeObject* buildPhase = - this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase); + this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase, + cmStrCat(gt->GetName(), ':', sf->GetFullPath())); buildPhase->AddAttribute("buildActionMask", this->CreateString("2147483647")); cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -1918,7 +1923,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase( } cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase( - std::string const& name, std::vector<cmCustomCommand> const& commands) + std::string const& name, cmGeneratorTarget const* gt, + std::vector<cmCustomCommand> const& commands) { if (commands.empty()) { return nullptr; @@ -1941,7 +1947,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase( } cmXCodeObject* buildPhase = - this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase); + this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase, + cmStrCat(gt->GetName(), ':', name)); buildPhase->AddAttribute("buildActionMask", this->CreateString("2147483647")); cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -2909,8 +2916,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget( cmGeneratorTarget* gtgt) { - cmXCodeObject* shellBuildPhase = - this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase); + cmXCodeObject* shellBuildPhase = this->CreateObject( + cmXCodeObject::PBXShellScriptBuildPhase, gtgt->GetName()); shellBuildPhase->AddAttribute("buildActionMask", this->CreateString("2147483647")); cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -3138,6 +3145,32 @@ cmXCodeObject* cmGlobalXCodeGenerator::FindXCodeTarget( return i->second; } +std::string cmGlobalXCodeGenerator::GetObjectId(cmXCodeObject::PBXType ptype, + cm::string_view key) +{ + std::string objectId; + if (!key.empty()) { + cmCryptoHash hash(cmCryptoHash::AlgoSHA256); + hash.Initialize(); + hash.Append(&ptype, sizeof(ptype)); + hash.Append(key); + objectId = cmSystemTools::UpperCase(hash.FinalizeHex().substr(0, 24)); + } else { + char cUuid[40] = { 0 }; + CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); + CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, uuid); + CFStringGetCString(s, cUuid, sizeof(cUuid), kCFStringEncodingUTF8); + objectId = cUuid; + CFRelease(s); + CFRelease(uuid); + cmSystemTools::ReplaceString(objectId, "-", ""); + if (objectId.size() > 24) { + objectId = objectId.substr(0, 24); + } + } + return objectId; +} + std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, const std::string& id) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index ab5eeb2..8ff6846 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -11,6 +11,8 @@ #include <string> #include <vector> +#include <cm/string_view> + #include "cmGlobalGenerator.h" #include "cmXCodeObject.h" @@ -162,11 +164,13 @@ private: const std::string& configName); cmXCodeObject* FindXCodeTarget(const cmGeneratorTarget*); + std::string GetObjectId(cmXCodeObject::PBXType ptype, cm::string_view key); std::string GetOrCreateId(const std::string& name, const std::string& id); // create cmXCodeObject from these functions so that memory can be managed // correctly. All objects created are stored in this->XCodeObjects. - cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype); + cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype, + cm::string_view key = {}); cmXCodeObject* CreateObject(cmXCodeObject::Type type); cmXCodeObject* CreateString(const std::string& s); cmXCodeObject* CreateObjectReference(cmXCodeObject*); @@ -250,7 +254,8 @@ private: cmGeneratorTarget const* gt, cmCustomCommand const& cc); cmXCodeObject* CreateRunScriptBuildPhase( - std::string const& name, std::vector<cmCustomCommand> const& commands); + std::string const& name, cmGeneratorTarget const* gt, + std::vector<cmCustomCommand> const& commands); std::string ConstructScript(cmCustomCommandGenerator const& ccg); void CreateReRunCMakeFile(cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0e4f888..3946841 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -308,7 +308,7 @@ void cmMakefile::PrintCommandTrace( args.reserve(lff.Arguments().size()); for (cmListFileArgument const& arg : lff.Arguments()) { - if (expand) { + if (expand && arg.Delim != cmListFileArgument::Bracket) { temp = arg.Value; this->ExpandVariablesInString(temp); args.push_back(temp); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 97440d2..6a705f4 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -952,9 +952,8 @@ bool cmMoveFile(std::wstring const& oldname, std::wstring const& newname) SetLastError(0); // Use MOVEFILE_REPLACE_EXISTING to replace an existing destination file. - // Use MOVEFILE_WRITE_THROUGH to flush the change to disk before returning. return MoveFileExW(oldname.c_str(), newname.c_str(), - MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH); + MOVEFILE_REPLACE_EXISTING); } } #endif diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index 1cf9a95..9b0dc58 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -4,11 +4,12 @@ #include <ostream> #include <string> +#include <utility> #include "cmSystemTools.h" -cmXCode21Object::cmXCode21Object(PBXType ptype, Type type) - : cmXCodeObject(ptype, type) +cmXCode21Object::cmXCode21Object(PBXType ptype, Type type, std::string id) + : cmXCodeObject(ptype, type, std::move(id)) { this->Version = 21; } diff --git a/Source/cmXCode21Object.h b/Source/cmXCode21Object.h index eb017447..f3fc438 100644 --- a/Source/cmXCode21Object.h +++ b/Source/cmXCode21Object.h @@ -13,7 +13,7 @@ class cmXCode21Object : public cmXCodeObject { public: - cmXCode21Object(PBXType ptype, Type type); + cmXCode21Object(PBXType ptype, Type type, std::string id); void PrintComment(std::ostream&) override; static void PrintList(std::vector<std::unique_ptr<cmXCodeObject>> const&, std::ostream& out, PBXType t); diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index b301ab1..d5c5275 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -40,7 +40,7 @@ cmXCodeObject::~cmXCodeObject() this->Version = 15; } -cmXCodeObject::cmXCodeObject(PBXType ptype, Type type) +cmXCodeObject::cmXCodeObject(PBXType ptype, Type type, std::string id) { this->Version = 15; this->Target = nullptr; @@ -48,27 +48,7 @@ cmXCodeObject::cmXCodeObject(PBXType ptype, Type type) this->IsA = ptype; - if (type == OBJECT) { - // Set the Id of an Xcode object to a unique string for each instance. - // However the Xcode user file references certain Ids: for those cases, - // override the generated Id using SetId(). - // - char cUuid[40] = { 0 }; - CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); - CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, uuid); - CFStringGetCString(s, cUuid, sizeof(cUuid), kCFStringEncodingUTF8); - this->Id = cUuid; - CFRelease(s); - CFRelease(uuid); - } else { - this->Id = - "Temporary cmake object, should not be referred to in Xcode file"; - } - - cmSystemTools::ReplaceString(this->Id, "-", ""); - if (this->Id.size() > 24) { - this->Id = this->Id.substr(0, 24); - } + this->Id = std::move(id); this->TypeValue = type; if (this->TypeValue == OBJECT) { diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index 78d4727..ac5be3f 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -57,7 +57,7 @@ public: }; static const char* PBXTypeNames[]; virtual ~cmXCodeObject(); - cmXCodeObject(PBXType ptype, Type type); + cmXCodeObject(PBXType ptype, Type type, std::string id); Type GetType() const { return this->TypeValue; } PBXType GetIsA() const { return this->IsA; } diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt index 1db00cc..9eed1c0 100644 --- a/Tests/ConfigSources/CMakeLists.txt +++ b/Tests/ConfigSources/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE) endif() project(ConfigSources CXX) diff --git a/Tests/RunCMake/BuildDepends/RepeatCMake-Custom-Script.cmake b/Tests/RunCMake/BuildDepends/RepeatCMake-Custom-Script.cmake new file mode 100644 index 0000000..3e953b3 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/RepeatCMake-Custom-Script.cmake @@ -0,0 +1,4 @@ +if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/exists-for-build2") + message(FATAL_ERROR "Custom command incorrectly re-ran after CMake re-ran!") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/out.txt") diff --git a/Tests/RunCMake/BuildDepends/RepeatCMake-Custom.cmake b/Tests/RunCMake/BuildDepends/RepeatCMake-Custom.cmake new file mode 100644 index 0000000..697e485 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/RepeatCMake-Custom.cmake @@ -0,0 +1,5 @@ +add_custom_command(OUTPUT out.txt + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/RepeatCMake-Custom-Script.cmake + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/RepeatCMake-Custom-Script.cmake + ) +add_custom_target(drive ALL DEPENDS out.txt) diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 7a68c4b..6c6d548 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -70,6 +70,23 @@ if(RunCMake_GENERATOR MATCHES "Make") endif() endif() +function(run_RepeatCMake CASE) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${CASE}-build) + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug) + else() + set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) + endif() + run_cmake(${CASE}) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${CASE}-build1 ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(${CASE}-rerun1 ${CMAKE_COMMAND} .) + file(WRITE ${RunCMake_TEST_BINARY_DIR}/exists-for-build2 "") + run_cmake_command(${CASE}-build2 ${CMAKE_COMMAND} --build . --config Debug) +endfunction() + +run_RepeatCMake(RepeatCMake-Custom) + function(run_ReGeneration) # test re-generation of project even if CMakeLists.txt files disappeared diff --git a/Tests/RunCMake/CommandLine/trace-expand.cmake b/Tests/RunCMake/CommandLine/trace-expand.cmake index e69de29..24da02a 100644 --- a/Tests/RunCMake/CommandLine/trace-expand.cmake +++ b/Tests/RunCMake/CommandLine/trace-expand.cmake @@ -0,0 +1 @@ +set(a [[\B]]) diff --git a/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative-stderr.txt b/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative-stderr.txt new file mode 100644 index 0000000..3defcb4 --- /dev/null +++ b/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative-stderr.txt @@ -0,0 +1,3 @@ + *Relative source directory specified. This is not safe, as it depends on + *the calling directory scope. ++ *FETCHCONTENT_SOURCE_DIR_WITHPROJECT --> WithProject diff --git a/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative.cmake b/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative.cmake new file mode 100644 index 0000000..d8b42ba --- /dev/null +++ b/Tests/RunCMake/FetchContent/ManualSourceDirectoryRelative.cmake @@ -0,0 +1 @@ +include(ManualSourceDirectory.cmake) diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake index 3eb331f..9baeab7 100644 --- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake +++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake @@ -21,6 +21,11 @@ run_cmake_with_options(ManualSourceDirectory run_cmake_with_options(ManualSourceDirectoryMissing -D "FETCHCONTENT_SOURCE_DIR_WITHPROJECT=${CMAKE_CURRENT_LIST_DIR}/ADirThatDoesNotExist" ) +# Need to use :STRING to prevent CMake from automatically converting it to an +# absolute path +run_cmake_with_options(ManualSourceDirectoryRelative + -D "FETCHCONTENT_SOURCE_DIR_WITHPROJECT:STRING=WithProject" +) function(run_FetchContent_DirOverrides) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DirOverrides-build) diff --git a/Utilities/Release/linux/aarch64/Dockerfile b/Utilities/Release/linux/aarch64/Dockerfile new file mode 100644 index 0000000..4077b79 --- /dev/null +++ b/Utilities/Release/linux/aarch64/Dockerfile @@ -0,0 +1,35 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Produce an image containing a portable CMake binary package for Linux/aarch64. +# Build using the CMake source directory as the build context. +# The resulting image will have an '/out' directory containing the package. + +# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image. +ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-deps-2020-12-21 +ARG FROM_IMAGE_DIGEST=@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af +ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST +FROM $FROM_IMAGE + +COPY . /opt/cmake/src/cmake + +ARG TEST=true + +RUN : \ + && mkdir -p /opt/cmake/src/cmake-build \ + && cd /opt/cmake/src/cmake-build \ + && cp ../cmake/Utilities/Release/linux/aarch64/cache.txt CMakeCache.txt \ + && source /opt/rh/devtoolset-7/enable \ + && set -x \ + && ../cmake/bootstrap --parallel=$(nproc) --docdir=doc/cmake \ + && nice make -j $(nproc) \ + && if $TEST; then \ + # Run tests that require the full build tree. + bin/ctest --output-on-failure -j 8 -R '^(CMake\.|CMakeLib\.|CMakeServerLib\.|RunCMake\.ctest_memcheck)'; \ + fi \ + && bin/cpack -G TGZ \ + && bin/cpack -G STGZ \ + && set +x \ + && mkdir /out \ + && mv cmake-*-Linux-aarch64.* /out \ + && : diff --git a/Utilities/Release/linux/aarch64/base/Dockerfile b/Utilities/Release/linux/aarch64/base/Dockerfile new file mode 100644 index 0000000..b9c683e --- /dev/null +++ b/Utilities/Release/linux/aarch64/base/Dockerfile @@ -0,0 +1,31 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Produce a base image with a build environment for portable CMake binaries. +# Build using the directory containing this file as its own build context. + +ARG FROM_IMAGE_NAME=centos:7 +ARG FROM_IMAGE_DIGEST=@sha256:43964203bf5d7fe38c6fca6166ac89e4c095e2b0c0a28f6c7c678a1348ddc7fa +ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST +FROM $FROM_IMAGE + +RUN : \ + && yum install -y centos-release-scl \ + && yum install -y \ + ca-certificates \ + curl \ + devtoolset-7-gcc \ + devtoolset-7-gcc-c++ \ + fontconfig-devel \ + freetype-devel \ + git \ + libX11-devel \ + libxcb-devel \ + make \ + patch \ + perl \ + python3-pip \ + xz \ + which \ + && yum clean all \ + && : diff --git a/Utilities/Release/linux/aarch64/cache.txt b/Utilities/Release/linux/aarch64/cache.txt new file mode 100644 index 0000000..89050d1 --- /dev/null +++ b/Utilities/Release/linux/aarch64/cache.txt @@ -0,0 +1,44 @@ +CMAKE_BUILD_TYPE:STRING=Release + +CMAKE_C_STANDARD:STRING=11 +CMAKE_CXX_STANDARD:STRING=14 + +# Require only older APIs where possible. +CMAKE_C_FLAGS:STRING=-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1 + +# Link C++ library statically. +CMAKE_EXE_LINKER_FLAGS:STRING=-static-libstdc++ -static-libgcc + +# Enable ssl support in curl +CMAKE_USE_OPENSSL:BOOL=ON +OPENSSL_CRYPTO_LIBRARY:STRING=/opt/openssl/lib/libcrypto.a;-pthread +OPENSSL_INCLUDE_DIR:PATH=/opt/openssl/include +OPENSSL_SSL_LIBRARY:FILEPATH=/opt/openssl/lib/libssl.a + +# Enable ccmake +BUILD_CursesDialog:BOOL=ON +CURSES_FORM_LIBRARY:FILEPATH=/opt/ncurses/lib/libform.a +CURSES_INCLUDE_PATH:PATH=/opt/ncurses/include +CURSES_NCURSES_LIBRARY:FILEPATH=/opt/ncurses/lib/libncurses.a + +# Enable cmake-gui with static qt plugins +BUILD_QtDialog:BOOL=TRUE +CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3 +CMAKE_PREFIX_PATH:STRING=/opt/qt +CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES:STRING=/opt/qt/plugins/platforms/libqxcb.a;/opt/qt/lib/libQt5XcbQpa.a;/opt/qt/lib/libQt5ServiceSupport.a;/opt/qt/lib/libQt5EdidSupport.a;/opt/qt/lib/libQt5EventDispatcherSupport.a;/opt/qt/lib/libQt5FontDatabaseSupport.a;/opt/qt/lib/libQt5ThemeSupport.a;/opt/qt/lib/libxcb-static.a;-lxcb;-lfontconfig;-lfreetype + +# Build documentation. +SPHINX_EXECUTABLE:FILEPATH=/usr/local/bin/sphinx-build +SPHINX_HTML:BOOL=ON +SPHINX_MAN:BOOL=ON +SPHINX_QTHELP:BOOL=ON +QCOLLECTIONGENERATOR_EXECUTABLE:PATH=/opt/qt/bin/qhelpgenerator + +# We bootstrap as part of the build so skip its test. +CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE + +# Skip Qt5 tests because our Qt is static. +CMake_TEST_Qt5:BOOL=FALSE + +# CPack package file name component for this platform. +CPACK_SYSTEM_NAME:STRING=Linux-aarch64 diff --git a/Utilities/Release/linux/aarch64/deps/Dockerfile b/Utilities/Release/linux/aarch64/deps/Dockerfile new file mode 100644 index 0000000..8d0f6fd --- /dev/null +++ b/Utilities/Release/linux/aarch64/deps/Dockerfile @@ -0,0 +1,141 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Produce an image with custom-built dependencies for portable CMake binaries. +# Build using the directory containing this file as its own build context. + +ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-base-2020-12-21 +ARG FROM_IMAGE_DIGEST=@sha256:c8d9fa279ef09c26e74ff28770ae0db1f4cb75ef53b782ace604daba71a41f65 +ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST +FROM $FROM_IMAGE + +# Sphinx +RUN : \ + && pip3 install sphinx==2.1.2 \ + && : + +# Qt +# Version 5.12.0 was the last to bundle xkbcommon. +COPY qt-install.patch /opt/qt/src/ +RUN : \ + && mkdir -p /opt/qt/src/qt-build \ + && cd /opt/qt/src \ + && curl -OL https://download.qt.io/archive/qt/5.12/5.12.0/single/qt-everywhere-src-5.12.0.tar.xz \ + && sha512sum qt-everywhere-src-5.12.0.tar.xz | grep -q 0dd03d2645fb6dac5b58c8caf92b4a0a6900131f1ccfb02443a0df4702b5da0458f4c45e758d1b929ec709b0f4b36900df2fd60a058af9cc8c1a0748b6d57aae \ + && tar xJf qt-everywhere-src-5.12.0.tar.xz \ + && cd qt-build \ + && source /opt/rh/devtoolset-7/enable \ + && ../qt-everywhere-src-5.12.0/configure \ + -prefix /opt/qt \ + -static \ + -release \ + -c++std c++11 \ + -opensource -confirm-license \ + -gui \ + -widgets \ + -xcb \ + -fontconfig \ + -sql-sqlite \ + -qt-doubleconversion \ + -qt-libjpeg \ + -qt-libpng \ + -qt-pcre \ + -qt-sqlite \ + -qt-xcb \ + -qt-xkbcommon \ + -qt-zlib \ + -system-freetype \ + -no-accessibility \ + -no-compile-examples \ + -no-cups \ + -no-dbus \ + -no-directfb \ + -no-egl \ + -no-eglfs \ + -no-evdev \ + -no-gbm \ + -no-gif \ + -no-glib \ + -no-gtk \ + -no-harfbuzz \ + -no-iconv \ + -no-icu \ + -no-journald \ + -no-kms \ + -no-libinput \ + -no-libproxy \ + -no-linuxfb \ + -no-ltcg \ + -no-mirclient \ + -no-mtdev \ + -no-opengl \ + -no-openssl \ + -no-pch \ + -no-sql-mysql \ + -no-sql-psql \ + -no-sql-sqlite2 \ + -no-syslog \ + -no-system-proxies \ + -no-tslib \ + -no-use-gold-linker \ + -skip declarative \ + -skip multimedia \ + -skip qtcanvas3d \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtsensors \ + -skip qtserialport \ + -skip qtsvg \ + -skip qtwayland \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -skip qtwinextras \ + -skip qtxmlpatterns \ + -nomake examples \ + -nomake tests \ + && make install -j $(nproc) \ + && cd /opt/qt \ + && patch -p1 -i src/qt-install.patch \ + && cd /opt \ + && rm -rf /opt/qt/src \ + && : + +# Curses +RUN : \ + && mkdir -p /opt/ncurses/src/ncurses-build \ + && cd /opt/ncurses/src \ + && curl -O https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz \ + && sha512sum ncurses-6.1.tar.gz | grep -q e308af43f8b7e01e98a55f4f6c4ee4d1c39ce09d95399fa555b3f0cdf5fd0db0f4c4d820b4af78a63f6cf6d8627587114a40af48cfc066134b600520808a77ee \ + && tar xzf ncurses-6.1.tar.gz \ + && cd ncurses-build \ + && source /opt/rh/devtoolset-7/enable \ + && ../ncurses-6.1/configure \ + --prefix=/opt/ncurses \ + --with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo \ + --with-default-terminfo-dir=/usr/share/terminfo \ + --without-shared \ + && make -j $(nproc) \ + && make install.libs install.includes \ + && cd /opt \ + && rm -rf /opt/ncurses/src \ + && : + +# OpenSSL +COPY openssl-source.patch /opt/openssl/src/ +RUN : \ + && mkdir -p /opt/openssl/src \ + && cd /opt/openssl/src \ + && curl -O https://www.openssl.org/source/openssl-1.1.1f.tar.gz \ + && sha512sum openssl-1.1.1f.tar.gz | grep -q b00bd9b5ad5298fbceeec6bb19c1ab0c106ca5cfb31178497c58bf7e0e0cf30fcc19c20f84e23af31cc126bf2447d3e4f8461db97bafa7bd78f69561932f000c \ + && tar xzf openssl-1.1.1f.tar.gz \ + && cd openssl-1.1.1f \ + && patch -p1 -i ../openssl-source.patch \ + && source /opt/rh/devtoolset-7/enable \ + && ./Configure --prefix=/opt/openssl linux-elf no-asm no-shared -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1 \ + && make install_dev -j $(nproc) \ + && cd /opt \ + && rm -rf /opt/openssl/src \ + && : diff --git a/Utilities/Release/linux/aarch64/deps/openssl-source.patch b/Utilities/Release/linux/aarch64/deps/openssl-source.patch new file mode 100644 index 0000000..c81fe2f --- /dev/null +++ b/Utilities/Release/linux/aarch64/deps/openssl-source.patch @@ -0,0 +1,12 @@ +# enable pthread APIs disabled by our _POSIX_SOURCE definitions +--- openssl-source/crypto/threads_pthread.c.orig ++++ openssl-source/crypto/threads_pthread.c +@@ -6,6 +6,8 @@ + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ ++#undef _POSIX_C_SOURCE ++#undef _POSIX_SOURCE + + #include <openssl/crypto.h> + #include "internal/cryptlib.h" diff --git a/Utilities/Release/linux/aarch64/deps/qt-install.patch b/Utilities/Release/linux/aarch64/deps/qt-install.patch new file mode 100644 index 0000000..792aefd --- /dev/null +++ b/Utilities/Release/linux/aarch64/deps/qt-install.patch @@ -0,0 +1,24 @@ +# Add Qt Core dependencies missing from static Qt build. +--- qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake.orig ++++ qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake +@@ -111,7 +111,7 @@ + list(REMOVE_DUPLICATES Qt5Core_COMPILE_DEFINITIONS) + list(REMOVE_DUPLICATES Qt5Core_EXECUTABLE_COMPILE_FLAGS) + +- set(_Qt5Core_LIB_DEPENDENCIES "") ++ set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/libqtpcre2.a") + + + add_library(Qt5::Core STATIC IMPORTED) +# Add Qt Gui dependencies missing from static Qt build. +--- qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake.orig ++++ qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake +@@ -111,7 +111,7 @@ + list(REMOVE_DUPLICATES Qt5Gui_COMPILE_DEFINITIONS) + list(REMOVE_DUPLICATES Qt5Gui_EXECUTABLE_COMPILE_FLAGS) + +- set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core") ++ set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core;${_qt5Gui_install_prefix}/lib/libqtlibpng.a") + + + add_library(Qt5::Gui STATIC IMPORTED) diff --git a/Utilities/Release/linux/aarch64/test/Dockerfile b/Utilities/Release/linux/aarch64/test/Dockerfile new file mode 100644 index 0000000..03674fb --- /dev/null +++ b/Utilities/Release/linux/aarch64/test/Dockerfile @@ -0,0 +1,26 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Produce a base image with a test environment for packaged CMake binaries. +# Build using the directory containing this file as its own build context. + +ARG FROM_IMAGE_NAME=debian:10 +ARG FROM_IMAGE_DIGEST=@sha256:ab0ba5b78bfe01d61ac4f9919cd0e7bef8beefa0a77d3d710bfc8630d96804b8 +ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST +FROM $FROM_IMAGE + +RUN : \ + && apt-get update \ + && apt-get install -y \ + dpkg \ + file \ + gcc \ + g++ \ + gfortran \ + qt5-default \ + make \ + ninja-build \ + && apt-get clean \ + && : + +COPY test-make.bash test-ninja.bash / diff --git a/Utilities/Release/linux/aarch64/test/test-make.bash b/Utilities/Release/linux/aarch64/test/test-make.bash new file mode 100644 index 0000000..10d30c3 --- /dev/null +++ b/Utilities/Release/linux/aarch64/test/test-make.bash @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +set -e +set -x +mkdir -p /opt/cmake/src/cmake-make +cd /opt/cmake/src/cmake-make +echo >CMakeCache.txt ' +CMake_TEST_IPO_WORKS_C:BOOL=ON +CMake_TEST_IPO_WORKS_CXX:BOOL=ON +CMake_TEST_IPO_WORKS_Fortran:BOOL=ON +CMake_TEST_NO_NETWORK:BOOL=ON +CMake_TEST_Qt5:BOOL=ON +' +cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Unix Makefiles" +make -j $(nproc) +ctest --output-on-failure -j $(nproc) diff --git a/Utilities/Release/linux/aarch64/test/test-ninja.bash b/Utilities/Release/linux/aarch64/test/test-ninja.bash new file mode 100644 index 0000000..fe39e2e --- /dev/null +++ b/Utilities/Release/linux/aarch64/test/test-ninja.bash @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +set -e +set -x +mkdir -p /opt/cmake/src/cmake-ninja +cd /opt/cmake/src/cmake-ninja +echo >CMakeCache.txt ' +CMAKE_Fortran_COMPILER:STRING= +CMake_TEST_IPO_WORKS_C:BOOL=ON +CMake_TEST_IPO_WORKS_CXX:BOOL=ON +CMake_TEST_NO_NETWORK:BOOL=ON +CMake_TEST_Qt5:BOOL=ON +' +cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Ninja" +ninja +ctest --output-on-failure -j $(nproc) diff --git a/Utilities/Release/macos/qt-5.15.2-macosx10.13-x86_64-arm64.bash b/Utilities/Release/macos/qt-5.15.2-macosx10.13-x86_64-arm64.bash new file mode 100755 index 0000000..bf92e62 --- /dev/null +++ b/Utilities/Release/macos/qt-5.15.2-macosx10.13-x86_64-arm64.bash @@ -0,0 +1,125 @@ +#!/usr/bin/env bash + +# Run this script on a macOS x86_64 host to generate Qt universal binaries. +# +# This script requires the 'makeuniversal' tool from: +# +# https://github.com/fizzyade/makeuniversal +# +# Build it with an existing local Qt installation first. +# +# Set the PATH environment variable to contain the location of 'makeuniversal'. + +set -e +set -x + +umask 022 + +# Verify that 'makeuniversal' is available in the PATH. +type -p makeuniversal >/dev/null + +# Download, verify, and extract sources. +curl -OL https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz +shasum -a 256 qt-everywhere-src-5.15.2.tar.xz | grep -q 3a530d1b243b5dec00bc54937455471aaa3e56849d2593edb8ded07228202240 +tar xjf qt-everywhere-src-5.15.2.tar.xz + +# Build the x86_64 variant. +mkdir qt-5.15.2-x86_64 +cd qt-5.15.2-x86_64 +../qt-everywhere-src-5.15.2/configure \ + --prefix=/ \ + -platform macx-clang \ + -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \ + -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \ + -release \ + -opensource -confirm-license \ + -gui \ + -widgets \ + -no-gif \ + -no-icu \ + -no-pch \ + -no-angle \ + -no-opengl \ + -no-dbus \ + -no-harfbuzz \ + -skip declarative \ + -skip multimedia \ + -skip qtcanvas3d \ + -skip qtcharts \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtgamepad \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtnetworkauth \ + -skip qtpurchasing \ + -skip qtremoteobjects \ + -skip qtscript \ + -skip qtsensors \ + -skip qtserialbus \ + -skip qtserialport \ + -skip qtsvg \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -skip qtxmlpatterns \ + -nomake examples \ + -nomake tests \ + -nomake tools +make -j 8 +cd .. + +# Build the arm64 variant. +mkdir qt-5.15.2-arm64 +cd qt-5.15.2-arm64 +../qt-everywhere-src-5.15.2/configure \ + --prefix=/ \ + -platform macx-clang \ + -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \ + -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 \ + -release \ + -opensource -confirm-license \ + -gui \ + -widgets \ + -no-gif \ + -no-icu \ + -no-pch \ + -no-angle \ + -no-opengl \ + -no-dbus \ + -no-harfbuzz \ + -skip declarative \ + -skip multimedia \ + -skip qtcanvas3d \ + -skip qtcharts \ + -skip qtconnectivity \ + -skip qtdeclarative \ + -skip qtgamepad \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtnetworkauth \ + -skip qtpurchasing \ + -skip qtremoteobjects \ + -skip qtscript \ + -skip qtsensors \ + -skip qtserialbus \ + -skip qtserialport \ + -skip qtsvg \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -skip qtxmlpatterns \ + -nomake examples \ + -nomake tests \ + -nomake tools +make -j 8 -k +cd .. + +# Combine the two builds into universal binaries. +makeuniversal qt-5.15.2-univ qt-5.15.2-x86_64 qt-5.15.2-arm64 +cd qt-5.15.2-univ +make install -j 8 INSTALL_ROOT=/tmp/qt-5.15.2-macosx10.13-x86_64-arm64 +cd .. + +# Create the final tarball containing universal binaries. +tar cjf qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz -C /tmp qt-5.15.2-macosx10.13-x86_64-arm64 diff --git a/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash b/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash index a61e114..79931ec 100755 --- a/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash +++ b/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash @@ -13,6 +13,8 @@ set -e set -x +umask 022 + # Verify that 'makeuniversal' is available in the PATH. type -p makeuniversal >/dev/null |