MikuAuahDark / Live2LOVE

LÖVE library to show Live2D Cubism models (WIP)
zlib License
25 stars 4 forks source link

Compatibility with Live2D Cubism 4 SDK #2

Open RW21 opened 1 year ago

RW21 commented 1 year ago

Hi, thanks for your cool project :+1: I'm not entirely certain about the accuracy of my findings, so I'm opting to leave an issue instead of a direct PR.

I confirmed that this is compatible with Live2D Cubism 4 SDK, with some tweaks needed:

I've only tested this with Linux, so I can't speak for its functionality with MSVC.

isncg commented 6 months ago

The cause of missing header file is that CMake script variable CSM_CORE_INCLUDE_DIR was not set, and it is better to fix include path instead of copy the header file. The CMakeLists.txt has checked the header file:

# Check Live2D source/header files
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/live2d/Core/include/Live2DCubismCore.h")
    message(FATAL_ERROR "Live2D Cubism 3 SDK for Native is missing!")
endif()

and includes these:

target_include_directories(Live2LOVE PRIVATE include live2d/Framework/src ${CSM_CORE_INCLUDE_DIR})

so, I tried to:

set(CSM_CORE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/live2d/Core/include)
# Check Live2D source/header files
if(NOT EXISTS "${CSM_CORE_INCLUDE_DIR}/Live2DCubismCore.h")
    message(FATAL_ERROR "Live2D Cubism 3 SDK for Native is missing!")
endif()
...
# add_subdirectory("live2d/Core")

and it compiles.