Skip to content

Commit 8ab0614

Browse files
committed
fix build
1 parent 25499a5 commit 8ab0614

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
171171
"${CSHARP_SYSTEM_LIBRARY}"
172172
"${CSHARP_UNITYEDITOR_LIBRARY}"
173173
"${CSHARP_UNITYENGINE_LIBRARY}"
174+
"${CSHARP_UNITYENGINE_TIMELINE_LIBRARY}"
175+
"${CSHARP_UNITYEDITOR_TIMELINE_LIBRARY}"
174176
DEPENDS
175177
"${CLASS_LIBRARY_DEST}"
176178
)

deps/cmake/FindUnity.cmake

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,44 @@ else()
6363
endif()
6464
endif()
6565

66+
if (DEFINED UNITY_EXTENSION_PATHS)
67+
message("Using ${UNITY_EXTENSION_PATHS}")
68+
else()
69+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
70+
# The editor is Unity.app/Contents/MacOS/Unity
71+
# The dlls are in Unity.app/Contents/UnityExtensions/.../*.dll
72+
get_filename_component(UNITY_EXTENSION_ROOT "${UNITY_EDITOR_PATH}" PATH)
73+
get_filename_component(UNITY_EXTENSION_ROOT "${UNITY_EXTENSION_ROOT}" DIRECTORY)
74+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/Editor")
75+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/RuntimeEditor")
76+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
77+
# The editor is .../Unity.exe
78+
# The dlls are in .../Editor/Data/.../*.dll
79+
get_filename_component(UNITY_EXTENSION_ROOT "${UNITY_EDITOR_PATH}" PATH)
80+
set(UNITY_EXTENSION_ROOT "${UNITY_EXTENSION_ROOT}/Editor/Data")
81+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/Editor")
82+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/RuntimeEditor")
83+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
84+
# The editor is .../Unity
85+
# The dlls are in .../Editor/Data/.../*.dll
86+
get_filename_component(UNITY_EXTENSION_ROOT "${UNITY_EDITOR_PATH}" PATH)
87+
set(UNITY_EXTENSION_ROOT "${UNITY_EXTENSION_ROOT}/Editor/Data")
88+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/Editor")
89+
list(APPEND UNITY_EXTENSION_PATHS "${UNITY_EXTENSION_ROOT}/UnityExtensions/Unity/Timeline/RuntimeEditor")
90+
endif()
91+
endif()
92+
93+
6694
# Look for a dll on all platforms.
67-
message("Looking for UnityEditor.dll in ${UNITY_EDITOR_DLL_PATH}")
95+
message("Looking for Unity*.dll in ${UNITY_EDITOR_DLL_PATH}
96+
97+
${UNITY_EXTENSION_PATHS}")
6898
set(_platformLibrarySuffix ${CMAKE_FIND_LIBRARY_SUFFIXES})
6999
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
70100
find_library(CSHARP_UNITYEDITOR_LIBRARY UnityEditor.dll PATH ${UNITY_EDITOR_DLL_PATH})
71101
find_library(CSHARP_UNITYENGINE_LIBRARY UnityEngine.dll PATH ${UNITY_EDITOR_DLL_PATH})
102+
find_library(CSHARP_UNITYEDITOR_TIMELINE_LIBRARY UnityEditor.Timeline.dll ${UNITY_EXTENSION_PATHS})
103+
find_library(CSHARP_UNITYENGINE_TIMELINE_LIBRARY UnityEngine.Timeline.dll ${UNITY_EXTENSION_PATHS})
72104
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_platformLibrarySuffix})
73105

74106
# Check whether we found everything we needed.

0 commit comments

Comments
 (0)