mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Use configure_file instead of file WRITE to write generated files. (#61)
This commit is contained in:
committed by
widberg
parent
f23cf9bf17
commit
2539947609
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,5 +10,6 @@ Release/
|
|||||||
*.sln
|
*.sln
|
||||||
install/
|
install/
|
||||||
install_manifest.txt
|
install_manifest.txt
|
||||||
generated/
|
generated/*
|
||||||
|
!generated/*.in
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
|
|||||||
@@ -9,17 +9,20 @@
|
|||||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
|
||||||
add_library( bgfx-vertexdecl INTERFACE )
|
add_library( bgfx-vertexdecl INTERFACE )
|
||||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated/vertexdecl.cpp "#include \"${BGFX_DIR}/src/vertexdecl.cpp\"" )
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/vertexdecl.cpp.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/generated/vertexdecl.cpp )
|
||||||
target_sources( bgfx-vertexdecl INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/vertexdecl.cpp )
|
target_sources( bgfx-vertexdecl INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/vertexdecl.cpp )
|
||||||
target_include_directories( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/include )
|
target_include_directories( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/include )
|
||||||
|
|
||||||
add_library( bgfx-shader-spirv INTERFACE )
|
add_library( bgfx-shader-spirv INTERFACE )
|
||||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp "#include \"${BGFX_DIR}/src/shader_spirv.cpp\"" )
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/shader_spirv.cpp.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp )
|
||||||
target_sources( bgfx-shader-spirv INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp )
|
target_sources( bgfx-shader-spirv INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp )
|
||||||
target_include_directories( bgfx-shader-spirv INTERFACE ${BGFX_DIR}/include )
|
target_include_directories( bgfx-shader-spirv INTERFACE ${BGFX_DIR}/include )
|
||||||
|
|
||||||
add_library( bgfx-bounds INTERFACE )
|
add_library( bgfx-bounds INTERFACE )
|
||||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated/bounds.cpp "#include \"${BGFX_DIR}/examples/common/bounds.cpp\"" )
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/bounds.cpp.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/generated/bounds.cpp )
|
||||||
target_sources( bgfx-bounds INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/bounds.cpp )
|
target_sources( bgfx-bounds INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/bounds.cpp )
|
||||||
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/include )
|
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/include )
|
||||||
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common )
|
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common )
|
||||||
|
|||||||
1
generated/bounds.cpp.in
Normal file
1
generated/bounds.cpp.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "@BGFX_DIR@/examples/common/bounds.cpp"
|
||||||
1
generated/shader_spirv.cpp.in
Normal file
1
generated/shader_spirv.cpp.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "@BGFX_DIR@/src/shader_spirv.cpp"
|
||||||
1
generated/vertexdecl.cpp.in
Normal file
1
generated/vertexdecl.cpp.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "@BGFX_DIR@/src/vertexdecl.cpp"
|
||||||
Reference in New Issue
Block a user