From 757ec05d4f4fbd5d4ad84e00e609a81a1624e49c Mon Sep 17 00:00:00 2001 From: Reza Aarabi Date: Tue, 24 Oct 2023 17:48:28 -0700 Subject: [PATCH 1/4] initial commit --- 3rdParty/rive/cmake/CMakeLists.txt | 4 +- BUILDING.md | 114 +++++++++++++++++++++++++++++ README.md | 3 + 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 BUILDING.md diff --git a/3rdParty/rive/cmake/CMakeLists.txt b/3rdParty/rive/cmake/CMakeLists.txt index 64799e9..48c16b2 100644 --- a/3rdParty/rive/cmake/CMakeLists.txt +++ b/3rdParty/rive/cmake/CMakeLists.txt @@ -70,7 +70,7 @@ extract_zip("${RIVE_CPP_DOWNLOAD_DIR}/rive-cpp.zip" "${RIVE_CPP_SOURCE_DIR}" "${ file(GLOB RIVE_CPP_SOURCE_DIR_SUBDIRS LIST_DIRECTORIES true "${RIVE_CPP_SOURCE_DIR}/*") list(GET RIVE_CPP_SOURCE_DIR_SUBDIRS 0 RIVE_CPP_SOURCE_DIR) -set(HARFBUZZ_DOWNLOAD_URL "https://codeload.github.com/harfbuzz/harfbuzz/zip/858570b1d9912a1b746ab39fbe62a646c4f7a5b1") +set(HARFBUZZ_DOWNLOAD_URL "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/8.2.2.zip") set(HARFBUZZ_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/harfbuzz-src-download") set(HARFBUZZ_SOURCE_DIR "${RIVE_CPP_SOURCE_DIR}/harfbuzz/") set(HARFBUZZ_CPP_TARGET_DIR "zip") @@ -78,7 +78,7 @@ set(HARFBUZZ_CPP_TARGET_DIR "zip") file(DOWNLOAD ${HARFBUZZ_DOWNLOAD_URL} "${HARFBUZZ_DOWNLOAD_DIR}/harfbuzz.zip" SHOW_PROGRESS) extract_zip("${HARFBUZZ_DOWNLOAD_DIR}/harfbuzz.zip" "${HARFBUZZ_SOURCE_DIR}" "${HARFBUZZ_CPP_TARGET_DIR}") -set(SHEENBIDI_DOWNLOAD_URL "https://codeload.github.com/Tehreer/SheenBidi/zip/refs/tags/v2.6") +set(SHEENBIDI_DOWNLOAD_URL "https://github.com/Tehreer/SheenBidi/archive/refs/tags/v2.6.zip") set(SHEENBIDI_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/sheenbidi-src-download") set(SHEENBIDI_SOURCE_DIR "${RIVE_CPP_SOURCE_DIR}/sheenbidi") set(SHEENBIDI_CPP_TARGET_DIR "zip") diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 0000000..11a3a77 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,114 @@ +# **Build Configuration** + +--- + +## **Windows** + +### **Building** + +You can create your own batch files like `build.bat` file in the root of the project with these codes: + +```bat +@REM SPDX-FileCopyrightText: 2023 Jeremias Bosch +@REM SPDX-FileCopyrightText: 2023 Jonas Kalinka +@REM SPDX-FileCopyrightText: 2023 basysKom GmbH +@REM SPDX-FileCopyrightText: 2023 Reza Aarabi + +@REM SPDX-License-Identifier: LGPL-3.0-or-later +@REM -------------------------------------------------------------------------- + +@REM Getting the Root Directory When this file will be run +set ROOT=%~dp0 + + +@REM VCVARS_LOCATION: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build +@REM If you have installed other versions of Visual Studio Build Tools like 2019 you can set its path to this Environment Variable +echo %VCVARS_LOCATION% + +@REM Setting vcvars_ver flag is important +@REM Visual Studio 2019 Compiler +@REM call "%VCVARS_LOCATION%/vcvarsall.bat" x64 -vcvars_ver=14.29.30133 + +@REM Visual Studio 2022 Compiler +call "%VCVARS_LOCATION%/vcvarsall.bat" x64 -vcvars_ver=14.36.32532 + + + +cd %ROOT% + +if not exist "build" ( + mkdir "build" +) + + +@REM REM Qt5_DIR +@REM set Qt5_DIR=%SDKS_LOCATION%/Qt5/lib/cmake +@REM set PATH=%PATH%;%SDKS_LOCATION%/Qt5/bin + +REM Qt6_DIR +set Qt6_DIR=%SDKS_LOCATION%/Qt6/lib/cmake +set PATH=%PATH%;%SDKS_LOCATION%/Qt6/bin + +cd "%ROOT%/build" + +@REM cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH=%Qt6_DIR% -DCMAKE_CXX_FLAGS="/bigobj" "%ROOT%" +cmake -G "NMake Makefiles" -DCMAKE_PREFIX_PATH=%Qt6_DIR% -DCMAKE_CXX_FLAGS="/bigobj" "%ROOT%" +@REM cmake --build . --config Debug +cmake --build . --config Release + +``` + +### **Running** + +You can create your own batch files like `run.bat` file in the root of the project with these codes: + +```bat +@REM SPDX-FileCopyrightText: 2023 Jeremias Bosch +@REM SPDX-FileCopyrightText: 2023 Jonas Kalinka +@REM SPDX-FileCopyrightText: 2023 basysKom GmbH +@REM SPDX-FileCopyrightText: 2023 Reza Aarabi + +@REM SPDX-License-Identifier: LGPL-3.0-or-later +@REM -------------------------------------------------------------------------- + +@REM Getting the Root Directory When this file will be run +set ROOT=%~dp0 + +@REM set PATH=%PATH%;%SDKS_LOCATION%/Qt5/bin +set PATH=%PATH%;%SDKS_LOCATION%/Qt6/bin + +set QML2_IMPORT_PATH=%ROOT%\build\binary + +CALL %ROOT%\build\binary\examples\RiveQtQuickPlugin\RiveQtQuickSimpleViewer.exe + +``` + +### **Deployment** + +If you want to make a package of the tool and ship it, you can create your own `deploy.bat` file in the root of the project with these codes: + +```bat +@REM SPDX-FileCopyrightText: 2023 Jeremias Bosch +@REM SPDX-FileCopyrightText: 2023 Jonas Kalinka +@REM SPDX-FileCopyrightText: 2023 basysKom GmbH +@REM SPDX-FileCopyrightText: 2023 Reza Aarabi + +@REM SPDX-License-Identifier: LGPL-3.0-or-later +@REM -------------------------------------------------------------------------- + +@REM Getting the Root Directory When this file will be run +set ROOT=%~dp0 + +cd %ROOT% +if not exist "deploy" ( + mkdir "deploy" +) + + +copy %ROOT%\build\binary\examples\RiveQtQuickPlugin\RiveQtQuickSimpleViewer.exe "%ROOT%\deploy" + +CALL %SDKS_LOCATION%\Qt6\bin\windeployqt.exe %ROOT%\deploy\RiveQtQuickSimpleViewer.exe --no-translations + +``` + +Please read the [README.md](https://github.com/madoodia/RiveQtQuickPlugin/blob/main/README.md) file. diff --git a/README.md b/README.md index 646987e..695b67b 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,9 @@ cmake -DCMAKE_PREFIX_PATH=~/.Qt/6.5.1/gcc_64 -S .. -B . make ``` +For more info on take a look at [BUILDING.md](https://github.com/madoodia/RiveQtQuickPlugin/blob/main/BUILDING.md). + + ## Usage Here's a short example of how to use the RiveQtQuickItem in your QML code: From 8e926e3ebae4453e6a9e7d2402baf01acbfd63da Mon Sep 17 00:00:00 2001 From: Reza Aarabi Date: Tue, 24 Oct 2023 17:58:29 -0700 Subject: [PATCH 2/4] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 695b67b..5aa5fb1 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ cmake -DCMAKE_PREFIX_PATH=~/.Qt/6.5.1/gcc_64 -S .. -B . make ``` -For more info on take a look at [BUILDING.md](https://github.com/madoodia/RiveQtQuickPlugin/blob/main/BUILDING.md). +For more info, take a look at [BUILDING.md](https://github.com/madoodia/RiveQtQuickPlugin/blob/main/BUILDING.md). ## Usage From a659419a06b11f3736635fe74e74513ef99027ab Mon Sep 17 00:00:00 2001 From: Reza Aarabi Date: Tue, 24 Oct 2023 19:47:25 -0700 Subject: [PATCH 3/4] info about adding dll file is added --- BUILDING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILDING.md b/BUILDING.md index 11a3a77..07dbd56 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -110,5 +110,6 @@ copy %ROOT%\build\binary\examples\RiveQtQuickPlugin\RiveQtQuickSimpleViewer.exe CALL %SDKS_LOCATION%\Qt6\bin\windeployqt.exe %ROOT%\deploy\RiveQtQuickSimpleViewer.exe --no-translations ``` +And copy `RiveQtQuickPlugin.dll` to deploy directory from `build\binary\RiveQtQuickPlugin\RiveQtQuickPlugin.dll` Please read the [README.md](https://github.com/madoodia/RiveQtQuickPlugin/blob/main/README.md) file. From 96bf91c4f61691a2678dc87e3d283c7ee59a881f Mon Sep 17 00:00:00 2001 From: Reza Aarabi Date: Fri, 27 Oct 2023 14:13:14 -0700 Subject: [PATCH 4/4] enabling /MD --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2045f28..a83ad8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ if(NOT WIN32) add_compile_options(-gdwarf-4) endif() + +# setting /MD for the project +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") + # Add rive-cpp dependency if required if(${RQQRP_DOWNLOAD_BUILD_DEPENDENCIES}) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/rive/cmake)