diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-02-13 04:51:23 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-02-13 04:51:23 +0000 |
| commit | a6e0668626de73d6d35f14a2fb9d3ee9a73e8ae3 (patch) | |
| tree | 4c188db4f8b1833324034ee7239c056cda4d2f53 /unityplugin/GhostCubePlugin/PluginSource | |
| parent | Disabled Development Team attribute in iOS cmake build file (diff) | |
| download | DiligentEngine-a6e0668626de73d6d35f14a2fb9d3ee9a73e8ae3.tar.gz DiligentEngine-a6e0668626de73d6d35f14a2fb9d3ee9a73e8ae3.zip | |
Fixed formatting of cmake files + some minor updates
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
| -rw-r--r-- | unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt | 136 |
1 files changed, 70 insertions, 66 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt index 95871e8..7fe077c 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt +++ b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt @@ -3,132 +3,136 @@ cmake_minimum_required (VERSION 3.6) project(GhostCubePlugin CXX) set(SOURCE - src/RenderAPI.cpp - src/RenderingPlugin.cpp - src/SamplePlugin.cpp + src/RenderAPI.cpp + src/RenderingPlugin.cpp + src/SamplePlugin.cpp ) set(INCLUDE - src/PlatformBase.h - src/RenderAPI.h - src/SamplePlugin.h + src/PlatformBase.h + src/RenderAPI.h + src/SamplePlugin.h ) if(D3D11_SUPPORTED) - list(APPEND SOURCE src/RenderAPI_D3D11.cpp) + list(APPEND SOURCE src/RenderAPI_D3D11.cpp) endif() if(D3D12_SUPPORTED) - list(APPEND SOURCE src/RenderAPI_D3D12.cpp) + list(APPEND SOURCE src/RenderAPI_D3D12.cpp) endif() if(GL_SUPPORTED OR GLES_SUPPORTED) - list(APPEND SOURCE src/RenderAPI_OpenGLCoreES.cpp) + list(APPEND SOURCE src/RenderAPI_OpenGLCoreES.cpp) endif() set(UNITY_INTERFACES - src/Unity/IUnityGraphics.h - src/Unity/IUnityGraphicsD3D9.h - src/Unity/IUnityGraphicsD3D11.h - src/Unity/IUnityGraphicsD3D12.h - src/Unity/IUnityGraphicsMetal.h - src/Unity/IUnityInterface.h + src/Unity/IUnityGraphics.h + src/Unity/IUnityGraphicsD3D9.h + src/Unity/IUnityGraphicsD3D11.h + src/Unity/IUnityGraphicsD3D12.h + src/Unity/IUnityGraphicsMetal.h + src/Unity/IUnityInterface.h ) add_library(GhostCubePlugin-shared SHARED - ${SOURCE} ${INCLUDE} ${UNITY_INTERFACES} + ${SOURCE} ${INCLUDE} ${UNITY_INTERFACES} ) set(DLL_REL_SUFFIX _${ARCH}r) set(DLL_DBG_SUFFIX _${ARCH}d) set_target_properties(GhostCubePlugin-shared PROPERTIES - OUTPUT_NAME_DEBUG GhostCubePlugin${DLL_DBG_SUFFIX} - OUTPUT_NAME_RELEASE GhostCubePlugin${DLL_REL_SUFFIX} - OUTPUT_NAME_RELWITHDEBINFO GhostCubePlugin${DLL_REL_SUFFIX} - OUTPUT_NAME_MINSIZEREL GhostCubePlugin${DLL_REL_SUFFIX} + OUTPUT_NAME_DEBUG GhostCubePlugin${DLL_DBG_SUFFIX} + OUTPUT_NAME_RELEASE GhostCubePlugin${DLL_REL_SUFFIX} + OUTPUT_NAME_RELWITHDEBINFO GhostCubePlugin${DLL_REL_SUFFIX} + OUTPUT_NAME_MINSIZEREL GhostCubePlugin${DLL_REL_SUFFIX} ) if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) - target_sources(GhostCubePlugin-shared - PRIVATE - src/RenderingPlugin.def - ) - source_group("src" FILES src/RenderingPlugin.def) + target_sources(GhostCubePlugin-shared + PRIVATE + src/RenderingPlugin.def + ) + source_group("src" FILES src/RenderingPlugin.def) endif() target_link_libraries(GhostCubePlugin-shared PRIVATE - BuildSettings - TargetPlatform - Common - GraphicsAccessories - GraphicsTools + BuildSettings + TargetPlatform + Common + GraphicsAccessories + GraphicsTools ) if(D3D11_SUPPORTED) - target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineD3D11-static) + target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineD3D11-static) endif() if(D3D12_SUPPORTED) - target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineD3D12-static) + target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineD3D12-static) endif() if(GL_SUPPORTED OR GLES_SUPPORTED) - target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineOpenGL-static) + target_link_libraries(GhostCubePlugin-shared PRIVATE GraphicsEngineOpenGL-static) endif() set_common_target_properties(GhostCubePlugin-shared) if(MSVC) - # Disable MSVC-specific warnings - # - w4201: nonstandard extension used: nameless struct/unio - target_compile_options(GhostCubePlugin-shared PRIVATE /wd4201) - if(PLATFORM_UNIVERSAL_WINDOWS) - target_compile_definitions(GhostCubePlugin-shared PRIVATE WINDOWS_UWP UNITY_METRO) - endif() + # Disable MSVC-specific warnings + # - w4201: nonstandard extension used: nameless struct/unio + target_compile_options(GhostCubePlugin-shared PRIVATE /wd4201) + if(PLATFORM_UNIVERSAL_WINDOWS) + target_compile_definitions(GhostCubePlugin-shared PRIVATE WINDOWS_UWP UNITY_METRO) + endif() endif() if(PLATFORM_ANDROID) - target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_ANDROID) - set_target_properties(GhostCubePlugin-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden + target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_ANDROID) elseif(PLATFORM_LINUX) - target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_LINUX) - set_target_properties(GhostCubePlugin-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden + target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_LINUX) endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_target_properties(GhostCubePlugin-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden +endif() + + set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins) if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) - if(PLATFORM_WIN32) - if(ARCH EQUAL 64) - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86_64) - else() - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86) - endif() - elseif(PLATFORM_UNIVERSAL_WINDOWS) - if(ARCH EQUAL 64) - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x64) - else() - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x86) - endif() - endif() - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/GhostCubePlugin.dll) + if(PLATFORM_WIN32) + if(ARCH EQUAL 64) + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86_64) + else() + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/x86) + endif() + elseif(PLATFORM_UNIVERSAL_WINDOWS) + if(ARCH EQUAL 64) + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x64) + else() + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Metro/UWP/x86) + endif() + endif() + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/GhostCubePlugin.dll) elseif(PLATFORM_ANDROID) - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Android/libGhostCubePlugin.so) + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/Android/libGhostCubePlugin.so) elseif(PLATFORM_LINUX) - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/libGhostCubePlugin.so) + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/libGhostCubePlugin.so) elseif(PLATFORM_MACOS) - set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/MacOS/libGhostCubePlugin.so) + set(UNITY_PLUGIN_PATH ${UNITY_PLUGIN_PATH}/MacOS/libGhostCubePlugin.so) elseif(PLATFORM_IOS) - message(WARNING "No unity plugin path specified") + message(WARNING "No unity plugin path specified") else() - message(FATAL_ERROR "Unsupported platform") + 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}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "\"$<TARGET_FILE:GhostCubePlugin-shared>\"" + "${UNITY_PLUGIN_PATH}" ) source_group("src" FILES ${SOURCE}) @@ -136,5 +140,5 @@ source_group("include" FILES ${INCLUDE}) source_group("include\\Unity" FILES ${UNITY_INTERFACES}) set_target_properties(GhostCubePlugin-shared PROPERTIES - FOLDER Unity + FOLDER Unity ) |
