Added custom targets "examples" and "tools"

This commit is contained in:
Joshua Brookover
2016-09-18 02:53:47 -05:00
parent 92aa04bd00
commit 785a7b0c3c
4 changed files with 8 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ function( add_example ARG_NAME )
if( MSVC )
set_target_properties( example-${ARG_NAME} PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"" )
endif()
add_dependencies( examples example-${ARG_NAME} )
endif()
# Configure shaders
@@ -126,6 +127,9 @@ function( add_example ARG_NAME )
set_target_properties( example-${ARG_NAME} PROPERTIES FOLDER "bgfx/examples" )
endfunction()
# Build all examples target
add_custom_target( examples )
# Add common library for examples
add_example(
common

View File

@@ -8,5 +8,7 @@
# 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_custom_target( tools )
include( cmake/tools/geometryc.cmake )
include( cmake/tools/shaderc.cmake )

View File

@@ -17,3 +17,4 @@ add_executable( geometryc ${BGFX_DIR}/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 )
add_dependencies( tools geometryc )

View File

@@ -17,6 +17,7 @@ add_executable( shaderc ${BGFX_DIR}/tools/shaderc/shaderc.cpp ${BGFX_DIR}/tools/
target_compile_definitions( shaderc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )
set_target_properties( shaderc PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries( shaderc bx bgfx-vertexdecl fcpp glsl-optimizer )
add_dependencies( tools shaderc )
function( add_shader ARG_FILE )
# Parse arguments