From 710e6dec7701aca9c0a421b8975c17dc814951b2 Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Wed, 8 Jun 2022 15:55:43 +0200 Subject: [PATCH 1/9] First build stuff? --- CMakeLists.txt | 13 ++++++++++++- inkcpp/CMakeLists.txt | 24 +++++++++++++++--------- inkcpp_cl/CMakeLists.txt | 2 +- inkcpp_compiler/CMakeLists.txt | 24 ++++++++++++++++-------- shared/CMakeLists.txt | 10 +++++++--- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c820b5e7..ee13e2d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.23) # Testing enabled enable_testing() @@ -7,6 +7,8 @@ enable_testing() project(inkcpp VERSION 0.1) SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD_REQUIRED ON) +SET(CMAKE_INSTALL_LIBRARY_DIR lib) +SET(CMAKE_INSTALL_INCLUDE_DIR include) # Add subdirectories add_subdirectory(shared) add_subdirectory(inkcpp) @@ -14,3 +16,12 @@ add_subdirectory(inkcpp_compiler) add_subdirectory(inkcpp_cl) add_subdirectory(inkcpp_test) add_subdirectory(unreal) + +# include(InstallRequiredSystemLibraries) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") +set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}") +set(CPACK_SOURCE_GENERATOR "ZIP") +set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +set(CPACK_COMPONENTS_GROUPING IGNORE) +include(CPack) diff --git a/inkcpp/CMakeLists.txt b/inkcpp/CMakeLists.txt index 0e4a426d..6a325e9b 100644 --- a/inkcpp/CMakeLists.txt +++ b/inkcpp/CMakeLists.txt @@ -26,20 +26,26 @@ list(APPEND SOURCES ) source_group(Collections REGULAR_EXPRESSION collections/.*) add_library(inkcpp ${SOURCES}) +FILE(GLOB PUB_HEADER "include/*") +target_sources(inkcpp + PUBLIC FILE_SET HEADERS BASE_DIRS include FILES ${PUB_HEADER} +) # Make sure the include directory is included -target_include_directories(inkcpp - PUBLIC include - PUBLIC ../shared/public - PRIVATE ../shared/private - ) - +target_link_libraries(inkcpp inkcpp_shared) # Make sure this project and all dependencies use the C++17 standard target_compile_features(inkcpp PUBLIC cxx_std_17) # Default installation -install(TARGETS inkcpp DESTINATION lib) +install(TARGETS inkcpp + FILE_SET HEADERS + DESTINATION "${CMAKE_INSTALL_INCLUDE_DIR}/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL) +install(TARGETS inkcpp + DESTINATION "${CMAKE_INSTALL_LIBRARY_DIR}/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL +) # Unreal installation -install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp/Public/ink/" COMPONENT unreal) -install(FILES ${SOURCES} DESTINATION "inkcpp/Source/inkcpp/Private/ink/" COMPONENT unreal) +install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp/Public/ink/" COMPONENT unreal EXCLUDE_FROM_ALL) +install(FILES ${SOURCES} DESTINATION "inkcpp/Source/inkcpp/Private/ink/" COMPONENT unreal EXCLUDE_FROM_ALL) diff --git a/inkcpp_cl/CMakeLists.txt b/inkcpp_cl/CMakeLists.txt index c9c0e338..95719b7d 100644 --- a/inkcpp_cl/CMakeLists.txt +++ b/inkcpp_cl/CMakeLists.txt @@ -16,4 +16,4 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() # Install -install(TARGETS inkcpp_cl DESTINATION bin) +install(TARGETS inkcpp_cl DESTINATION . COMPONENT cl EXCLUDE_FROM_ALL) diff --git a/inkcpp_compiler/CMakeLists.txt b/inkcpp_compiler/CMakeLists.txt index 8a4c6205..889eee41 100644 --- a/inkcpp_compiler/CMakeLists.txt +++ b/inkcpp_compiler/CMakeLists.txt @@ -1,4 +1,6 @@ -list(APPEND SOURCES +cmake_minimum_required(VERSION 3.23.2) + +list(APPEND SOURCES compiler.cpp binary_stream.h binary_stream.cpp json.hpp json_compiler.h json_compiler.cpp emitter.h emitter.cpp @@ -10,19 +12,25 @@ list(APPEND SOURCES ) add_definitions(-DINK_COMPILER -DINK_EXPOSE_JSON) add_library(inkcpp_compiler ${SOURCES}) +FILE(GLOB PUB_HEADER "include/*") +target_sources(inkcpp_compiler + PUBLIC FILE_SET HEADERS BASE_DIRS include FILES ${PUB_HEADER} +) -# Make sure the include directory is included -target_include_directories(inkcpp_compiler - PUBLIC include - PUBLIC ../shared/public - PRIVATE ../shared/private - ) +target_link_libraries(inkcpp_compiler inkcpp_shared) # Make sure this project and all dependencies use the C++17 standard target_compile_features(inkcpp_compiler PUBLIC cxx_std_17) # Default installation -install(TARGETS inkcpp_compiler DESTINATION lib) +install(TARGETS inkcpp_compiler + FILE_SET HEADERS + DESTINATION "${CMAKE_INSTALL_INCLUDE_DIR}/inkcpp/compiler" + COMPONENT lib EXCLUDE_FROM_ALL) +install(TARGETS inkcpp_compiler + DESTINATION "${CMAKE_INSTALL_LIBRARY_DIR}/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL +) # Unreal installation install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal) diff --git a/shared/CMakeLists.txt b/shared/CMakeLists.txt index 616f643f..de4db6cb 100644 --- a/shared/CMakeLists.txt +++ b/shared/CMakeLists.txt @@ -1,6 +1,10 @@ +add_library(inkcpp_shared INTERFACE) +target_include_directories(inkcpp_shared INTERFACE public private) +FILE(GLOB PUBLIC_HEADERS "public/*") # Install public files into the include directory -install(DIRECTORY public DESTINATION include) +install(FILES ${PUBLIC_HEADERS} + DESTINATION "include/inkcpp" COMPONENT lib EXCLUDE_FROM_ALL) # Unreal installation -install(DIRECTORY "public/" DESTINATION "inkcpp/Source/shared/Public/" COMPONENT unreal) -install(DIRECTORY "private/" DESTINATION "inkcpp/Source/shared/Private/" COMPONENT unreal) \ No newline at end of file +install(DIRECTORY "public/" DESTINATION "inkcpp/Source/shared/Public/" COMPONENT unreal EXCLUDE_FROM_ALL) +install(DIRECTORY "private/" DESTINATION "inkcpp/Source/shared/Private/" COMPONENT unreal EXCLUDE_FROM_ALL) From 8483973f3ed4bfe0ce7828cb5c88d95b4168294e Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 9 Jun 2022 11:38:44 +0200 Subject: [PATCH 2/9] Working multi target build --- CMakeLists.txt | 32 +++++++++++++++++++++++++++++++- Config.cmake.in | 2 ++ inkcpp/CMakeLists.txt | 19 ++++++------------- inkcpp/functional.cpp | 8 ++++++++ inkcpp_cl/CMakeLists.txt | 2 +- inkcpp_compiler/CMakeLists.txt | 21 +++++++-------------- inkcpp_test/CMakeLists.txt | 2 +- shared/CMakeLists.txt | 12 ++++++++---- 8 files changed, 64 insertions(+), 34 deletions(-) create mode 100644 Config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ee13e2d8..10d6052e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.23) +cmake_minimum_required(VERSION 3.16) # Testing enabled enable_testing() @@ -25,3 +25,33 @@ set(CPACK_SOURCE_GENERATOR "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_GROUPING IGNORE) include(CPack) + +get_target_property(TEE inkcpp PUBLIC_HEADER) +install(TARGETS inkcpp inkcpp_compiler inkcpp_shared + EXPORT inkcppTarget + ARCHIVE DESTINATION "lib/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL + PUBLIC_HEADER DESTINATION "include/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL +) + +install(EXPORT inkcppTarget + FILE inkcppTargets.cmake DESTINATION "lib/cmake/inkcpp" + COMPONENT lib EXCLUDE_FROM_ALL) + +include(CMakePackageConfigHelpers) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake" + INSTALL_DESTINATION "lib/cmake/inkcpp" + NO_SET_AND_CHECK_MACRO + NO_CHECK_REQUIRED_COMPONENTS_MACRO) +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake" + VERSION "${inkcpp_VERSION_MAJOR}.${inkcpp_VERSION_MINOR}" + COMPATIBILITY AnyNewerVersion) +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake + DESTINATION lib/cmake/inkcpp COMPONENT lib EXCLUDE_FROM_ALL) +export(EXPORT inkcppTarget + FILE "${CMAKE_CURRENT_BINARY_DIR}/inkcppTargets.cmake") diff --git a/Config.cmake.in b/Config.cmake.in new file mode 100644 index 00000000..6cb414fc --- /dev/null +++ b/Config.cmake.in @@ -0,0 +1,2 @@ +@PACKAGE_INIT@ +include ( "${CMAKE_CURRENT_LIST_DIR}/inkcppTargets.cmake" ) diff --git a/inkcpp/CMakeLists.txt b/inkcpp/CMakeLists.txt index 6a325e9b..876b6b18 100644 --- a/inkcpp/CMakeLists.txt +++ b/inkcpp/CMakeLists.txt @@ -26,25 +26,18 @@ list(APPEND SOURCES ) source_group(Collections REGULAR_EXPRESSION collections/.*) add_library(inkcpp ${SOURCES}) -FILE(GLOB PUB_HEADER "include/*") -target_sources(inkcpp - PUBLIC FILE_SET HEADERS BASE_DIRS include FILES ${PUB_HEADER} +target_include_directories(inkcpp PUBLIC + $ + $ ) +FILE(GLOB PUBLIC_HEADERS "include/*") +set_target_properties(inkcpp PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") # Make sure the include directory is included -target_link_libraries(inkcpp inkcpp_shared) +target_link_libraries(inkcpp PRIVATE inkcpp_shared) # Make sure this project and all dependencies use the C++17 standard target_compile_features(inkcpp PUBLIC cxx_std_17) -# Default installation -install(TARGETS inkcpp - FILE_SET HEADERS - DESTINATION "${CMAKE_INSTALL_INCLUDE_DIR}/inkcpp" - COMPONENT lib EXCLUDE_FROM_ALL) -install(TARGETS inkcpp - DESTINATION "${CMAKE_INSTALL_LIBRARY_DIR}/inkcpp" - COMPONENT lib EXCLUDE_FROM_ALL -) # Unreal installation install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp/Public/ink/" COMPONENT unreal EXCLUDE_FROM_ALL) diff --git a/inkcpp/functional.cpp b/inkcpp/functional.cpp index 0fe4cc69..9c0cad62 100644 --- a/inkcpp/functional.cpp +++ b/inkcpp/functional.cpp @@ -18,6 +18,14 @@ namespace ink::runtime::internal return val.get(); } + template<> + const char* function_base::pop(basic_eval_stack* stack) + { + value val = stack->pop(); + inkAssert(val.type() == value_type::string, "Type missmatch!"); + return val.get().str; + } + template<> void function_base::push(basic_eval_stack* stack, const int32_t& v) { diff --git a/inkcpp_cl/CMakeLists.txt b/inkcpp_cl/CMakeLists.txt index 95719b7d..5483a05d 100644 --- a/inkcpp_cl/CMakeLists.txt +++ b/inkcpp_cl/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(inkcpp_cl inkcpp_cl.cpp test.h test.cpp) # Include compiler and runtime libraries -target_link_libraries(inkcpp_cl PUBLIC inkcpp inkcpp_compiler) +target_link_libraries(inkcpp_cl PUBLIC inkcpp inkcpp_compiler inkcpp_shared) # For https://en.cppreference.com/w/cpp/filesystem#Notes if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/inkcpp_compiler/CMakeLists.txt b/inkcpp_compiler/CMakeLists.txt index 889eee41..31029f71 100644 --- a/inkcpp_compiler/CMakeLists.txt +++ b/inkcpp_compiler/CMakeLists.txt @@ -12,26 +12,19 @@ list(APPEND SOURCES ) add_definitions(-DINK_COMPILER -DINK_EXPOSE_JSON) add_library(inkcpp_compiler ${SOURCES}) -FILE(GLOB PUB_HEADER "include/*") -target_sources(inkcpp_compiler - PUBLIC FILE_SET HEADERS BASE_DIRS include FILES ${PUB_HEADER} + +target_include_directories(inkcpp_compiler PUBLIC + $ + $ ) +FILE(GLOB PUBLIC_HEADERS "include/*") +set_target_properties(inkcpp_compiler PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") -target_link_libraries(inkcpp_compiler inkcpp_shared) +target_link_libraries(inkcpp_compiler PRIVATE inkcpp_shared) # Make sure this project and all dependencies use the C++17 standard target_compile_features(inkcpp_compiler PUBLIC cxx_std_17) -# Default installation -install(TARGETS inkcpp_compiler - FILE_SET HEADERS - DESTINATION "${CMAKE_INSTALL_INCLUDE_DIR}/inkcpp/compiler" - COMPONENT lib EXCLUDE_FROM_ALL) -install(TARGETS inkcpp_compiler - DESTINATION "${CMAKE_INSTALL_LIBRARY_DIR}/inkcpp" - COMPONENT lib EXCLUDE_FROM_ALL -) - # Unreal installation install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal) install(FILES ${SOURCES} DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal) diff --git a/inkcpp_test/CMakeLists.txt b/inkcpp_test/CMakeLists.txt index 92e0c6ed..4ee6fbb6 100644 --- a/inkcpp_test/CMakeLists.txt +++ b/inkcpp_test/CMakeLists.txt @@ -11,7 +11,7 @@ add_executable(inkcpp_test catch.hpp Main.cpp NewLines.cpp ) -target_link_libraries(inkcpp_test PUBLIC inkcpp inkcpp_compiler) +target_link_libraries(inkcpp_test PUBLIC inkcpp inkcpp_compiler inkcpp_shared) target_include_directories(inkcpp_test PRIVATE ../shared/private/) # For https://en.cppreference.com/w/cpp/filesystem#Notes diff --git a/shared/CMakeLists.txt b/shared/CMakeLists.txt index de4db6cb..e01c32c0 100644 --- a/shared/CMakeLists.txt +++ b/shared/CMakeLists.txt @@ -1,9 +1,13 @@ add_library(inkcpp_shared INTERFACE) -target_include_directories(inkcpp_shared INTERFACE public private) + +target_include_directories(inkcpp_shared + INTERFACE + $ + $ + $ +) FILE(GLOB PUBLIC_HEADERS "public/*") -# Install public files into the include directory -install(FILES ${PUBLIC_HEADERS} - DESTINATION "include/inkcpp" COMPONENT lib EXCLUDE_FROM_ALL) +set_target_properties(inkcpp_shared PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") # Unreal installation install(DIRECTORY "public/" DESTINATION "inkcpp/Source/shared/Public/" COMPONENT unreal EXCLUDE_FROM_ALL) From ee98551c9d3a5f2cea9c91ffeb636aa0bcb777f6 Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 9 Jun 2022 11:40:40 +0200 Subject: [PATCH 3/9] Remove Unreal from all build --- inkcpp_compiler/CMakeLists.txt | 4 ++-- unreal/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inkcpp_compiler/CMakeLists.txt b/inkcpp_compiler/CMakeLists.txt index 31029f71..afd661c3 100644 --- a/inkcpp_compiler/CMakeLists.txt +++ b/inkcpp_compiler/CMakeLists.txt @@ -26,5 +26,5 @@ target_link_libraries(inkcpp_compiler PRIVATE inkcpp_shared) target_compile_features(inkcpp_compiler PUBLIC cxx_std_17) # Unreal installation -install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal) -install(FILES ${SOURCES} DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal) +install(DIRECTORY "include/" DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal EXCLUDE_FROM_ALL) +install(FILES ${SOURCES} DESTINATION "inkcpp/Source/inkcpp_editor/Private/ink/" COMPONENT unreal EXCLUDE_FROM_ALL) diff --git a/unreal/CMakeLists.txt b/unreal/CMakeLists.txt index cdebc57c..91909cea 100644 --- a/unreal/CMakeLists.txt +++ b/unreal/CMakeLists.txt @@ -1,2 +1,2 @@ # Copy files into destination directory -install(DIRECTORY "inkcpp/" DESTINATION "inkcpp" COMPONENT unreal) \ No newline at end of file +install(DIRECTORY "inkcpp/" DESTINATION "inkcpp" COMPONENT unreal EXCLUDE_FROM_ALL) From e3f956313bc97645179b21be6cf9818a88d215d8 Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 9 Jun 2022 11:48:19 +0200 Subject: [PATCH 4/9] Reorder install and cpack to include lib in cpack --- CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10d6052e..917f6392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,14 +17,6 @@ add_subdirectory(inkcpp_cl) add_subdirectory(inkcpp_test) add_subdirectory(unreal) -# include(InstallRequiredSystemLibraries) -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") -set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}") -set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}") -set(CPACK_SOURCE_GENERATOR "ZIP") -set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) -set(CPACK_COMPONENTS_GROUPING IGNORE) -include(CPack) get_target_property(TEE inkcpp PUBLIC_HEADER) install(TARGETS inkcpp inkcpp_compiler inkcpp_shared @@ -55,3 +47,12 @@ install(FILES DESTINATION lib/cmake/inkcpp COMPONENT lib EXCLUDE_FROM_ALL) export(EXPORT inkcppTarget FILE "${CMAKE_CURRENT_BINARY_DIR}/inkcppTargets.cmake") + +# include(InstallRequiredSystemLibraries) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") +set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}") +set(CPACK_SOURCE_GENERATOR "ZIP") +set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +set(CPACK_COMPONENTS_GROUPING IGNORE) +include(CPack) From 586ef6511e1148e0c74b8b8c859d669ee469c354 Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 9 Jun 2022 11:49:28 +0200 Subject: [PATCH 5/9] remove wrong required version --- inkcpp_compiler/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/inkcpp_compiler/CMakeLists.txt b/inkcpp_compiler/CMakeLists.txt index afd661c3..b3da94dc 100644 --- a/inkcpp_compiler/CMakeLists.txt +++ b/inkcpp_compiler/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.23.2) - list(APPEND SOURCES compiler.cpp binary_stream.h binary_stream.cpp json.hpp json_compiler.h json_compiler.cpp From 98112280717eebda660e5389fcece77c73c893fb Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Thu, 9 Jun 2022 11:54:03 +0200 Subject: [PATCH 6/9] Use ZIP as default cpack generator --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 917f6392..c21014da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,7 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}") set(CPACK_SOURCE_GENERATOR "ZIP") +set(CPACK_GENERATOR "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_GROUPING IGNORE) include(CPack) From 2fb93f548105713e0baaa4640f2f18bb7f294c27 Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Mon, 13 Jun 2022 18:43:54 +0200 Subject: [PATCH 7/9] Update github/workflows to new build components --- .github/workflows/build.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20044156..78376445 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,14 +23,12 @@ jobs: - os: windows-latest artifact: win64 name: Windows x64 - inklecate_url: https://github.com/inkle/ink/releases/download/0.9.0/inklecate_windows_and_linux.zip + inklecate_url: https://github.com/inkle/ink/releases/download/v1.0.0/inklecate_windows.zip proof: false - os: "ubuntu-20.04" artifact: linux name: Linux x64 - inklecate_url: https://github.com/inkle/ink/releases/download/0.9.0/inklecate_windows_and_linux.zip - inklecate_pre: "mono " - inklecate_post: ".exe" + inklecate_url: https://github.com/inkle/ink/releases/download/v1.0.0/inklecate_linux.zip proof: true steps: @@ -94,7 +92,7 @@ jobs: - name: Install working-directory: ${{github.workspace}}/build shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix bin + run: cmake --install . --config $BUILD_TYPE --prefix bin --component cl # Upload bin directory as artifact - name: Upload Binary Artifact @@ -113,7 +111,7 @@ jobs: cp ../inkcpp_runtime_driver drivers/ chmod +x drivers/inkcpp_runtime_driver mkdir deps/inkcpp - cp ../../build/bin/bin/* deps/inkcpp/ + cp ../../build/bin/* deps/inkcpp/ chmod +x deps/inkcpp/inkcpp_cl # Run it From 4fa2b194aca9e2f051882f6a4c8acd34067b305a Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Mon, 4 Jul 2022 18:01:47 +0200 Subject: [PATCH 8/9] update building advices --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c21014da..59541441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ add_subdirectory(unreal) get_target_property(TEE inkcpp PUBLIC_HEADER) install(TARGETS inkcpp inkcpp_compiler inkcpp_shared EXPORT inkcppTarget - ARCHIVE DESTINATION "lib/inkcpp" + ARCHIVE DESTINATION "lib/ink" COMPONENT lib EXCLUDE_FROM_ALL - PUBLIC_HEADER DESTINATION "include/inkcpp" + PUBLIC_HEADER DESTINATION "include/ink" COMPONENT lib EXCLUDE_FROM_ALL ) From 1722f0b9a73e415ad3fb5de3ef6839f9b42c7b1c Mon Sep 17 00:00:00 2001 From: Julian Benda Date: Tue, 12 Jul 2022 12:23:20 +0200 Subject: [PATCH 9/9] update README --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3eef40a9..35195eaa 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,8 @@ CMake will then generate the necessary build files for your environment. By defa To build, either run the generated buildfiles OR you can use `cmake --build . --config ` from the build folder to automatically execute the relevant toolchain. +For a more in depth installation description please checkout the (wiki)[https://github.com/brwarner/inkcpp/wiki/building]. + ## Including in C++ Code Required software: (CMake)[https://cmake.org/] @@ -89,15 +91,15 @@ Instructions: 1. Clone the repository 2. Configure and build the project with CMake, as described above -3. From your newly-created `build` directory, run `cmake --install . --prefix Path/To/Desired/Library/Directory`. Note that this will currently fail if the project was built for Debug instead of Release. +3. From your newly-created `build` directory, run `cmake --install . --prefix Path/To/Desired/Library/Directory --component `. 4. Generated in your chosen directory, you will find a collection of folders. The following must be linked into your build solution for your C++ to compile correctly: - - `include/public`: contains important shared headers. - + For a Visual Studio project, link this directory as an Include Directory in VC++ Directories. - - `inkcpp/Source/inkcpp/Public`: contains the primary headers for using InkCPP in your code. + - `include/ink`: contains important shared headers. + For a Visual Studio project, link this directory as an Include Directory in VC++ Directories. - `lib/inkcpp.lib` and `lib/inkcpp_compiler.lib`: contains the library code for the InkCPP runner and compiler, respectively. + For a Visual Studio project, link these files as Additional Dependencies in Linker->Input. + You don't need to link the compiler if you're not using it within your program. + - if you used the `cl` component you will find the `inkcpp_cl` executable in this location + - for `unreal` you will find a `Source` directory containing the Unreal needed libs and headers. **Note:** not working for the current unreal version, we are working to fix this. 5. Reference the headers in your code like so: ```cpp @@ -106,6 +108,7 @@ Instructions: #include #include ``` +6. if you use cmake checkout the (wiki)[https://github.com/brwarner/inkcpp/wiki/building#cmake-example] for including the library via cmake ### Troubleshooting