Move miniz definitions to file

This commit is contained in:
Sandy Carter
2023-01-14 08:19:09 -05:00
committed by Sandy
parent 1c7ef2d48f
commit 03b690a4ab
5 changed files with 43 additions and 12 deletions

23
cmake/bimg/3rdparty/miniz.cmake vendored Normal file
View File

@@ -0,0 +1,23 @@
# 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 MINIZ_LIBRARIES)
file(GLOB_RECURSE #
MINIZ_SOURCES #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* #
)
set(MINIZ_INCLUDE_DIR ${BIMG_DIR}/3rdparty/tinyexr/deps/miniz)
endif()

View File

@@ -8,6 +8,7 @@
# You should have received a copy of the CC0 Public Domain Dedication along with # 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/>. # this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
include(3rdparty/miniz.cmake)
include(bimg.cmake) include(bimg.cmake)
include(bimg_decode.cmake) include(bimg_decode.cmake)
include(bimg_encode.cmake) include(bimg_encode.cmake)

View File

@@ -22,7 +22,7 @@ set_target_properties(bimg PROPERTIES FOLDER "bgfx")
target_include_directories( target_include_directories(
bimg PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> bimg PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${BIMG_DIR}/3rdparty/astc-encoder/include # PRIVATE ${BIMG_DIR}/3rdparty/astc-encoder/include #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz # ${MINIZ_INCLUDE_DIR} #
) )
file( file(
@@ -35,9 +35,12 @@ file(
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp # ${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp #
${BIMG_DIR}/3rdparty/astc-encoder/source/*.h # ${BIMG_DIR}/3rdparty/astc-encoder/source/*.h #
# #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* # ${MINIZ_SOURCES}
) )
target_sources(bimg PRIVATE ${BIMG_SOURCES}) target_sources(bimg PRIVATE ${BIMG_SOURCES})
target_link_libraries(bimg PUBLIC bx) target_link_libraries(
bimg PUBLIC bx #
${MINIZ_LIBRARIES} #
)

View File

@@ -18,20 +18,24 @@ add_library(bimg_decode STATIC)
# Put in a "bgfx" folder in Visual Studio # Put in a "bgfx" folder in Visual Studio
set_target_properties(bimg_decode PROPERTIES FOLDER "bgfx") set_target_properties(bimg_decode PROPERTIES FOLDER "bgfx")
target_include_directories( target_include_directories(
bimg_decode PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> bimg_decode PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${BIMG_DIR}/3rdparty # PRIVATE ${BIMG_DIR}/3rdparty #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz # ${MINIZ_INCLUDE_DIR} #
) )
file(GLOB_RECURSE BIMG_DECODE_SOURCES # file(
${BIMG_DIR}/include/* # GLOB_RECURSE
${BIMG_DIR}/src/image_decode.* # BIMG_DECODE_SOURCES #
# ${BIMG_DIR}/include/* #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* # ${BIMG_DIR}/src/image_decode.* #
#
${MINIZ_SOURCES} #
) )
target_sources(bimg_decode PRIVATE ${BIMG_DECODE_SOURCES}) target_sources(bimg_decode PRIVATE ${BIMG_DECODE_SOURCES})
target_link_libraries(bimg_decode PUBLIC bx) target_link_libraries(
bimg_decode PUBLIC bx #
${MINIZ_LIBRARIES} #
)

View File

@@ -26,7 +26,7 @@ target_include_directories(
${BIMG_DIR}/3rdparty/astc-encoder/include # ${BIMG_DIR}/3rdparty/astc-encoder/include #
${BIMG_DIR}/3rdparty/iqa/include # ${BIMG_DIR}/3rdparty/iqa/include #
${BIMG_DIR}/3rdparty/nvtt # ${BIMG_DIR}/3rdparty/nvtt #
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz # ${MINIZ_INCLUDE_DIR} #
) )
file( file(