-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from MisterGC/release/2022.1
Release/2022.1
- Loading branch information
Showing
62 changed files
with
1,224 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ jobs: | |
build-windows: | ||
runs-on: windows-latest | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,57 @@ | ||
# (c) Clayground Contributors - MIT License, see "LICENSE" file | ||
|
||
cmake_minimum_required(VERSION 3.19) | ||
project (Clayground VERSION 2021.2) | ||
project (Clayground VERSION 2022.1) | ||
|
||
# CMAKE INCLUDES | ||
set(CLAY_CMAKE_SCRIPT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
list(APPEND CMAKE_MODULE_PATH "${CLAY_CMAKE_SCRIPT_DIR}") | ||
include(clayplugin) | ||
|
||
|
||
# COMMON CONFIGURATION | ||
enable_testing() | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
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() | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
set(CLAY_PLUGIN_BASE_DIR ${CMAKE_BINARY_DIR}/bin/qml/Clayground) | ||
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/bin/qml CACHE STRING "" FORCE) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
set(CLAY_PLUGIN_BASE_DIR ${QML_IMPORT_PATH}/Clayground) | ||
set(CLAY_DEPS_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty) | ||
|
||
if (${CMAKE_SYSTEM_NAME} STREQUAL "iOS") | ||
set(QML_PLUGIN_LINK_TYPE STATIC CACHE STRING "" FORCE) | ||
|
||
# PLUGIN LINKING | ||
set(CLAYPLUGIN_LINKING SHARED) | ||
if (ANDROID) # Avoids plugin loading problems | ||
set(CLAYPLUGIN_LINKING STATIC) | ||
endif() | ||
init_static_plugin_cfg() | ||
|
||
|
||
# DEPENDENCIES | ||
add_subdirectory (thirdparty/qml-box2d) | ||
if (TARGET Box2Dplugin) | ||
extend_static_plugin_cfg("Box2Dplugin" "Box2DPlugin") | ||
endif() | ||
add_subdirectory (thirdparty/simple-svg-writer) | ||
add_subdirectory (plugins) | ||
add_subdirectory (thirdparty/csv-parser) | ||
|
||
# Qt has problems with multiple executables when building for Android | ||
# TODO Re-check if support for Android got better in Qt6 | ||
# CLAYGROUND PLUGINS, TOOLS AND EXAMPLES | ||
add_subdirectory (plugins) | ||
if(NOT ANDROID) | ||
add_subdirectory (tools) | ||
add_subdirectory (examples) | ||
endif() | ||
add_subdirectory (examples) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,73 @@ | ||
# (c) Clayground Contributors - MIT License, see "LICENSE" file | ||
include(CMakeParseArguments) | ||
|
||
function(clay_example EXAMPLE_NAME) | ||
macro(clay_example EXAMPLE_NAME) | ||
|
||
cmake_minimum_required(VERSION 3.16) | ||
set (oneValueArgs VERSION) | ||
set (multiValueArgs SOURCES QML_FILES RES_FILES) | ||
cmake_parse_arguments(CLAYEXAMPLE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
project (${EXAMPLE_NAME}) | ||
cmake_minimum_required(VERSION 3.16) | ||
project (${EXAMPLE_NAME} VERSION ${CLAYEXAMPLE_VERSION}) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Core Quick) | ||
|
||
configure_file(${CMAKE_SOURCE_DIR}/cmake/main_example.cpp.in main.cpp) | ||
add_executable (${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/main.cpp res.qrc) | ||
set(example_templ_dir ${CLAY_CMAKE_SCRIPT_DIR}/example_app) | ||
set(CLAYGROUND_IMPORT_PLUGINS $CACHE{CLAYGROUND_IMPORT_PLUGINS}) | ||
if(${CLAYGROUND_IMPORT_PLUGINS}) | ||
string(REPLACE " " "\n" CLAYGROUND_IMPORT_PLUGINS ${CLAYGROUND_IMPORT_PLUGINS}) | ||
endif() | ||
|
||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) | ||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE | ||
Qt::Core | ||
Qt::Quick | ||
configure_file(${example_templ_dir}/main.cpp.in main.cpp) | ||
qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION | ||
${CMAKE_CURRENT_BINARY_DIR}/main.cpp | ||
${CLAYEXAMPLE_SOURCES} ) | ||
|
||
qt_add_qml_module(${PROJECT_NAME} | ||
URI ${PROJECT_NAME} | ||
VERSION ${CLAYEXAMPLE_VERSION} | ||
QML_FILES ${CLAYEXAMPLE_QML_FILES} | ||
RESOURCES ${CLAYEXAMPLE_RES_FILES} | ||
) | ||
|
||
add_test(NAME test${PROJECT_NAME} COMMAND ${PROJECT_NAME}) | ||
set_tests_properties(test${PROJECT_NAME} PROPERTIES | ||
ENVIRONMENT "QSG_INFO=1;QT_OPENGL=software;QT_QPA_PLATFORM=minimal" | ||
target_compile_definitions(${PROJECT_NAME} | ||
PRIVATE | ||
$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG> | ||
$<$<STREQUAL:"${CLAYPLUGIN_LINKING}","STATIC">:CLAYPLUGIN_LINKING_STATIC> | ||
) | ||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE | ||
Qt::Core | ||
Qt::Quick | ||
$CACHE{CLAYGROUND_STATIC_PLUGINS}) | ||
|
||
if (NOT ANDROID) | ||
add_test(NAME test${PROJECT_NAME} COMMAND ${PROJECT_NAME}) | ||
set_tests_properties(test${PROJECT_NAME} PROPERTIES | ||
ENVIRONMENT "QSG_INFO=1;QT_OPENGL=software;QT_QPA_PLATFORM=minimal" | ||
) | ||
else() | ||
set(CLAY_APP_TARGET "${PROJECT_NAME}") | ||
set(CLAY_APP_VERSION "${CLAYEXAMPLE_VERSION}") | ||
set(android_templ_dir ${example_templ_dir}/android) | ||
configure_file(${android_templ_dir}/android_manifest.xml.in android/AndroidManifest.xml) | ||
if (NOT CLAY_ANDROID_BUILD_TOOLS_VERSION STREQUAL "DO_NOT_USE") | ||
configure_file(${android_templ_dir}/gradle.properties.in android/gradle.properties) | ||
endif() | ||
file(COPY ${android_templ_dir}/res DESTINATION android) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/android) | ||
endif() | ||
|
||
endfunction() | ||
qt_import_qml_plugins(${PROJECT_NAME}) | ||
qt_finalize_executable(${PROJECT_NAME}) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="clayground.examples.${CLAY_APP_TARGET}" | ||
android:installLocation="auto" | ||
android:versionCode="1" | ||
android:versionName="${CLAY_APP_VERSION}"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | ||
|
||
<supports-screens android:anyDensity="true" | ||
android:largeScreens="true" | ||
android:normalScreens="true" | ||
android:smallScreens="true"/> | ||
|
||
<application android:name="org.qtproject.qt.android.bindings.QtApplication" | ||
android:extractNativeLibs="true" | ||
android:hardwareAccelerated="true" | ||
android:label="${CLAY_APP_TARGET}" | ||
android:requestLegacyExternalStorage="true" | ||
android:allowNativeHeapPointerTagging="false" | ||
android:icon="@drawable/icon"> | ||
|
||
<activity android:name="org.qtproject.qt.android.bindings.QtActivity" | ||
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" | ||
android:label="${CLAY_APP_TARGET}" | ||
android:launchMode="singleTop" | ||
android:screenOrientation="unspecified"> | ||
|
||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
|
||
<meta-data android:name="android.app.lib_name" android:value="${CLAY_APP_TARGET}"/> | ||
<meta-data android:name="android.app.arguments" android:value=""/> | ||
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/> | ||
|
||
</activity> | ||
|
||
</application> | ||
|
||
</manifest> | ||
|
Oops, something went wrong.