mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Add loadpng sources to file
This commit is contained in:
26
cmake/bimg/3rdparty/loadpng.cmake
vendored
Normal file
26
cmake/bimg/3rdparty/loadpng.cmake
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 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 LOADPNG_LIBRARIES)
|
||||||
|
file(
|
||||||
|
GLOB_RECURSE #
|
||||||
|
LOADPNG_SOURCES #
|
||||||
|
${BIMG_DIR}/3rdparty/lodepng/lodepng.cpp #
|
||||||
|
${BIMG_DIR}/3rdparty/lodepng/lodepng.h #
|
||||||
|
)
|
||||||
|
set_source_files_properties(${BIMG_DIR}/3rdparty/lodepng/lodepng.cpp PROPERTIES HEADER_FILE_ONLY ON)
|
||||||
|
set(LOADPNG_INCLUDE_DIR ${BIMG_DIR}/3rdparty)
|
||||||
|
endif()
|
||||||
@@ -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/loadpng.cmake)
|
||||||
include(3rdparty/libsquish.cmake)
|
include(3rdparty/libsquish.cmake)
|
||||||
include(3rdparty/astc_encoder.cmake)
|
include(3rdparty/astc_encoder.cmake)
|
||||||
include(3rdparty/tinyexr.cmake)
|
include(3rdparty/tinyexr.cmake)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ set_target_properties(bimg_decode PROPERTIES FOLDER "bgfx")
|
|||||||
target_include_directories(
|
target_include_directories(
|
||||||
bimg_decode
|
bimg_decode
|
||||||
PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
PRIVATE ${BIMG_DIR}/3rdparty #
|
PRIVATE ${LOADPNG_INCLUDE_DIR} #
|
||||||
${MINIZ_INCLUDE_DIR} #
|
${MINIZ_INCLUDE_DIR} #
|
||||||
${TINYEXR_INCLUDE_DIR} #
|
${TINYEXR_INCLUDE_DIR} #
|
||||||
)
|
)
|
||||||
@@ -32,6 +32,7 @@ file(
|
|||||||
${BIMG_DIR}/include/* #
|
${BIMG_DIR}/include/* #
|
||||||
${BIMG_DIR}/src/image_decode.* #
|
${BIMG_DIR}/src/image_decode.* #
|
||||||
#
|
#
|
||||||
|
${LOADPNG_SOURCES} #
|
||||||
${MINIZ_SOURCES} #
|
${MINIZ_SOURCES} #
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ target_sources(bimg_decode PRIVATE ${BIMG_DECODE_SOURCES})
|
|||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
bimg_decode
|
bimg_decode
|
||||||
PUBLIC bx #
|
PUBLIC bx #
|
||||||
|
${LOADPNG_LIBRARIES} #
|
||||||
${MINIZ_LIBRARIES} #
|
${MINIZ_LIBRARIES} #
|
||||||
${TINYEXR_LIBRARIES} #
|
${TINYEXR_LIBRARIES} #
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user