mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 13:02:33 +01:00
Move tinyexr definitions to file
This commit is contained in:
23
cmake/bimg/3rdparty/tinyexr.cmake
vendored
Normal file
23
cmake/bimg/3rdparty/tinyexr.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 TINYEXR_LIBRARIES)
|
||||
file(GLOB_RECURSE #
|
||||
TINYEXR_SOURCES #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/**.h #
|
||||
)
|
||||
set(TINYEXR_INCLUDE_DIR ${BIMG_DIR}/3rdparty)
|
||||
endif()
|
||||
@@ -9,6 +9,7 @@
|
||||
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
include(3rdparty/libsquish.cmake)
|
||||
include(3rdparty/tinyexr.cmake)
|
||||
include(3rdparty/miniz.cmake)
|
||||
include(bimg.cmake)
|
||||
include(bimg_decode.cmake)
|
||||
|
||||
@@ -19,9 +19,11 @@ 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}>
|
||||
bimg_decode
|
||||
PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PRIVATE ${BIMG_DIR}/3rdparty #
|
||||
${MINIZ_INCLUDE_DIR} #
|
||||
${TINYEXR_INCLUDE_DIR} #
|
||||
)
|
||||
|
||||
file(
|
||||
@@ -36,6 +38,8 @@ file(
|
||||
target_sources(bimg_decode PRIVATE ${BIMG_DECODE_SOURCES})
|
||||
|
||||
target_link_libraries(
|
||||
bimg_decode PUBLIC bx #
|
||||
${MINIZ_LIBRARIES} #
|
||||
bimg_decode
|
||||
PUBLIC bx #
|
||||
${MINIZ_LIBRARIES} #
|
||||
${TINYEXR_LIBRARIES} #
|
||||
)
|
||||
|
||||
@@ -27,6 +27,7 @@ target_include_directories(
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/include #
|
||||
${BIMG_DIR}/3rdparty/iqa/include #
|
||||
${BIMG_DIR}/3rdparty/nvtt #
|
||||
${TINYEXR_INCLUDE_DIR} #
|
||||
${MINIZ_INCLUDE_DIR} #
|
||||
)
|
||||
|
||||
@@ -47,7 +48,7 @@ file(
|
||||
${BIMG_DIR}/3rdparty/nvtt/**.h #
|
||||
${BIMG_DIR}/3rdparty/pvrtc/**.cpp #
|
||||
${BIMG_DIR}/3rdparty/pvrtc/**.h #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/**.h #
|
||||
${TINYEXR_SOURCES}
|
||||
${BIMG_DIR}/3rdparty/iqa/include/**.h #
|
||||
${BIMG_DIR}/3rdparty/iqa/source/**.c #
|
||||
)
|
||||
@@ -55,8 +56,10 @@ file(
|
||||
target_sources(bimg_encode PRIVATE ${BIMG_ENCODE_SOURCES})
|
||||
|
||||
target_link_libraries(
|
||||
bimg_encode PUBLIC bx #
|
||||
${LIBSQUISH_LIBRARIES} #
|
||||
bimg_encode
|
||||
PUBLIC bx #
|
||||
${LIBSQUISH_LIBRARIES} #
|
||||
${TINYEXR_LIBRARIES} #
|
||||
)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
Reference in New Issue
Block a user