Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Qaterial on Mac for IOS #141

Open
MichaelHeiser opened this issue Feb 9, 2023 · 7 comments
Open

Building Qaterial on Mac for IOS #141

MichaelHeiser opened this issue Feb 9, 2023 · 7 comments

Comments

@MichaelHeiser
Copy link

I have a question regarding building the library for Qt 5.15.12 (builds fine for android and windows within QtCreator)
CMake Error at /Applications/Qt/5.15.12/ios/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:91 (message):
Library not found: MobileCoreServices
Call Stack (most recent call first):
/Applications/Qt/5.15.12/ios/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:263 (_qt5_Core_process_prl_file)
/Applications/Qt/5.15.12/ios/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
CMakeLists.txt:96 (find_package)

Can you please give advice? The Components I've created for my App look so great and this would be really amazing to have the planned UI update.

@MichaelHeiser
Copy link
Author

Hello again,

After digging deeper I've found your ios.platform.cmake and included it in my local repository. With this changes and setting the correct cmake options the project configures.
When I now want to build I run into following error:

WriteAuxiliaryFile /Users/TedvG/Documents/Qt/Qaterial/build/Qt_5_15_12_for_iOS/qml/Qaterial/Qaterial.build/Release-iphoneos/QaterialComponents.build/Script-B99CB982058E168055D83A7E.sh (in target 'QaterialComponents' from project 'Qaterial')
    cd /Users/TedvG/Documents/Qt/Qaterial
    write-file /Users/TedvG/Documents/Qt/Qaterial/build/Qt_5_15_12_for_iOS/qml/Qaterial/Qaterial.build/Release-iphoneos/QaterialComponents.build/Script-B99CB982058E168055D83A7E.sh

PhaseScriptExecution Generate\ qml/Qaterial/qrc_Qaterial.o /Users/TedvG/Documents/Qt/Qaterial/build/Qt_5_15_12_for_iOS/qml/Qaterial/Qaterial.build/Release-iphoneos/QaterialComponents.build/Script-B99CB982058E168055D83A7E.sh (in target 'QaterialComponents' from project 'Qaterial')
    cd /Users/TedvG/Documents/Qt/Qaterial
    /bin/sh -c /Users/TedvG/Documents/Qt/Qaterial/build/Qt_5_15_12_for_iOS/qml/Qaterial/Qaterial.build/Release-iphoneos/QaterialComponents.build/Script-B99CB982058E168055D83A7E.sh
Unable to open temporary file /Users/TedvG/Documents/Qt/Qaterial/build/Qt_5_15_12_for_iOS/qml/Qaterial/qrc_Qaterial.o for reading: Unknown error
Command PhaseScriptExecution failed with a nonzero exit code

The file qrc_Qaterial.o is generated but it has a size of 0 bytes. I tried to execute the shell script on my own also with a failure. Please help me :)

@OlivierLDff
Copy link
Owner

You should have a look at https://github.com/OlivierLDff/QaterialGallery as a starting point

@MichaelHeiser
Copy link
Author

When I set the options for cmake exactly as described i get same result. Why rcc generates a 0 byte file? Is there any kind of typo? Should it be qrc_Qaterialtemp.o? This file is generated with 112kb also the Qaterial.qrc is existing.

@MichaelHeiser
Copy link
Author

I have an idea:
In the shell script rcc is called to work with /Users/TedvG/Documents/Qt/Qaterial/build/qml/Qaterial/Qaterial.build/Release/rcc_object_Qaterial.build/Objects-normal/arm64/qrc_Qaterialtmp.o
But this file is not existing in the ../Release/.. folder. It is exisiting in ../Release-iphoneos/.. folder. Where can I change this path to only Release?

@OlivierLDff
Copy link
Owner

You can have a look at https://cmake.org/cmake/help/latest/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY.html but i doubt it's the issue. Have you tried using legacy build system? Using -DCMAKE_XCODE_BUILD_SYSTEM=1?

@MichaelHeiser
Copy link
Author

Renaming the folder containing the files needed by the shell script to '.../Release-iphoneos/..." solved the issue for me. I will try your answer. Seems to be a problem with https://man.archlinux.org/man/cmake-policies.7.en.
I've updated cmake to v3.25.2 but this did not solve the issue. I will try your suggestion.
My current cmake call for configuration is:
cmake -DCMAKE_PREFIX_PATH=$QT_IOS_DIR -DDEPLOYMENT_TARGET=12.0 -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE -G "Xcode" .

@MichaelHeiser
Copy link
Author

Setting the flag did not help. Renaming the folder again helped. The combination of $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) is not properly recognized for Qaterial components qrc handling.
For info:

cmake -DCMAKE_PREFIX_PATH=$QT_IOS_DIR -DDEPLOYMENT_TARGET=12.0 -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE -DCMAKE_XCODE_BUILD_SYSTEM=1 -G "Xcode" ..
-- Enabling ARC support by default. ENABLE_ARC not provided!
-- Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!
-- Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!
-- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Not setting any manual command-line buildflags, since Xcode is selected as generator.
-- Configuring iphoneos build for platform: OS64, architecture(s): arm64
-- Using SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk
-- Autoconf target triple: aarch64-apple-ios
-- Using minimum deployment version: 12.0 (SDK version: 16.2)
-- Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!
-- Using Xcode version: 14.2
-- Using a data_ptr size of: 8
-- Using install_name_tool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool
-- Disabling bitcode support.
-- Enabling ARC support.
-- Hiding symbols (-fvisibility=hidden).
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ------ Qaterial Configuration ------
-- QATERIAL_PROJECT                : Qaterial
-- QATERIAL_TARGET                 : Qaterial
-- QATERIAL_VERSION                : 1.4.6
-- QATERIAL_VERSION_TAG_HEX        : 0x82dbbc6
-- QATERIAL_BUILD_SHARED           : OFF
-- QATERIAL_FOLDER_PREFIX          : Qaterial
-- QATERIAL_ENABLE_PCH             : ON
-- QATERIAL_ENABLE_UNITY_BUILD     : ON
-- QATERIAL_ENABLE_HIGHDPIFIX      : ON
-- QATERIAL_ENABLE_ICONS           : ON
-- QATERIAL_ICONS                  : *.svg
-- QATERIAL_ENABLE_ROBOTO          : ON
-- QATERIAL_ENABLE_ROBOTOMONO      : ON
-- QATERIAL_ENABLE_LATO            : ON
-- QATERIAL_ENABLE_TESTS           : OFF
-- QATERIAL_ENABLE_INSTALL         : ON
-- ------ Qaterial End Configuration ------
-- Fetch Roboto Medium/Regular
-- Download Roboto-Medium.ttf from https://github.com/OlivierLDff/fonts/raw/0cdadf80ac5f29f10a73c29ce1f4f1ca75ffb392/apache/roboto/static/Roboto-Medium.ttf
-- Roboto-Medium.ttf size is 149380 bytes
-- Download Roboto-Regular.ttf from https://github.com/OlivierLDff/fonts/raw/0cdadf80ac5f29f10a73c29ce1f4f1ca75ffb392/apache/roboto/static/Roboto-Regular.ttf
-- Roboto-Regular.ttf size is 149272 bytes
-- Fetch RobotoMono Regular
-- Download RobotoMono-Regular.ttf from https://github.com/OlivierLDff/fonts/raw/0cdadf80ac5f29f10a73c29ce1f4f1ca75ffb392/apache/robotomono/static/RobotoMono-Regular.ttf
-- RobotoMono-Regular.ttf size is 125588 bytes
-- Fetch Lato Regular
-- Download Lato-Regular.ttf from https://github.com/OlivierLDff/fonts/raw/0cdadf80ac5f29f10a73c29ce1f4f1ca75ffb392/ofl/lato//Lato-Regular.ttf
-- Lato-Regular.ttf size is 75136 bytes
-- Generate QaterialFonts.qrc
-- Download MaterialDesignIcons from https://github.com/OlivierLDff/MaterialDesignSvgo
-- Generate QaterialIcons.qrc
-- Generate Qaterial.qrc
-- Download MaterialDesignIcons from https://github.com/OlivierLDff/MaterialDesignSvgo
-- Generate Qaterial/Icons.hpp
--  
-- Versions:
--   Qaterial       : 1.4.6
--   QOlm           : 3.2.0
--   Qt             : 5.15.12
--  
-- Targets:
--   QaterialComponents : cmake --build . --target QaterialComponents --config Release -j8
--   QaterialIcons      : cmake --build . --target QaterialIcons --config Release -j8
--   QaterialFonts      : cmake --build . --target QaterialFonts --config Release -j8
--   Qaterial           : cmake --build . --target Qaterial --config Release -j8
--  
-- Install to "/users/TedvG/Documents/Qt/Qaterial/install/ios/Release":
--   Install            : cmake --install . [--prefix <install-dir>]
--  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/TedvG/Documents/Qt/Qaterial/build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants