From 7357b3efbc72e9df8583ef6f8180f4facddb85aa Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 29 Aug 2024 15:30:27 +0200 Subject: [PATCH 1/6] Update cmake build example to run again --- CMakeLists.txt | 5 ++++- Documentation/cmake_example.zip | Bin 2609 -> 2573 bytes Documentation/cmake_example/CMakeLists.txt | 1 + inkcpp/include/story.h | 11 +++++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a15a36b..642aa5a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ SET(CMAKE_INSTALL_INCLUDE_DIR include) set(INKCPP_PY OFF CACHE BOOL "Build python bindings") set(WHEEL_BUILD OFF CACHE BOOL "Set for build wheel python lib (do not forgett INKCPP_PY") set(INKCPP_C OFF CACHE BOOL "Build c library") +set(INKCPP_TEST OFF CACHE BOOL "Build inkcpp tests (requires: inklecate in path or env: INKLECATE set)") if (INKCPP_PY) add_compile_options(-fPIC) @@ -27,7 +28,9 @@ if (INKCPP_C) endif(INKCPP_C) if (NOT WHEEL_BUILD) add_subdirectory(inkcpp_cl) - add_subdirectory(inkcpp_test) + if(INKCPP_TEST) + add_subdirectory(inkcpp_test) + endif(INKCPP_TEST) add_subdirectory(unreal) endif(NOT WHEEL_BUILD) diff --git a/Documentation/cmake_example.zip b/Documentation/cmake_example.zip index 262bcee6d919c170d570c7b2f313d81b2273fa48..3fbbc6cdb4e30c84d0f864d3954c25a6a2a3d015 100644 GIT binary patch literal 2573 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.ink`.
Which is available at the [official release * page](https://github.com/inkle/ink/releases/latest).
+ * Alternativly set the enviroment variable `INKLECATE` so that `%INKLECATE%` executes inklecate. * * If you want to use the inkcpp with C link against the target inkcpp_c and `#include * ` The C-API documentation and example can be found @ref clib "here". @@ -143,10 +144,12 @@ class story * ls # expected output: CMakeLists.txt main.cpp test.ink test.ink.json linux-lib * mkdir build * cd build - * inkcpp_DIR=../linux-lib cmake .. - * cmake --build . - * cp ../test.ink.json . - * ./main_cpp + * inkcpp_DIR=../linux-lib cmake .. -DCMAKE_BUILD_TYPE=Release # linux + * set inkcpp_DIR=../win64-lib # windows + * cmake .. # windows + * cmake --build . --config=Release + * cd .. + * ./build/main_cpp # exact path depends on build system used * @endcode * * @subsection src_main main.cpp From 8d644f5cae2304d1e4b0f88a925235f449b7564f Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Fri, 30 Aug 2024 10:09:45 +0200 Subject: [PATCH 2/6] Added scratch for better inklecate download handel --- CMakeLists.txt | 43 ++++++++++++++++++++++++++++- inkcpp/include/story.h | 7 +++-- inkcpp_cl/inkcpp_cl.cpp | 7 +++++ inkcpp_cl/test.cpp | 13 +++++++-- inkcpp_cl/test.h | 7 +++-- inkcpp_test/CMakeLists.txt | 35 +++++++++++++++++++++++- unreal/CMakeLists.txt | 56 ++++++++++---------------------------- 7 files changed, 117 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 642aa5a4..26689ad9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,28 @@ cmake_minimum_required(VERSION 3.16) +if(${CMAKE_VERSION} VERSION_GREATER "3.24.0") + cmake_policy(SET CMP0135 NEW) +endif() +include(FetchContent) +FetchContent_Declare(inklecate_mac +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip +URL_HASH SHA256=c516402bca5fa249a7712e62591b048b137eba3098c53f9fb85a4253f9b9e2c0 +SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/mac" +) +FetchContent_Declare(inklecate_windows +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip +URL_HASH SHA256=6f317cb4c59bf1b31c6dd61e80c6a2287a1d8c241a703f0586f736ae00871aab +SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/windows" +) +FetchContent_Declare(inklecate_linux +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip +URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8 +SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/linux" +) +set(FETCHCONTENT_QUIET OFF) +set(CMAKE_TLS_VERIFY true) +include(FetchContent) + # Testing enabled enable_testing() @@ -14,7 +37,25 @@ SET(CMAKE_INSTALL_INCLUDE_DIR include) set(INKCPP_PY OFF CACHE BOOL "Build python bindings") set(WHEEL_BUILD OFF CACHE BOOL "Set for build wheel python lib (do not forgett INKCPP_PY") set(INKCPP_C OFF CACHE BOOL "Build c library") -set(INKCPP_TEST OFF CACHE BOOL "Build inkcpp tests (requires: inklecate in path or env: INKLECATE set)") +set(INKCPP_TEST OFF CACHE BOOL "Build inkcpp tests (requires: inklecate in path / env: INKLECATE set / INKCPP_INKLECATE=OS or ALL)") +set(INKCPP_INKLECATE "NONE" CACHE STRING "If inklecate should be downloaded automatically from the official release page. NONE -> No, OS -> Yes, but only for the current OS, ALL -> Yes, for all availible OSs") +set_property(CACHE INKCPP_INKLECATE PROPERTY STRINGS "NONE" "OS" "ALL") +set(INKCPP_DOC_BlueprintUE ON CACHE BOOL "Building doxygen documentation with BlueprintUE visualisation for unreal blueprints.") + +string(TOUPPER "${INKCPP_INKLECATE}" inkcpp_inklecate_upper) +if (inkcpp_inklecate_upper STREQUAL "ALL") + FetchContent_MakeAvailable(inklecate_windows inklecate_mac inklecate_linux) +elseif(inkcpp_inklecate_upper STREQUAL "OS") + if(UNIX AND NOT APPLE) + FetchContent_MakeAvailable(inklecate_linux) + elseif(APPLE) + FetchContent_MakeAvailable(inklecate_mac) + elseif(MSYS OR MINGW OR WIN32 OR CYGWIN) + FetchContent_MakeAvailable(inklecate_windows) + else() + message(FATAL_ERROR "Unable to identify OS for option INKCPP_INKLECATE=OS, please consider using NONE or ALL.") + endif() +endif() if (INKCPP_PY) add_compile_options(-fPIC) diff --git a/inkcpp/include/story.h b/inkcpp/include/story.h index 9b28a5d2..53a34d47 100644 --- a/inkcpp/include/story.h +++ b/inkcpp/include/story.h @@ -164,15 +164,16 @@ class story * * @section ue Unreal Installation * - * The current release is available at the [release + * The easiest way is to install it via the [unreal marcetplace](https://www.unrealengine.com/marketplace/en-US/product/inkcpp). + * The overview to the UE Blueprint class and examples can be found at @ref unreal "here". + * + * The current release is also available at the [release * page](https://github.com/JBenda/inkcpp/releases/latest), as `unreal.zip`.
* Unpack this foldor in `/PATH/TO/UNREAL_ENGINE/Engine/Plugins/` and it will be available * as plugin in the plugin list.
* Or unpack this folder in `/PATH/TO/UNREAL_PROJECT/Plugins/` and it will be * intigrated at the next startup.
A MarketPlace appearance is work in progress :) * - * The overview to the UE Blueprint class and examples can be found at @ref unreal "here". - * * If you want to use the newest version clone the project and install the unreal component. * @code {sh} * git clone https://github.com/JBenda/inkcpp diff --git a/inkcpp_cl/inkcpp_cl.cpp b/inkcpp_cl/inkcpp_cl.cpp index 521a46f6..8b84ca08 100644 --- a/inkcpp_cl/inkcpp_cl.cpp +++ b/inkcpp_cl/inkcpp_cl.cpp @@ -23,6 +23,7 @@ void usage() "snapshot file enter '-1' as choice\n" << "\t--ommit-choice-tags:\tdo not print tags after choices, primarly used to be compatible " "with inkclecat output" + << "\t--inklecate :\toverwrites INKLECATE enviroment variable\n" << endl; } @@ -38,6 +39,7 @@ int main(int argc, const char** argv) std::string outputFilename; bool playMode = false, testMode = false, testDirectory = false, ommit_choice_tags = false; std::string snapshotFile; + std::string inklecateOverwrite; for (int i = 1; i < argc - 1; i++) { std::string option = argv[i]; if (option == "-o") { @@ -56,6 +58,11 @@ int main(int argc, const char** argv) } else if (option == "-td") { testMode = true; testDirectory = true; + } else if (option == "--inklecate") { + if (i + 1 < argc - 1 && argv[i + 1][0] != '-') { + ++i; + inklecateOverwrite = argv[i]; + } } else { std::cerr << "Unrecognized option: '" << option << "'\n"; } diff --git a/inkcpp_cl/test.cpp b/inkcpp_cl/test.cpp index d69e0973..c2ddd9f7 100644 --- a/inkcpp_cl/test.cpp +++ b/inkcpp_cl/test.cpp @@ -12,10 +12,19 @@ #include #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename) +void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const std::string* inklecateOverwrite) { // Get environment specific inklecate invocation command - const char* inklecateCmd = std::getenv("INKLECATE"); + + const char* inklecateCmd = nullptr; + if (inklecateCmd == nullptr) { + if (inklecateOverwrite) { + inklecateCmd = inklecateOverwrite->c_str(); + } + } + if (inklecateCmd == nullptr) { + std::getenv("INKLECATE"); + } if (inklecateCmd == nullptr) inklecateCmd = "inklecate"; diff --git a/inkcpp_cl/test.h b/inkcpp_cl/test.h index ffca4315..7d8b9ced 100644 --- a/inkcpp_cl/test.h +++ b/inkcpp_cl/test.h @@ -1,5 +1,6 @@ #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename); -bool test(const std::string& inkFilename); -bool test_directory(const std::string& directory); \ No newline at end of file +void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const std::string* inkclecateOverwrite); +// TODO: reevaluate in ink file test mechanism +// bool test(const std::string& inkFilename); +// bool test_directory(const std::string& directory); diff --git a/inkcpp_test/CMakeLists.txt b/inkcpp_test/CMakeLists.txt index 4a36268d..96b1475d 100644 --- a/inkcpp_test/CMakeLists.txt +++ b/inkcpp_test/CMakeLists.txt @@ -45,6 +45,39 @@ else() endif() +if((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "OS")) + if(UNIX AND NOT APPLE) + FetchContent_GetProperties(inklecate_linux) + if(inklecate_linux_POPULATED) + set(inklecate_overwrite "--inklecate ${inklecate_linux_SOURCE_DIR}/inklecate") + else() + message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. + You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. + You can also disable tests altogether by setting INKCPP_TEST=OFF") + endif(inklecate_linux_POPULATED) + elseif(APPLE) + if(inklecate_mac_POPULATED) + set(inklecate_overwrite "--inklecate ${inklecate_mac_SOURCE_DIR}/inklecate") + else() + message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. + You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. + You can also disable tests altogether by setting INKCPP_TEST=OFF") + endif(inklecate_mac_POPULATED) + elseif(MSYS OR MINGW OR WIN32 OR CYGWIN) + if(inklecate_windows_POPULATED) + set(inklecate_overwrite "--inklecate ${inklecate_windows_SOURCE_DIR}/inklecate") + else() + message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. + You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. + You can also disable tests altogether by setting INKCPP_TEST=OFF") + endif(inklecate_windows_POPULATED) + else() + message(FATAL_ERROR "Current os could not be identified, therfore inklecate must be provided explicit for the tests to work + please set INKCPP_INKLECATE=NONE and provide inklecate via your PATH or the INKLECATE enviroment variables. + Alternatily disable tests by setting INKCPP_TEST=OFF.") + endif() +endif((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "OS")) + set(INK_TEST_RESOURCE_DIR "${PROJECT_BINARY_DIR}/ink") file(MAKE_DIRECTORY "${INK_TEST_RESOURCE_DIR}") @@ -60,7 +93,7 @@ foreach(INK_FILE IN LISTS INK_FILES) set(output "${INK_TEST_RESOURCE_DIR}/${INK_FILENAME}.bin") add_custom_command( OUTPUT ${output} - COMMAND $ -o "${output}" "${INK_FILE}" + COMMAND $ -o "${output}" "${inklecate_overwrite}" "${INK_FILE}" DEPENDS ${INK_FILE} COMMENT "Compile test ink file '${INK_FILENAME}.ink' -> '${output}'" ) diff --git a/unreal/CMakeLists.txt b/unreal/CMakeLists.txt index 80183726..4ab7853d 100644 --- a/unreal/CMakeLists.txt +++ b/unreal/CMakeLists.txt @@ -1,55 +1,29 @@ -if(${CMAKE_VERSION} VERSION_GREATER "3.24.0") - cmake_policy(SET CMP0135 NEW) -endif() -include(FetchContent) -set(CMAKE_TLS_VERIFY true) -FetchContent_Declare(inklecate_mac -URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip -URL_HASH SHA256=c516402bca5fa249a7712e62591b048b137eba3098c53f9fb85a4253f9b9e2c0 -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/mac" -) -FetchContent_Declare(inklecate_windows -URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip -URL_HASH SHA256=6f317cb4c59bf1b31c6dd61e80c6a2287a1d8c241a703f0586f736ae00871aab -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/windows" -) -FetchContent_Declare(inklecate_linux -URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip -URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8 -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/linux" -) - -set(FETCHCONTENT_QUIET OFF) - -FetchContent_MakeAvailable(inklecate_windows) +# download inklecate for unreal plugin +install(CODE " +FetchContent_MakeAvailable(inklecate_windows inklecate_mac inklecate_linux) if(NOT inklecate_windows_SOURCE_DIR) -message(WARNING "failed to download inklecate for windows, " - "the unreal plugin will be unable use a .ink file as asset directly") +message(WARNING \"failed to download inklecate for windows, \" + \"the unreal plugin will be unable use a .ink file as asset directly\") else() -set(INKLECATE_CMD_WIN "Source/ThirdParty/inklecate/windows/inklecate.exe") +set(INKLECATE_CMD_WIN \"Source/ThirdParty/inklecate/windows/inklecate.exe\") endif() - -FetchContent_MakeAvailable(inklecate_mac) if(NOT inklecate_mac_SOURCE_DIR) - message(WARNING "failed to download inklecate for MacOS, " - "the unreal plugin will be unable use a .ink file as asset directly") + message(WARNING \"failed to download inklecate for MacOS, \" + \"the unreal plugin will be unable use a .ink file as asset directly\") else() -set(INKLECATE_CMD_MAC "Source/ThirdParty/inklecate/mac/inklecate") +set(INKLECATE_CMD_MAC \"Source/ThirdParty/inklecate/mac/inklecate\") endif() - -FetchContent_MakeAvailable(inklecate_linux) if(NOT inklecate_linux_SOURCE_DIR) - message(WARNING "failed to download inklecate for linux, " - "the unreal plugin will be unable use a .ink file as asset directly") + message(WARNING \"failed to download inklecate for linux, \" + \"the unreal plugin will be unable use a .ink file as asset directly\") else() -set(INKLECATE_CMD_LINUX "Source/ThirdParty/inklecate/linux/inklecate") +set(INKLECATE_CMD_LINUX \"Source/ThirdParty/inklecate/linux/inklecate\") endif() - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp" + \"${CMAKE_CURRENT_SOURCE_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp.in\" + \"${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp\" ) - +" COMPONENT unreal EXCLUDE_FROM_ALL) # Copy files into destination directory install(DIRECTORY "inkcpp/" DESTINATION "inkcpp" COMPONENT unreal EXCLUDE_FROM_ALL PATTERN "*.in" EXCLUDE) From f2e5807b60cbf693b7fadc0f843b13d71edc49ac Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Fri, 30 Aug 2024 16:14:30 +0200 Subject: [PATCH 3/6] inklecate download optimisations + Bundle inklecate with _cl application if inkcpp_inklecate=OS|ALL + download unreal content content only iff installed + disable tests per default + content inklecate for tests if inkcpp_inklecate=OS|ALL + use the same zip files for all refs --- CMakeLists.txt | 8 +++----- inkcpp_cl/CMakeLists.txt | 27 +++++++++++++++++++++++++++ inkcpp_cl/inkcpp_cl.cpp | 22 +++++++++++----------- inkcpp_cl/test.cpp | 6 +++--- inkcpp_cl/test.h | 2 +- inkcpp_test/CMakeLists.txt | 14 +++++++------- unreal/CMakeLists.txt | 23 ++++++++++++++++++++++- 7 files changed, 74 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26689ad9..c984ddee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,22 +7,20 @@ include(FetchContent) FetchContent_Declare(inklecate_mac URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip URL_HASH SHA256=c516402bca5fa249a7712e62591b048b137eba3098c53f9fb85a4253f9b9e2c0 -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/mac" +SOURCE_DIR "inklecate/mac" ) FetchContent_Declare(inklecate_windows URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip URL_HASH SHA256=6f317cb4c59bf1b31c6dd61e80c6a2287a1d8c241a703f0586f736ae00871aab -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/windows" +SOURCE_DIR "inklecate/windows" ) FetchContent_Declare(inklecate_linux URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8 -SOURCE_DIR "inkcpp/Source/ThirdParty/inklecate/linux" +SOURCE_DIR "inklecate/linux" ) set(FETCHCONTENT_QUIET OFF) set(CMAKE_TLS_VERIFY true) -include(FetchContent) - # Testing enabled enable_testing() diff --git a/inkcpp_cl/CMakeLists.txt b/inkcpp_cl/CMakeLists.txt index 5483a05d..2a433ca8 100644 --- a/inkcpp_cl/CMakeLists.txt +++ b/inkcpp_cl/CMakeLists.txt @@ -17,3 +17,30 @@ endif() # Install install(TARGETS inkcpp_cl DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) +string(TOUPPER "${INKCPP_INKLECATE}" inkcpp_inklecate_upper) +if((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) + if(UNIX AND NOT APPLE) + FetchContent_GetProperties(inklecate_linux) + if(inklecate_linux_POPULATED) + set(inklecate_dir "${inklecate_linux_SOURCE_DIR}") + else() + message(WARNING "Inklecate for this OS was not downloaded successfully, and will therfore not be packat with cl") + endif(inklecate_linux_POPULATED) + elseif(APPLE) + if(inklecate_mac_POPULATED) + set(inklecate_dir "${inklecate_mac_SOURCE_DIR}") + else() + message(WARNING "Inklecate for this OS was not downloaded successfully, and will therfore not be packat with cl") + endif(inklecate_mac_POPULATED) + elseif(MSYS OR MINGW OR WIN32 OR CYGWIN) + if(inklecate_windows_POPULATED) + set(inklecate_dir "${inklecate_windows_SOURCE_DIR}") + else() + message(WARNING "Inklecate for this OS was not downloaded successfully, and will therfore not be packat with cl") + endif(inklecate_windows_POPULATED) + else() + message(WARNING "Failed to determine OS for bundling inklecate with command line application!") + endif() +endif((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) +file(GLOB inklecate_files "${inklecate_dir}/*") +install(FILES ${inklecate_files} DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) diff --git a/inkcpp_cl/inkcpp_cl.cpp b/inkcpp_cl/inkcpp_cl.cpp index 8b84ca08..01ef40f2 100644 --- a/inkcpp_cl/inkcpp_cl.cpp +++ b/inkcpp_cl/inkcpp_cl.cpp @@ -39,7 +39,7 @@ int main(int argc, const char** argv) std::string outputFilename; bool playMode = false, testMode = false, testDirectory = false, ommit_choice_tags = false; std::string snapshotFile; - std::string inklecateOverwrite; + const char* inklecateOverwrite = nullptr; for (int i = 1; i < argc - 1; i++) { std::string option = argv[i]; if (option == "-o") { @@ -72,16 +72,16 @@ int main(int argc, const char** argv) std::string inputFilename = argv[argc - 1]; // Test mode - if (testMode) { - bool result; - if (testDirectory) { - result = test_directory(inputFilename); - } else { - result = test(inputFilename); - } + // if (testMode) { + // bool result; + // if (testDirectory) { + // result = test_directory(inputFilename); + // } else { + // result = test(inputFilename); + // } - return result ? 0 : -1; - } + // return result ? 0 : -1; + // } // If output filename not specified, use input filename as guideline if (outputFilename.empty()) { @@ -97,7 +97,7 @@ int main(int argc, const char** argv) // Then we need to do a compilation with inklecate try { - inklecate(inputFilename, jsonFile); + inklecate(inputFilename, jsonFile, inklecateOverwrite); } catch (const std::exception& e) { std::cerr << "Inklecate Error: " << e.what() << std::endl; return 1; diff --git a/inkcpp_cl/test.cpp b/inkcpp_cl/test.cpp index c2ddd9f7..ae2155bc 100644 --- a/inkcpp_cl/test.cpp +++ b/inkcpp_cl/test.cpp @@ -12,14 +12,14 @@ #include #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const std::string* inklecateOverwrite) +void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const char* inklecateOverwrite) { // Get environment specific inklecate invocation command const char* inklecateCmd = nullptr; if (inklecateCmd == nullptr) { if (inklecateOverwrite) { - inklecateCmd = inklecateOverwrite->c_str(); + inklecateCmd = inklecateOverwrite; } } if (inklecateCmd == nullptr) { @@ -64,7 +64,7 @@ bool test(const std::string& inkFilename) std::cout << std::filesystem::path(inkFilename).filename().string() << std::endl; // Compile into a temporary json file - inklecate(inkFilename, "test.tmp"); + inklecate(inkFilename, "test.tmp", nullptr); // Compile into binary ink::compiler::compilation_results results; diff --git a/inkcpp_cl/test.h b/inkcpp_cl/test.h index 7d8b9ced..4309a63d 100644 --- a/inkcpp_cl/test.h +++ b/inkcpp_cl/test.h @@ -1,6 +1,6 @@ #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const std::string* inkclecateOverwrite); +void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const char* inkclecateOverwrite); // TODO: reevaluate in ink file test mechanism // bool test(const std::string& inkFilename); // bool test_directory(const std::string& directory); diff --git a/inkcpp_test/CMakeLists.txt b/inkcpp_test/CMakeLists.txt index 96b1475d..4568eee7 100644 --- a/inkcpp_test/CMakeLists.txt +++ b/inkcpp_test/CMakeLists.txt @@ -44,12 +44,12 @@ else() set(INKLECATE_CMD "inklecate") endif() - -if((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "OS")) +string(TOUPPER "${INKCPP_INKLECATE}" inkcpp_inklecate_upper) +if((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) if(UNIX AND NOT APPLE) FetchContent_GetProperties(inklecate_linux) if(inklecate_linux_POPULATED) - set(inklecate_overwrite "--inklecate ${inklecate_linux_SOURCE_DIR}/inklecate") + set(INKLECATE_CMD "${inklecate_linux_SOURCE_DIR}/inklecate") else() message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. @@ -57,7 +57,7 @@ if((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "O endif(inklecate_linux_POPULATED) elseif(APPLE) if(inklecate_mac_POPULATED) - set(inklecate_overwrite "--inklecate ${inklecate_mac_SOURCE_DIR}/inklecate") + set(INKLECATE_CMD "${inklecate_mac_SOURCE_DIR}/inklecate") else() message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. @@ -65,7 +65,7 @@ if((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "O endif(inklecate_mac_POPULATED) elseif(MSYS OR MINGW OR WIN32 OR CYGWIN) if(inklecate_windows_POPULATED) - set(inklecate_overwrite "--inklecate ${inklecate_windows_SOURCE_DIR}/inklecate") + set(INKLECATE_CMD "${inklecate_windows_SOURCE_DIR}/inklecate") else() message(FATAL_ERROR "inklecate download is not provided, please check if the download failed. You may set INCPP_INKLECATE=NONE and provide inkcleate via your PATH or the INKLECATE enviroment variable. @@ -76,7 +76,7 @@ if((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "O please set INKCPP_INKLECATE=NONE and provide inklecate via your PATH or the INKLECATE enviroment variables. Alternatily disable tests by setting INKCPP_TEST=OFF.") endif() -endif((inkcpp_inklecate_upper STREQUAL "ALL") OR (incpp_inklecate_upper STREQUAL "OS")) +endif((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) set(INK_TEST_RESOURCE_DIR "${PROJECT_BINARY_DIR}/ink") file(MAKE_DIRECTORY "${INK_TEST_RESOURCE_DIR}") @@ -93,7 +93,7 @@ foreach(INK_FILE IN LISTS INK_FILES) set(output "${INK_TEST_RESOURCE_DIR}/${INK_FILENAME}.bin") add_custom_command( OUTPUT ${output} - COMMAND $ -o "${output}" "${inklecate_overwrite}" "${INK_FILE}" + COMMAND $ -o "${output}" --inklecate "${INKLECATE_CMD}" "${INK_FILE}" DEPENDS ${INK_FILE} COMMENT "Compile test ink file '${INK_FILENAME}.ink' -> '${output}'" ) diff --git a/unreal/CMakeLists.txt b/unreal/CMakeLists.txt index 4ab7853d..9805e548 100644 --- a/unreal/CMakeLists.txt +++ b/unreal/CMakeLists.txt @@ -1,6 +1,26 @@ # download inklecate for unreal plugin install(CODE " -FetchContent_MakeAvailable(inklecate_windows inklecate_mac inklecate_linux) +include(FetchContent) +FetchContent_Populate(inklecate_mac +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip +URL_HASH SHA256=c516402bca5fa249a7712e62591b048b137eba3098c53f9fb85a4253f9b9e2c0 +SOURCE_DIR \"inklecate/mac\" +SUBBUILD_DIR \"${CMAKE_CURRENT_BINARY_DIR}/../_deps/inklecate_mac-subbuild\" +) +FetchContent_Populate(inklecate_windows +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip +URL_HASH SHA256=6f317cb4c59bf1b31c6dd61e80c6a2287a1d8c241a703f0586f736ae00871aab +SOURCE_DIR \"inklecate/windows\" +SUBBUILD_DIR \"${CMAKE_CURRENT_BINARY_DIR}/../_deps/inklecate_windows-subbuild\" +) +FetchContent_Populate(inklecate_linux +URL https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip +URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8 +SOURCE_DIR \"inklecate/linux\" +SUBBUILD_DIR \"${CMAKE_CURRENT_BINARY_DIR}/../_deps/inklecate_linux-subbuild\" +) +set(FETCHCONTENT_QUIET OFF) +set(CMAKE_TLS_VERIFY true) if(NOT inklecate_windows_SOURCE_DIR) message(WARNING \"failed to download inklecate for windows, \" \"the unreal plugin will be unable use a .ink file as asset directly\") @@ -27,4 +47,5 @@ configure_file( # Copy files into destination directory install(DIRECTORY "inkcpp/" DESTINATION "inkcpp" COMPONENT unreal EXCLUDE_FROM_ALL PATTERN "*.in" EXCLUDE) +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../inklecate" DESTINATION "inkcpp/Source/ThirdParty" COMPONENT unreal EXCLUDE_FROM_ALL) install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inkcpp" DESTINATION "." COMPONENT unreal EXCLUDE_FROM_ALL) From 548a67ce7424c27504627efc9837498b315379b0 Mon Sep 17 00:00:00 2001 From: JBenda Date: Fri, 30 Aug 2024 18:47:49 +0200 Subject: [PATCH 4/6] Updated documentation and build system for new CMake flags --- .github/workflows/build.yml | 18 +----------------- README.md | 28 ++++++++++++++++++++++++++-- inkcpp/include/story.h | 15 ++++++++++++++- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cba116d9..9954c941 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,22 +47,6 @@ jobs: with: submodules: true - # Download inklecate - - uses: suisei-cn/actions-download-file@v1.6.0 - name: Download Inklecate - id: download_inklecate - with: - url: ${{ matrix.inklecate_url }} - target: "inklecate/" - - # Install Inklecate - - name: Deploy Inkelcate - shell: bash - run: | - cd inklecate - unzip *.zip - echo "INKLECATE=${{ matrix.inklecate_pre }}$GITHUB_WORKSPACE/inklecate/inklecate${{ matrix.inklecate_post }}" >> $GITHUB_ENV - # Setup python - uses: actions/setup-python@v5 if: ${{ matrix.proof }} @@ -83,7 +67,7 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINKCPP_PY=OFF -DINKCPP_C=ON + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS # Build using CMake and OS toolkit - name: Build diff --git a/README.md b/README.md index 86f00fa2..4a4238c9 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Doxygen Documentation: https://jbenda.github.io/inkcpp/html Run `inkcpp_cl.exe -p myfile.json` to execute a compiled Ink JSON file in play mode. It can also operate on `.ink` files but `inklecate.exe` must be in the same folder or in the PATH. `inklecate` can be downloaded from the [official release page](https://github.com/inkle/ink/releases) and will be downloaded from CMake at configure time (located at `build/unreal/inkcpp/Resources/inklecate`). +Or do it automatically with the `INKCPP_INKLECATE=OS` CMake flag. (It will be downloaded to `/inklecate//` and will be installed with `cmake --install . --component cl`) Without the `-p` flag, it'll just compile the JSON/Ink file into InkCPP's binary format (see the Wiki on GitHub). @@ -129,6 +130,7 @@ To build, either run the generated buildfiles OR you can use `cmake --build . -- To install the different components use `cmake --install . --component ` + `lib` C++ library to link against ++ `clib` C library to link against + `cl` command line application + `unreal` UE-plugin @@ -142,7 +144,29 @@ If you recieve an error like "Mismatch Detected for Runtime Library," it means y ### Running Tests -Run `ctest` from the build folder to execute unit tests configured with CMake. Use `ctest -V` for more verbose error output. +To enable testing set the CMake flag `INKCPP_TEST=ON`. If you do not have inklecate at your path you can set `INKCPP_INKLECATE=OS` to download und use the current supported verision. +Run `ctest -C Release` from the build folder to execute unit tests configured with CMake. Use `ctest -V -Release` for more verbose error output. +Do not forgett that the C libs are only testet if `INKCPP_C=ON` is set. + +```sh +mkdir build; cd build +cmake .. -DCMAKE_BUILD_TYPE=Release -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS +cmake --build . --config Release +ctest -C Release +``` + +To test the python bindings use: + +```sh +pip install . +python -m pip install build pytest +python -m build +python -m pip install dist/*.whl --user +# if inklecate is not in the same directory / inside Path set INKLECATE enviroment variable +export INKLECATE= # unix +set INKLECTATE= # windows +python -m pytest +``` Right now this only executes the internal unit tests which test the functions of particular classes. Soon it'll run more complex tests on .ink files using ink-proof. @@ -155,7 +179,7 @@ To build it from source use: ```sh git clone --recurse-submodules https://github.com/JBenda/inkcpp.git -pip install inkcpp +pip install . ``` The python bindnigs are defined in `inkcpp_py` subfolder. diff --git a/inkcpp/include/story.h b/inkcpp/include/story.h index 53a34d47..fb20f9a7 100644 --- a/inkcpp/include/story.h +++ b/inkcpp/include/story.h @@ -127,7 +127,7 @@ class story * `linux-lib.zip`).
to link the libraries you can use `find_package(inkcpp CONFIG)` which * provides two targets: * + inkcpp: the runtime enviroment - * + inkcpp_comopiler: functionality to compile a story.json to story.bin + * + inkcpp_compiler: functionality to compile a story.json to story.bin * * To run your own `.ink` files you need a way to compile it to inks runtime format `.ink.json`. One * way is to use `inklecate .ink`.
Which is available at the [official release @@ -152,6 +152,19 @@ class story * ./build/main_cpp # exact path depends on build system used * @endcode * + * @subsection cmake_flags CMake Flags + * + INKCPP_TEST: (ON|OFF) weather or not execute tests + * requires `inklecate` to be in the PATH or `INKCPP_INKLECATE=OS` or `=ALL` + * + INKCPP_INKLECATE: (NONE|OS|ALL) download the current supported inklecate version from the official [release page](https://github.com/inkle/ink/releases/latest)
+ * They are stored at `/inklecate//` and will be automatcilly used for the tests + * + NONE: disable this function + * + OS: only the version supported for the OS + * + ALL: all versions + * + INKCPP_C: (ON|OFF) Build the inkcpp c bindings (and thest them if test is enabled) + * + INKCPP_PY: (ON|OFF) Build python bindings (build system only) + * + WHEEL_BUILD: (ON|OFF) Settings to work with a python wheel build (build system only) + * + INKCPP_DOC_BlueprintUE: (ON|OFF) enables nice blueprint renders for the documentation + * * @subsection src_main main.cpp * @include cmake_example/main.cpp * From d16a79133bb12cdde82747880814678c5088da5c Mon Sep 17 00:00:00 2001 From: JBenda Date: Fri, 30 Aug 2024 19:08:18 +0200 Subject: [PATCH 5/6] Minore build script fixes --- inkcpp/include/story.h | 13 ++++++++----- inkcpp_cl/CMakeLists.txt | 7 +++++-- inkcpp_cl/test.cpp | 6 ++++-- inkcpp_cl/test.h | 4 +++- inkcpp_compiler/list_data.cpp | 3 ++- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/inkcpp/include/story.h b/inkcpp/include/story.h index fb20f9a7..f1a20def 100644 --- a/inkcpp/include/story.h +++ b/inkcpp/include/story.h @@ -149,14 +149,16 @@ class story * cmake .. # windows * cmake --build . --config=Release * cd .. - * ./build/main_cpp # exact path depends on build system used + * ./build/main_cpp # exact path depends on build system + * used * @endcode * * @subsection cmake_flags CMake Flags * + INKCPP_TEST: (ON|OFF) weather or not execute tests * requires `inklecate` to be in the PATH or `INKCPP_INKLECATE=OS` or `=ALL` - * + INKCPP_INKLECATE: (NONE|OS|ALL) download the current supported inklecate version from the official [release page](https://github.com/inkle/ink/releases/latest)
- * They are stored at `/inklecate//` and will be automatcilly used for the tests + * + INKCPP_INKLECATE: (NONE|OS|ALL) download the current supported inklecate version from the + * official [release page](https://github.com/inkle/ink/releases/latest)
They are stored at + * `/inklecate//` and will be automatcilly used for the tests * + NONE: disable this function * + OS: only the version supported for the OS * + ALL: all versions @@ -177,8 +179,9 @@ class story * * @section ue Unreal Installation * - * The easiest way is to install it via the [unreal marcetplace](https://www.unrealengine.com/marketplace/en-US/product/inkcpp). - * The overview to the UE Blueprint class and examples can be found at @ref unreal "here". + * The easiest way is to install it via the [unreal + * marcetplace](https://www.unrealengine.com/marketplace/en-US/product/inkcpp). The overview to the + * UE Blueprint class and examples can be found at @ref unreal "here". * * The current release is also available at the [release * page](https://github.com/JBenda/inkcpp/releases/latest), as `unreal.zip`.
diff --git a/inkcpp_cl/CMakeLists.txt b/inkcpp_cl/CMakeLists.txt index 2a433ca8..eea6a759 100644 --- a/inkcpp_cl/CMakeLists.txt +++ b/inkcpp_cl/CMakeLists.txt @@ -18,6 +18,7 @@ endif() # Install install(TARGETS inkcpp_cl DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) string(TOUPPER "${INKCPP_INKLECATE}" inkcpp_inklecate_upper) +unset(inklecate_dir) if((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) if(UNIX AND NOT APPLE) FetchContent_GetProperties(inklecate_linux) @@ -41,6 +42,8 @@ if((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL " else() message(WARNING "Failed to determine OS for bundling inklecate with command line application!") endif() + if(inklecate_dir) + file(GLOB inklecate_files "${inklecate_dir}/*") + install(FILES ${inklecate_files} DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) + endif(inklecate_dir) endif((inkcpp_inklecate_upper STREQUAL "ALL") OR (inkcpp_inklecate_upper STREQUAL "OS")) -file(GLOB inklecate_files "${inklecate_dir}/*") -install(FILES ${inklecate_files} DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) diff --git a/inkcpp_cl/test.cpp b/inkcpp_cl/test.cpp index ae2155bc..00468a49 100644 --- a/inkcpp_cl/test.cpp +++ b/inkcpp_cl/test.cpp @@ -12,10 +12,12 @@ #include #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const char* inklecateOverwrite) +void inklecate( + const std::string& inkFilename, const std::string& jsonFilename, const char* inklecateOverwrite +) { // Get environment specific inklecate invocation command - + const char* inklecateCmd = nullptr; if (inklecateCmd == nullptr) { if (inklecateOverwrite) { diff --git a/inkcpp_cl/test.h b/inkcpp_cl/test.h index 4309a63d..d4c50344 100644 --- a/inkcpp_cl/test.h +++ b/inkcpp_cl/test.h @@ -1,6 +1,8 @@ #include -void inklecate(const std::string& inkFilename, const std::string& jsonFilename, const char* inkclecateOverwrite); +void inklecate( + const std::string& inkFilename, const std::string& jsonFilename, const char* inkclecateOverwrite +); // TODO: reevaluate in ink file test mechanism // bool test(const std::string& inkFilename); // bool test_directory(const std::string& directory); diff --git a/inkcpp_compiler/list_data.cpp b/inkcpp_compiler/list_data.cpp index 4062f4af..74b9d4d2 100644 --- a/inkcpp_compiler/list_data.cpp +++ b/inkcpp_compiler/list_data.cpp @@ -31,7 +31,8 @@ void list_data::new_flag(const std::string& flag_name, int value) &flag_name, list_flag{ .list_id = static_cast(_list_name.size() - 1), - .flag = static_cast(value)} + .flag = static_cast(value) + } ); } From f52b71ea1f91a4c179006eddb66950b8b64c4988 Mon Sep 17 00:00:00 2001 From: JBenda Date: Mon, 16 Sep 2024 16:27:23 +0200 Subject: [PATCH 6/6] format --- inkcpp_compiler/list_data.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inkcpp_compiler/list_data.cpp b/inkcpp_compiler/list_data.cpp index 74b9d4d2..4062f4af 100644 --- a/inkcpp_compiler/list_data.cpp +++ b/inkcpp_compiler/list_data.cpp @@ -31,8 +31,7 @@ void list_data::new_flag(const std::string& flag_name, int value) &flag_name, list_flag{ .list_id = static_cast(_list_name.size() - 1), - .flag = static_cast(value) - } + .flag = static_cast(value)} ); }