mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 13:02:33 +01:00
ew option to allow "example-common" project to not be included in build. (#225)
* Added a new option to allow "example-common" project to not be included in build. * Set BGFX_BUILD_EXAMPLE_COMMON as a dependent option, it will be set ON if either tools or examples are included in the build, OFF otherwise. * cmake format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Sandy <bwrsandman@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,10 @@ cmake_dependent_option(BGFX_BUILD_TOOLS_GEOMETRY "Build bgfx geometry tools." ON
|
||||
cmake_dependent_option(BGFX_BUILD_TOOLS_TEXTURE "Build bgfx texture tools." ON BGFX_BUILD_TOOLS OFF)
|
||||
set(BGFX_TOOLS_PREFIX "" CACHE STRING "Prefix name to add to name of tools (to avoid clashes)")
|
||||
option(BGFX_BUILD_EXAMPLES "Build bgfx examples." ON)
|
||||
cmake_dependent_option(
|
||||
BGFX_BUILD_EXAMPLE_COMMON "Build bgfx example-common project." OFF "NOT BGFX_BUILD_EXAMPLES;NOT BGFX_BUILD_TOOLS"
|
||||
ON
|
||||
)
|
||||
option(BGFX_BUILD_TESTS "Build bgfx tests." OFF)
|
||||
option(BGFX_INSTALL "Create installation target." ON)
|
||||
cmake_dependent_option(
|
||||
|
||||
@@ -263,6 +263,7 @@ if(BGFX_CUSTOM_TARGETS)
|
||||
endif()
|
||||
|
||||
# Add common library for examples
|
||||
if(BGFX_BUILD_EXAMPLE_COMMON)
|
||||
add_example(
|
||||
common
|
||||
COMMON
|
||||
@@ -274,6 +275,7 @@ add_example(
|
||||
${BGFX_DIR}/examples/common/nanovg
|
||||
${BGFX_DIR}/examples/common/ps
|
||||
)
|
||||
endif()
|
||||
|
||||
# Only add examples if set, otherwise we still need exmaples common for tools
|
||||
if(BGFX_BUILD_EXAMPLES)
|
||||
|
||||
Reference in New Issue
Block a user