Skip to content

Commit 26dc3b1

Browse files
committed
CMake updated to generate shaders
1 parent 49bc096 commit 26dc3b1

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

CMakeLists.txt

+33-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,29 @@ set(LIBRARY_SOURCES
9292
Src/VertexTypes.cpp
9393
Src/WICTextureLoader.cpp)
9494

95+
set(SHADER_SOURCES
96+
Src/Shaders/AlphaTestEffect.fx
97+
Src/Shaders/BasicEffect.fx
98+
Src/Shaders/Common.fxh
99+
Src/Shaders/DebugEffect.fx
100+
Src/Shaders/DGSLEffect.fx
101+
Src/Shaders/DGSLLambert.hlsl
102+
Src/Shaders/DGSLPhong.hlsl
103+
Src/Shaders/DGSLUnlit.hlsl
104+
Src/Shaders/DualTextureEffect.fx
105+
Src/Shaders/EnvironmentMapEffect.fx
106+
Src/Shaders/Lighting.fxh
107+
Src/Shaders/NormalMapEffect.fx
108+
Src/Shaders/PBRCommon.fxh
109+
Src/Shaders/PBREffect.fx
110+
Src/Shaders/PixelPacking_Velocity.hlsli
111+
Src/Shaders/PostProcess.fx
112+
Src/Shaders/SkinnedEffect.fx
113+
Src/Shaders/SpriteEffect.fx
114+
Src/Shaders/Structures.fxh
115+
Src/Shaders/ToneMap.fx
116+
Src/Shaders/Utilities.fxh)
117+
95118
if((BUILD_XAUDIO_WIN10 MATCHES ON) OR (BUILD_XAUDIO_WIN8 MATCHES ON))
96119
set(LIBRARY_SOURCES ${LIBRARY_SOURCES}
97120
Inc/Audio.h
@@ -108,7 +131,16 @@ if((BUILD_XAUDIO_WIN10 MATCHES ON) OR (BUILD_XAUDIO_WIN8 MATCHES ON))
108131
Audio/WAVFileReader.h)
109132
endif()
110133

111-
add_library(${PROJECT_NAME} STATIC ${LIBRARY_SOURCES})
134+
add_library(${PROJECT_NAME} STATIC ${LIBRARY_SOURCES} Src/Shaders/Compiled/SpriteEffect_SpriteVertexShader.inc)
135+
136+
add_custom_command(
137+
OUTPUT "${CMAKE_SOURCE_DIR}/Src/Shaders/Compiled/SpriteEffect_SpriteVertexShader.inc"
138+
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/Src/Shaders/CompileShaders.cmd"
139+
DEPENDS ${SHADER_SOURCES}
140+
COMMENT "Generating HLSL shaders..."
141+
COMMAND "CompileShaders.cmd"
142+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Src/Shaders"
143+
USES_TERMINAL)
112144

113145
source_group(Audio REGULAR_EXPRESSION Audio/*.*)
114146
source_group(Inc REGULAR_EXPRESSION Inc/*.*)

0 commit comments

Comments
 (0)