Move astc-encode to file

This commit is contained in:
Sandy Carter
2023-01-14 07:28:49 -05:00
committed by Sandy
parent 067672c661
commit 4f4e484333
4 changed files with 34 additions and 7 deletions

25
cmake/bimg/3rdparty/astc_encoder.cmake vendored Normal file
View File

@@ -0,0 +1,25 @@
# 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/>.
# Ensure the directory exists
if(NOT IS_DIRECTORY ${BIMG_DIR})
message(SEND_ERROR "Could not load bimg, directory does not exist. ${BIMG_DIR}")
return()
endif()
if(NOT ASTC_ENCODER_LIBRARIES)
file(
GLOB_RECURSE #
ASTC_ENCODER_SOURCES #
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp #
${BIMG_DIR}/3rdparty/astc-encoder/source/*.h #
)
set(ASTC_ENCODER_INCLUDE_DIR ${BIMG_DIR}/3rdparty/astc-encoder/include)
endif()

View File

@@ -9,6 +9,7 @@
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
include(3rdparty/libsquish.cmake)
include(3rdparty/astc_encoder.cmake)
include(3rdparty/tinyexr.cmake)
include(3rdparty/miniz.cmake)
include(bimg.cmake)

View File

@@ -21,7 +21,7 @@ set_target_properties(bimg PROPERTIES FOLDER "bgfx")
target_include_directories(
bimg PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${BIMG_DIR}/3rdparty/astc-encoder/include #
PRIVATE ${ASTC_ENCODER_INCLUDE_DIR} #
${MINIZ_INCLUDE_DIR} #
)
@@ -32,15 +32,15 @@ file(
${BIMG_DIR}/src/image.* #
${BIMG_DIR}/src/image_gnf.cpp #
#
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp #
${BIMG_DIR}/3rdparty/astc-encoder/source/*.h #
#
${ASTC_ENCODER_SOURCES}
${MINIZ_SOURCES}
)
target_sources(bimg PRIVATE ${BIMG_SOURCES})
target_link_libraries(
bimg PUBLIC bx #
${MINIZ_LIBRARIES} #
bimg
PUBLIC bx #
${ASTC_ENCODER_LIBRARIES} #
${MINIZ_LIBRARIES} #
)

View File

@@ -24,7 +24,7 @@ target_include_directories(
PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${BIMG_DIR}/3rdparty #
${LIBSQUISH_INCLUDE_DIR} #
${BIMG_DIR}/3rdparty/astc-encoder/include #
${ASTC_ENCODER_INCLUDE_DIR}
${BIMG_DIR}/3rdparty/iqa/include #
${BIMG_DIR}/3rdparty/nvtt #
${TINYEXR_INCLUDE_DIR} #
@@ -59,6 +59,7 @@ target_link_libraries(
bimg_encode
PUBLIC bx #
${LIBSQUISH_LIBRARIES} #
${ASTC_ENCODER_LIBRARIES} #
${TINYEXR_LIBRARIES} #
)