mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 13:02:33 +01:00
Move miniz definitions to file
This commit is contained in:
23
cmake/bimg/3rdparty/miniz.cmake
vendored
Normal file
23
cmake/bimg/3rdparty/miniz.cmake
vendored
Normal 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()
|
||||
@@ -8,6 +8,7 @@
|
||||
# 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/>.
|
||||
|
||||
include(3rdparty/miniz.cmake)
|
||||
include(bimg.cmake)
|
||||
include(bimg_decode.cmake)
|
||||
include(bimg_encode.cmake)
|
||||
|
||||
@@ -22,7 +22,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 #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz #
|
||||
${MINIZ_INCLUDE_DIR} #
|
||||
)
|
||||
|
||||
file(
|
||||
@@ -35,9 +35,12 @@ file(
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp #
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/source/*.h #
|
||||
#
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* #
|
||||
${MINIZ_SOURCES}
|
||||
)
|
||||
|
||||
target_sources(bimg PRIVATE ${BIMG_SOURCES})
|
||||
|
||||
target_link_libraries(bimg PUBLIC bx)
|
||||
target_link_libraries(
|
||||
bimg PUBLIC bx #
|
||||
${MINIZ_LIBRARIES} #
|
||||
)
|
||||
|
||||
@@ -18,20 +18,24 @@ add_library(bimg_decode STATIC)
|
||||
|
||||
# Put in a "bgfx" folder in Visual Studio
|
||||
set_target_properties(bimg_decode PROPERTIES FOLDER "bgfx")
|
||||
|
||||
target_include_directories(
|
||||
bimg_decode PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PRIVATE ${BIMG_DIR}/3rdparty #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz #
|
||||
${MINIZ_INCLUDE_DIR} #
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE BIMG_DECODE_SOURCES #
|
||||
${BIMG_DIR}/include/* #
|
||||
${BIMG_DIR}/src/image_decode.* #
|
||||
#
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* #
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
BIMG_DECODE_SOURCES #
|
||||
${BIMG_DIR}/include/* #
|
||||
${BIMG_DIR}/src/image_decode.* #
|
||||
#
|
||||
${MINIZ_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} #
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ target_include_directories(
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/include #
|
||||
${BIMG_DIR}/3rdparty/iqa/include #
|
||||
${BIMG_DIR}/3rdparty/nvtt #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz #
|
||||
${MINIZ_INCLUDE_DIR} #
|
||||
)
|
||||
|
||||
file(
|
||||
|
||||
Reference in New Issue
Block a user