mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Added install target
This commit is contained in:
@@ -19,6 +19,8 @@ endif()
|
||||
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
|
||||
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
|
||||
|
||||
option( BGFX_INSTALL "Create installation target." ON )
|
||||
|
||||
option( BGFX_USE_OVR "Build with OVR support." OFF )
|
||||
|
||||
if( BGFX_USE_OVR )
|
||||
@@ -36,3 +38,18 @@ endif()
|
||||
if( BGFX_BUILD_EXAMPLES )
|
||||
include( cmake/examples.cmake )
|
||||
endif()
|
||||
|
||||
if( BGFX_INSTALL )
|
||||
# install bx
|
||||
install( DIRECTORY ${BX_DIR}/include DESTINATION . )
|
||||
|
||||
# install bgfx
|
||||
install( TARGETS bgfx DESTINATION lib )
|
||||
install( DIRECTORY ${BGFX_DIR}/include DESTINATION . )
|
||||
|
||||
# install tools
|
||||
if( BGFX_BUILD_TOOLS )
|
||||
install( TARGETS shaderc DESTINATION bin )
|
||||
install( TARGETS geometryc DESTINATION bin )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -79,3 +79,6 @@ endif()
|
||||
|
||||
# Put in a "bgfx" folder in Visual Studio
|
||||
set_target_properties( bgfx PROPERTIES FOLDER "bgfx" )
|
||||
|
||||
# Export debug build as "bgfxd"
|
||||
set_target_properties( bgfx PROPERTIES OUTPUT_NAME_DEBUG "bgfxd" )
|
||||
|
||||
@@ -100,12 +100,12 @@ function( add_example ARG_NAME )
|
||||
|
||||
# Add target
|
||||
if( ARG_COMMON )
|
||||
add_library( example-${ARG_NAME} STATIC ${SOURCES} )
|
||||
add_library( example-${ARG_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES} )
|
||||
target_compile_definitions( example-${ARG_NAME} PRIVATE "-D_CRT_SECURE_NO_WARNINGS" "-D__STDC_FORMAT_MACROS" )
|
||||
target_include_directories( example-${ARG_NAME} PUBLIC ${BGFX_DIR}/examples/common )
|
||||
target_link_libraries( example-${ARG_NAME} PUBLIC bgfx ib-compress ocornut-imgui )
|
||||
else()
|
||||
add_executable( example-${ARG_NAME} WIN32 ${SOURCES} )
|
||||
add_executable( example-${ARG_NAME} WIN32 EXCLUDE_FROM_ALL ${SOURCES} )
|
||||
target_compile_definitions( example-${ARG_NAME} PRIVATE "-D_CRT_SECURE_NO_WARNINGS" "-D__STDC_FORMAT_MACROS" )
|
||||
target_link_libraries( example-${ARG_NAME} example-common )
|
||||
configure_debugging( example-${ARG_NAME} WORKING_DIR ${BGFX_DIR}/examples/runtime )
|
||||
|
||||
Reference in New Issue
Block a user