summaryrefslogtreecommitdiffstats
path: root/Graphics/HLSL2GLSLConverterLib
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-16 05:23:06 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-16 05:23:06 +0000
commit035dd284b70429c7a59237c1e6debc1663bd7e15 (patch)
treeb2d50e6c0141bfb8c403010831036799ac657411 /Graphics/HLSL2GLSLConverterLib
parentUpdated CMakeLists (diff)
downloadDiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.tar.gz
DiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.zip
CMake: enabling Android build
Diffstat (limited to 'Graphics/HLSL2GLSLConverterLib')
-rw-r--r--Graphics/HLSL2GLSLConverterLib/CMakeLists.txt48
1 files changed, 28 insertions, 20 deletions
diff --git a/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt b/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
index a2146be9..b3194592 100644
--- a/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
+++ b/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.6)
project(HLSL2GLSLConverterLib CXX)
@@ -42,25 +42,36 @@ PRIVATE
GraphicsTools
)
-# Create custom target to convert GLSLDefinitions.h to GLSLDefinitions_inc.h
-add_custom_target(ProcessGLSLDefinitions
-SOURCES
- include/GLSLDefinitions.h
-)
-add_dependencies(ProcessGLSLDefinitions File2String)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ # Create custom target to convert GLSLDefinitions.h to GLSLDefinitions_inc.h
+ add_custom_target(ProcessGLSLDefinitions
+ SOURCES
+ include/GLSLDefinitions.h
+ )
-add_custom_command(TARGET ProcessGLSLDefinitions
- # Unfortunately it is not possible to set TARGET directly to GraphicsEngineD3DBase
- # because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators
- # PRE_BUILD is treated as PRE_LINK.
- COMMAND COMMAND $<TARGET_FILE:File2String> include/GLSLDefinitions.h include/GLSLDefinitions_inc.h
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMENT "Processing GLSLDefinitions.h"
- VERBATIM
-)
+ if(PLATFORM_WIN32)
+ set(FILE2STRING_PATH $<TARGET_FILE:File2String>)
+ add_dependencies(ProcessGLSLDefinitions File2String)
+ else()
+ # We cannot run File2String utility and will use prebuilt Win32 version
+ set(FILE2STRING_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../Utilities/File2Include/bin/Win32/File2String.exe")
+ endif()
-add_dependencies(HLSL2GLSLConverterLib ProcessGLSLDefinitions)
+ add_custom_command(TARGET ProcessGLSLDefinitions
+ # Unfortunately it is not possible to set TARGET directly to GraphicsEngineD3DBase
+ # because PRE_BUILD is only supported on Visual Studio 8 or later. For all other generators
+ # PRE_BUILD is treated as PRE_LINK.
+ COMMAND COMMAND ${FILE2STRING_PATH} include/GLSLDefinitions.h include/GLSLDefinitions_inc.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Processing GLSLDefinitions.h"
+ VERBATIM
+ )
+ add_dependencies(HLSL2GLSLConverterLib ProcessGLSLDefinitions)
+ set_target_properties(ProcessGLSLDefinitions PROPERTIES
+ FOLDER Core/Graphics/Helper
+ )
+endif()
source_group("src" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
@@ -70,6 +81,3 @@ source_group("generated" FILES include/GLSLDefinitions_inc.h)
set_target_properties(HLSL2GLSLConverterLib PROPERTIES
FOLDER Core/Graphics
)
-set_target_properties(ProcessGLSLDefinitions PROPERTIES
- FOLDER Core/Graphics/Helper
-) \ No newline at end of file