Skip to content

Commit

Permalink
Merge pull request #87 from MisterGC/qt-6-6-ios-support
Browse files Browse the repository at this point in the history
iOS Support (using Qt6.6)
  • Loading branch information
MisterGC authored Jun 15, 2024
2 parents 1d86f84 + dfab2d2 commit 25db85b
Show file tree
Hide file tree
Showing 70 changed files with 1,127 additions and 308 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ Thumbs.db
*.dll
*.exe

build*
100 changes: 55 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,77 @@
# (c) Clayground Contributors - MIT License, see "LICENSE" file

cmake_minimum_required(VERSION 3.19)
project (Clayground VERSION 2023.1)
# ===============
# PROJECT BASICS
# ===============

# CMAKE INCLUDES
set(CLAY_CMAKE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CLAY_CMAKE_SCRIPT_DIR}")
# Initializes global context that Clayground relies on
include("${CMAKE_CURRENT_LIST_DIR}/cmake/clayinit.cmake")

include(claycommon)
include(clayplugin)

# CHECK MIN REQUIRED QT VERSION
set(CLAY_QT_MIN_VERSION "6.6.0")
find_package(Qt6 ${CLAY_QT_MIN_VERSION} QUIET COMPONENTS Core)
if (NOT Qt6_FOUND)
message(FATAL_ERROR
"\n>>>>>>>>>> CLAYGROUND CONFIGURE ERROR!!! <<<<<<<<<<<\n"
"Clayground requires Qt6 ${CLAY_QT_MIN_VERSION} or higher. "
"Please ensure it is installed and used for configuring your project."
)
endif()
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION_CONTENT)
string(STRIP "${VERSION_CONTENT}" CLAYGROUND_VERSION)

project (Clayground
VERSION ${CLAYGROUND_VERSION}
DESCRIPTION "Qt-based set of tools, plugins and libs for rapid app development."
HOMEPAGE_URL "https://github.com/MisterGC/clayground"
LANGUAGES CXX)

set(CLAYGROUND_PROJECT_NAME "${CMAKE_PROJECT_NAME}" CACHE INTERNAL "")
set(CLAYGROUND_PROJECT_VERSION "${CMAKE_PROJECT_VERSION}" CACHE INTERNAL "")

# COMMON CONFIGURATION
enable_testing()
set(CLAYGROUND_PROJECT_NAME "${CMAKE_PROJECT_NAME}")
set(CLAYGROUND_PROJECT_VERSION "${CMAKE_PROJECT_VERSION}")

if (NOT ANDROID) # Qt Android cmake causes problems otherwise
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
else()
# In some environements Qt (Creator) produces a gradle properties
# file with invalid androidBuildToolsVersion value - the following
# option allows to workaround this bug by allowing to provide the version
# explicitely. (See https://bugreports.qt.io/browse/QTBUG-94956)
set(CLAY_ANDROID_BUILD_TOOLS_VERSION
"DO_NOT_USE" CACHE STRING
"Set to the used version, if you need to workaround QTBUG-94956")
endif()
init_static_plugin_cfg()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/bin/qml CACHE STRING "" FORCE)
set(CLAY_PLUGIN_BASE_DIR ${QML_IMPORT_PATH}/Clayground)
set(CLAY_DEPS_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)

# ==========================
# USER OPTIONS
# ==========================

# PLUGIN LINKING
set(CLAYPLUGIN_LINKING SHARED)
if (ANDROID) # Avoids plugin loading problems
set(CLAYPLUGIN_LINKING STATIC)
endif()
init_static_plugin_cfg()
option(CLAYGROUND_WITH_TOOLS "Include Clayground tools e.g. dojo" ON)
option(CLAYGROUND_WITH_EXAMPLES "Include Clayground examples" ON)


# ===================
# BASIC REQUIREMENTS
# ===================

set(CLAY_CMAKE_MIN_VERSION 3.20 CACHE INTERNAL "")
cmake_minimum_required(VERSION ${CLAY_CMAKE_MIN_VERSION})

set(CLAY_CXX_STANDARD 17 CACHE INTERNAL "")
clay_check_cxx_requirements(MIN_CXX_STANDARD ${CLAY_CXX_STANDARD})

set(CLAY_QT_MIN_VERSION 6.6.0 CACHE INTERNAL "")
clay_check_qt_requirements(MIN_VERSION ${CLAY_QT_MIN_VERSION})


# =============
# DEPENDENCIES
# =============

add_subdirectory (thirdparty/qml-box2d)
if (TARGET Box2Dplugin)
extend_static_plugin_cfg("Box2Dplugin" "Box2DPlugin")
endif()
add_subdirectory (thirdparty/simple-svg-writer)
add_subdirectory (thirdparty/csv-parser)

# CLAYGROUND PLUGINS, TOOLS AND EXAMPLES

# ============================
# PLUGINS, TOOLS AND EXAMPLES
# ============================

add_subdirectory (plugins)
if(NOT ANDROID)
add_subdirectory (tools)

if(CLAYGROUND_WITH_TOOLS)
if(NOT (ANDROID OR IOS))
add_subdirectory (tools)
endif()
endif()

if(CLAYGROUND_WITH_EXAMPLES)
add_subdirectory (examples)
endif()
add_subdirectory (examples)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024.1
File renamed without changes.
File renamed without changes.
104 changes: 104 additions & 0 deletions cmake/clay_app/ios/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "38x38"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "38x38"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "64x64"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "64x64"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "68x68"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "clayground_app.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions cmake/example_app/main.cpp.in → cmake/clay_app/main.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ int main(int argc, char *argv[])
);
}

#ifdef CLAYPLUGIN_LINKING_STATIC
// Make the app's Qml resources available
engine.addImportPath(QStringLiteral(":/"));
#else
engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml");

// On macOS the plugins are deployed to a dir where Qt
// automatically loads from (within <app-package>/Resources/qml)
#ifndef CLAYPLUGIN_LINKING_STATIC
#if defined(_WIN32) || defined(__linux__)
engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml");
#endif
#endif
engine.load(QUrl("qrc:/main.qml"));

// Clayground expects that each app has a Main.qml as entry point
engine.loadFromModule("${CLAY_APP_NAME}", "Main");
return app.exec();
}

Loading

0 comments on commit 25db85b

Please sign in to comment.