Skip to content

Commit

Permalink
Fix GitHub actions builds (wip).
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterGC committed May 20, 2024
1 parent d23aed9 commit d281487
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 39 deletions.
66 changes: 32 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
# (c) Clayground Contributors - MIT License, see "LICENSE" file

# ==========================
# BASIC REQUIREMENTS
# ==========================
# ===============
# PROJECT BASICS
# ===============

# Study this include if you want to know more about the
# detailed global cmake cache/variable initialization
# Initializes global context that Clayground relies on
include("${CMAKE_CURRENT_LIST_DIR}/cmake/clayinit.cmake")

include(claycommon)

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})


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

option(CLAYGROUND_WITH_TOOLS "Include Clayground tools e.g. dojo" ON)
option(CLAYGROUND_WITH_EXAMPLES "Include Clayground examples" ON)


# ====================
# PROJECT SETUP
# ====================

include(clayplugin)

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION_CONTENT)
Expand All @@ -50,9 +26,31 @@ enable_testing()
init_static_plugin_cfg()


# ===============
# - DEPENDENCIES
# ===============
# ==========================
# USER OPTIONS
# ==========================

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)
Expand All @@ -62,9 +60,9 @@ add_subdirectory (thirdparty/simple-svg-writer)
add_subdirectory (thirdparty/csv-parser)


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

add_subdirectory (plugins)

Expand Down
6 changes: 6 additions & 0 deletions cmake/clayinit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ if (ANDROID OR IOS)
set(CLAYPLUGIN_LINKING STATIC CACHE INTERNAL "")
endif()

# Set the policy CMP0048 to NEW to allow the use of VERSION
# in the cmake project() command
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()

# Set output directories
if (NOT (ANDROID OR IOS)) # Desktop, TODO What about WASM?
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
4 changes: 4 additions & 0 deletions examples/pluginlive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ clay_app (sbx_plugin

SOURCES main.cpp

QML_FILES
Main.qml
Sandbox.qml

LINK_LIBS
Qt::Core
Qt::Qml
Expand Down
File renamed without changes.
18 changes: 13 additions & 5 deletions examples/void/Sandbox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

import QtQuick
import QtQuick.Controls
import Clayground.Ios

//TODO: Activate when using on iOS
// As there is no support for conditional
// imports in Qml it would be better if
// the plugin would still work but do nothing
// except printing warnings if iOS specific
// logic is used.
//#import Clayground.Ios

Rectangle
{
color: "#896b6b"

Button {
text: "Rate Us"
onClicked: clayIosBridge.requestReview()
}
// TODO: Activate when using on iOS
// Button {
// text: "Rate Us"
// onClicked: clayIosBridge.requestReview()
// }
}

0 comments on commit d281487

Please sign in to comment.