Qt CMake and iPhone simulator



  • Hello,
    I've been trying to develop a simple test app with Qt/QML and using CMake as my build tool (instead of qmake).
    When I use CMake to build and run the app for the MacOS environment everything works fine. When I use the same code to build using qmake the app works perfectly under MacOS and iPhone simulator.

    So currently I am stuck. Below is my CMakelists.txt:

    cmake_minimum_required(VERSION 3.1)
    
    project(TestFirebase1 LANGUAGES CXX)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    set(CMAKE_MACOSX_BUNDLE ON)
    
    #iPhone simulator settings
    set(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk)
    #set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_BIT))
    
    
    #set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
    #========================
    
    find_package(Qt5 COMPONENTS Core Quick REQUIRED)
    
    set(project_headers
        backend.h)
    
    set(project_sources
        main.cpp
        backend.cpp)
    
    add_executable(${PROJECT_NAME} ${project_headers} ${project_sources} "qml.qrc")
    target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
    target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick)
    set_target_properties(${PROJECT_NAME} PROPERTIES
        MACOSX_BUNDLE_BUNDLE_NAME $(PROJECT_NAME))
    

    The code compiles under Xcode. But when it tries to run it produces a "The bundle identifier of the application could not be determined." error.

    Is there something that I need to add? Is there a simple Qt + CMake + iPhone simulator example that I can follow?

    Thank you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.