mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
15 Commits
v1.115.824
...
v1.118.836
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33dde1a115 | ||
|
|
866599edb0 | ||
|
|
089b388ac0 | ||
|
|
9d3bc4f326 | ||
|
|
9ee85d3c1b | ||
|
|
74a8e4dc72 | ||
|
|
99f17108ca | ||
|
|
862912e7e9 | ||
|
|
72ea9b6f29 | ||
|
|
6e23a39de6 | ||
|
|
74e4a3fad9 | ||
|
|
5c54e5f299 | ||
|
|
06b995080d | ||
|
|
f5dc53db85 | ||
|
|
2051444e25 |
@@ -26,6 +26,9 @@ if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
|
||||
endif()
|
||||
|
||||
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
|
||||
option( BGFX_BUILD_TOOLS_SHADER "Build bgfx shader tools." ON )
|
||||
option( BGFX_BUILD_TOOLS_GEOMETRY "Build bgfx geometry tools." ON )
|
||||
option( BGFX_BUILD_TOOLS_TEXTURE "Build bgfx texture tools." ON )
|
||||
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
|
||||
option( BGFX_INSTALL "Create installation target." ON )
|
||||
option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF )
|
||||
@@ -131,7 +134,7 @@ if( BGFX_INSTALL )
|
||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
if( NOT BGFX_LIBRARY_TYPE MATCHES "SHARED" )
|
||||
install( TARGETS bimg bx astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr
|
||||
install( TARGETS bimg bx astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
@@ -160,9 +163,9 @@ if( BGFX_INSTALL )
|
||||
)
|
||||
|
||||
# install tools
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bgfxToolUtils.cmake
|
||||
DESTINATION "${config_install_dir}")
|
||||
if( BGFX_BUILD_TOOLS )
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bgfxToolUtils.cmake
|
||||
DESTINATION "${config_install_dir}")
|
||||
install( TARGETS shaderc
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
|
||||
|
||||
2
bgfx
2
bgfx
Submodule bgfx updated: 7cc56a01de...f6a1289dbc
2
bimg
2
bimg
Submodule bimg updated: 663f724186...225dad7441
2
bx
2
bx
Submodule bx updated: 6322a5159d...20efa22f18
@@ -8,21 +8,21 @@
|
||||
# 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 astc-codec )
|
||||
if( TARGET astc-encoder )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(
|
||||
GLOB
|
||||
ASTC_CODEC_SOURCES
|
||||
${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.cc
|
||||
${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.h
|
||||
ASTC_ENCODER_SOURCES
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/include/*.h
|
||||
)
|
||||
|
||||
add_library( astc-codec STATIC ${ASTC_CODEC_SOURCES} )
|
||||
target_include_directories( astc-codec
|
||||
add_library( astc-encoder STATIC ${ASTC_ENCODER_SOURCES} )
|
||||
target_include_directories( astc-encoder
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty>
|
||||
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-codec>
|
||||
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-codec/include> )
|
||||
set_target_properties( astc-codec PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-encoder>
|
||||
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-encoder/include> )
|
||||
set_target_properties( astc-encoder PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
19
cmake/3rdparty/astc.cmake
vendored
19
cmake/3rdparty/astc.cmake
vendored
@@ -1,19 +0,0 @@
|
||||
# bgfx.cmake - bgfx building in cmake
|
||||
# Written in 2017 by Joshua Brookover <joshua.al.brookover@gmail.com>
|
||||
|
||||
# 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 astc )
|
||||
return()
|
||||
endif()
|
||||
|
||||
file( GLOB ASTC_SOURCES ${BIMG_DIR}/3rdparty/astc/*.cpp ${BIMG_DIR}/3rdparty/astc/*.h )
|
||||
|
||||
add_library( astc STATIC ${ASTC_SOURCES} )
|
||||
target_include_directories( astc PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/3rdparty> )
|
||||
set_target_properties( astc PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
@@ -4,5 +4,22 @@ include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
get_target_property(BGFX_INCLUDE_PATH bgfx::bgfx INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(GET BGFX_INCLUDE_PATH 0 BGFX_INCLUDE_PATH_1) # bgfx::bgfx exports include directory twice?
|
||||
set(BGFX_SHADER_INCLUDE_PATH ${BGFX_INCLUDE_PATH_1}/bgfx)
|
||||
|
||||
# If cross compiling, we need a host-compatible version of shaderc to compile shaders
|
||||
if (@CMAKE_CROSSCOMPILING@ AND NOT TARGET bgfx::shaderc)
|
||||
find_program(
|
||||
shaderc_EXECUTABLE REQUIRED
|
||||
NAMES bgfx-shaderc shaderc
|
||||
PATHS /usr/bin
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-linux/tools/bgfx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-windows/tools/bgfx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-osx/tools/bgfx
|
||||
)
|
||||
add_executable(bgfx::shaderc IMPORTED)
|
||||
set_target_properties(
|
||||
bgfx::shaderc PROPERTIES IMPORTED_LOCATION "${shaderc_EXECUTABLE}"
|
||||
)
|
||||
endif ()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/bgfxToolUtils.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
@@ -80,11 +80,24 @@ target_compile_definitions(bgfx
|
||||
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
|
||||
)
|
||||
|
||||
# directx-headers
|
||||
set (DIRECTX_HEADERS)
|
||||
if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID) # Only Linux
|
||||
set (DIRECTX_HEADERS
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include/directx
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs )
|
||||
elseif (WIN32) # Only Windows
|
||||
set (DIRECTX_HEADERS
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include/directx
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include )
|
||||
endif()
|
||||
|
||||
# Includes
|
||||
target_include_directories( bgfx
|
||||
PRIVATE
|
||||
${DIRECTX_HEADERS}
|
||||
${BGFX_DIR}/3rdparty
|
||||
${BGFX_DIR}/3rdparty/dxsdk/include
|
||||
${BGFX_DIR}/3rdparty/khronos
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${BGFX_DIR}/include>
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
# Third party libs
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-codec.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-encoder.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/edtaa3.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc1.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc2.cmake )
|
||||
@@ -39,7 +38,7 @@ target_include_directories( bimg
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
|
||||
# bimg dependencies
|
||||
target_link_libraries( bimg PUBLIC bx PRIVATE astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr )
|
||||
target_link_libraries( bimg PUBLIC bx PRIVATE astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr )
|
||||
|
||||
# Put in a "bgfx" folder in Visual Studio
|
||||
set_target_properties( bimg PROPERTIES FOLDER "bgfx" )
|
||||
@@ -59,11 +59,16 @@ elseif( WIN32 )
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${BX_DIR}/include/compat/msvc>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/msvc> )
|
||||
elseif( APPLE )
|
||||
elseif( APPLE ) # APPLE is technically UNIX... ORDERING MATTERS!
|
||||
target_include_directories( bx
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${BX_DIR}/include/compat/osx>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/osx> )
|
||||
$<BUILD_INTERFACE:${BX_DIR}/include/compat/osx>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/osx> )
|
||||
elseif ( UNIX )
|
||||
target_include_directories( bx
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${BX_DIR}/include/compat/linux>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/linux> )
|
||||
endif()
|
||||
|
||||
# All configurations
|
||||
|
||||
@@ -13,8 +13,16 @@ if( BGFX_CUSTOM_TARGETS )
|
||||
set_target_properties( tools PROPERTIES FOLDER "bgfx/tools" )
|
||||
endif()
|
||||
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryc.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryv.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/shaderc.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturec.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturev.cmake )
|
||||
if( BGFX_BUILD_TOOLS_SHADER )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/shaderc.cmake )
|
||||
endif()
|
||||
|
||||
if( BGFX_BUILD_TOOLS_GEOMETRY )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryc.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryv.cmake )
|
||||
endif()
|
||||
|
||||
if( BGFX_BUILD_TOOLS_TEXTURE )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturec.cmake )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturev.cmake )
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user