mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Added geometryc, shaderc just compiles vertexdecl.cpp, & misc cleanup
This commit is contained in:
4
cmake/3rdparty/fcpp.cmake
vendored
4
cmake/3rdparty/fcpp.cmake
vendored
@@ -8,6 +8,10 @@
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if( TARGET fcpp )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file( GLOB FCPP_SOURCES ${BGFX_DIR}/3rdparty/fcpp/*.c ${BGFX_DIR}/3rdparty/fcpp/*.h )
|
||||
|
||||
add_library( fcpp STATIC ${FCPP_SOURCES} )
|
||||
|
||||
19
cmake/3rdparty/forsyth-too.cmake
vendored
Normal file
19
cmake/3rdparty/forsyth-too.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# bgfx.cmake - bgfx building in cmake
|
||||
# Written in 2016 by Joshua Brookover <josh@jalb.me>
|
||||
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if( TARGET forsyth-too )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file( GLOB FORSYTH-TOO_SOURCES ${BGFX_DIR}/3rdparty/forsyth-too/*.cpp ${BGFX_DIR}/3rdparty/forsyth-too/*.h )
|
||||
|
||||
add_library( forsyth-too STATIC ${FORSYTH-TOO_SOURCES} )
|
||||
target_include_directories( forsyth-too PUBLIC ${BGFX_DIR}/3rdparty )
|
||||
set_target_properties( forsyth-too PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
4
cmake/3rdparty/glsl-optimizer.cmake
vendored
4
cmake/3rdparty/glsl-optimizer.cmake
vendored
@@ -8,6 +8,10 @@
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if( TARGET glsl-optimizer )
|
||||
return()
|
||||
endif()
|
||||
|
||||
set( GLSL-OPTIMIZER_INCLUDES
|
||||
${BGFX_DIR}/3rdparty/glsl-optimizer/include
|
||||
${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa
|
||||
|
||||
4
cmake/3rdparty/ib-compress.cmake
vendored
4
cmake/3rdparty/ib-compress.cmake
vendored
@@ -8,6 +8,10 @@
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if( TARGET ib-compress )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file( GLOB IB_COMPRESS_SOURCES ${BGFX_DIR}/3rdparty/ib-compress/*.cpp ${BGFX_DIR}/3rdparty/ib-compress/*.h )
|
||||
|
||||
add_library( ib-compress STATIC ${IB_COMPRESS_SOURCES} )
|
||||
|
||||
4
cmake/3rdparty/ocornut-imgui.cmake
vendored
4
cmake/3rdparty/ocornut-imgui.cmake
vendored
@@ -8,6 +8,10 @@
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
if( TARGET ocornut-imgui )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file( GLOB OCORNUT_IMGUI_SOURCES ${BGFX_DIR}/3rdparty/ocornut-imgui/*.cpp ${BGFX_DIR}/3rdparty/ocornut-imgui/*.h ${BGFX_DIR}/3rdparty/ocornut-imgui/*.inl )
|
||||
|
||||
add_library( ocornut-imgui STATIC ${OCORNUT_IMGUI_SOURCES} )
|
||||
|
||||
@@ -123,7 +123,7 @@ function( add_example ARG_NAME )
|
||||
endif()
|
||||
|
||||
# Directory name
|
||||
set_target_properties( example-${ARG_NAME} PROPERTIES FOLDER "examples" )
|
||||
set_target_properties( example-${ARG_NAME} PROPERTIES FOLDER "bgfx/examples" )
|
||||
endfunction()
|
||||
|
||||
# Add common library for examples
|
||||
|
||||
18
cmake/shared.cmake
Normal file
18
cmake/shared.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# bgfx.cmake - bgfx building in cmake
|
||||
# Written in 2016 by Joshua Brookover <josh@jalb.me>
|
||||
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
add_library( bgfx-vertexdecl INTERFACE )
|
||||
target_sources( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/src/vertexdecl.cpp )
|
||||
target_include_directories( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/include )
|
||||
|
||||
add_library( bgfx-bounds INTERFACE )
|
||||
target_sources( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common/bounds.cpp )
|
||||
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/include )
|
||||
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common )
|
||||
@@ -8,4 +8,5 @@
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
include( cmake/tools/geometryc.cmake )
|
||||
include( cmake/tools/shaderc.cmake )
|
||||
|
||||
19
cmake/tools/geometryc.cmake
Normal file
19
cmake/tools/geometryc.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
# bgfx.cmake - bgfx building in cmake
|
||||
# Written in 2016 by Joshua Brookover <josh@jalb.me>
|
||||
|
||||
# To the extent possible under law, the author(s) have dedicated all copyright
|
||||
# and related and neighboring rights to this software to the public domain
|
||||
# worldwide. This software is distributed without any warranty.
|
||||
|
||||
# You should have received a copy of the CC0 Public Domain Dedication along with
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
include( CMakeParseArguments )
|
||||
|
||||
include( cmake/3rdparty/forsyth-too.cmake )
|
||||
include( cmake/3rdparty/ib-compress.cmake )
|
||||
|
||||
add_executable( geometryc bgfx/tools/geometryc/geometryc.cpp )
|
||||
target_compile_definitions( geometryc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )
|
||||
set_target_properties( geometryc PROPERTIES FOLDER "bgfx/tools" )
|
||||
target_link_libraries( geometryc bx bgfx-bounds bgfx-vertexdecl forsyth-too ib-compress )
|
||||
@@ -16,7 +16,7 @@ include( cmake/3rdparty/glsl-optimizer.cmake )
|
||||
add_executable( shaderc bgfx/tools/shaderc/shaderc.cpp bgfx/tools/shaderc/shaderc.h bgfx/tools/shaderc/shaderc_glsl.cpp bgfx/tools/shaderc/shaderc_hlsl.cpp )
|
||||
target_compile_definitions( shaderc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )
|
||||
set_target_properties( shaderc PROPERTIES FOLDER "bgfx/tools" )
|
||||
target_link_libraries( shaderc bx bgfx fcpp glsl-optimizer )
|
||||
target_link_libraries( shaderc bx bgfx-vertexdecl fcpp glsl-optimizer )
|
||||
|
||||
function( add_shader ARG_FILE )
|
||||
# Parse arguments
|
||||
|
||||
Reference in New Issue
Block a user