summaryrefslogtreecommitdiffstats
path: root/unityplugin/GhostCubePlugin/PluginSource
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-15 07:19:16 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-15 07:19:16 +0000
commit8c47bb06c2bb0ac4febef680fe297f2f7a9d5955 (patch)
tree40a57fa501b3c0d97995e14be1c22b18b64fbd78 /unityplugin/GhostCubePlugin/PluginSource
parentFixed content flag in GhostCubeScene UWP build (diff)
downloadDiligentEngine-8c47bb06c2bb0ac4febef680fe297f2f7a9d5955.tar.gz
DiligentEngine-8c47bb06c2bb0ac4febef680fe297f2f7a9d5955.zip
Fixed paths to copy Unity plugins to
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
-rw-r--r--unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt34
1 files changed, 20 insertions, 14 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
index a53e928..7b5b5a6 100644
--- a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
+++ b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
@@ -85,30 +85,36 @@ if(MSVC)
if(PLATFORM_UNIVERSAL_WINDOWS)
target_compile_definitions(GhostCubePlugin-shared PRIVATE WINDOWS_UWP UNITY_METRO)
endif()
+endif()
+set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins)
+if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
if(PLATFORM_WIN32)
- if(WIN64)
- set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins/x86_64/GhostCubePlugin.dll)
+ if(ARCH EQUAL 64)
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86_64)
else()
- set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins/x86/GhostCubePlugin.dll)
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86)
endif()
elseif(PLATFORM_UNIVERSAL_WINDOWS)
- if(WIN64)
- set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins/Metro/UWP/x86_64/GhostCubePlugin.dll)
+ if(ARCH EQUAL 64)
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x64)
else()
- set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins/Metro/UWP/x86/GhostCubePlugin.dll)
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x86)
endif()
- elseif(PLATFORM_ANDROID)
- set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins/Android/libGhostCubePlugin.so)
endif()
- add_custom_command(TARGET GhostCubePlugin-shared POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "\"$<TARGET_FILE:GhostCubePlugin-shared>\""
- "${UNITY_PLUGIN_PATH}"
- )
-
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/GhostCubePlugin.dll)
+elseif(PLATFORM_ANDROID)
+ set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Android/libGhostCubePlugin.so)
+else()
+ message(FATAL_ERROR "Unsupported platform")
endif()
+add_custom_command(TARGET GhostCubePlugin-shared POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "\"$<TARGET_FILE:GhostCubePlugin-shared>\""
+ "${UNITY_PLUGIN_PATH}"
+)
+
source_group("src" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
source_group("include\\Unity" FILES ${UNITY_INTERFACES})