Move libsquish definitions to file
This commit is contained in:
25
cmake/bimg/3rdparty/libsquish.cmake
vendored
Normal file
25
cmake/bimg/3rdparty/libsquish.cmake
vendored
Normal 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 LIBSQUISH_LIBRARIES)
|
||||
file(
|
||||
GLOB_RECURSE #
|
||||
LIBSQUISH_SOURCES #
|
||||
${BIMG_DIR}/3rdparty/libsquish/**.cpp #
|
||||
${BIMG_DIR}/3rdparty/libsquish/**.h #
|
||||
)
|
||||
set(LIBSQUISH_INCLUDE_DIR ${BIMG_DIR}/3rdparty)
|
||||
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/libsquish.cmake)
|
||||
include(3rdparty/miniz.cmake)
|
||||
include(bimg.cmake)
|
||||
include(bimg_decode.cmake)
|
||||
|
||||
@@ -23,6 +23,7 @@ target_include_directories(
|
||||
bimg_encode
|
||||
PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
PRIVATE ${BIMG_DIR}/3rdparty #
|
||||
${LIBSQUISH_INCLUDE_DIR} #
|
||||
${BIMG_DIR}/3rdparty/astc-encoder/include #
|
||||
${BIMG_DIR}/3rdparty/iqa/include #
|
||||
${BIMG_DIR}/3rdparty/nvtt #
|
||||
@@ -35,8 +36,7 @@ file(
|
||||
${BIMG_DIR}/include/* #
|
||||
${BIMG_DIR}/src/image_encode.* #
|
||||
${BIMG_DIR}/src/image_cubemap_filter.* #
|
||||
${BIMG_DIR}/3rdparty/libsquish/**.cpp #
|
||||
${BIMG_DIR}/3rdparty/libsquish/**.h #
|
||||
${LIBSQUISH_SOURCES} #
|
||||
${BIMG_DIR}/3rdparty/edtaa3/**.cpp #
|
||||
${BIMG_DIR}/3rdparty/edtaa3/**.h #
|
||||
${BIMG_DIR}/3rdparty/etc1/**.cpp #
|
||||
@@ -54,7 +54,10 @@ file(
|
||||
|
||||
target_sources(bimg_encode PRIVATE ${BIMG_ENCODE_SOURCES})
|
||||
|
||||
target_link_libraries(bimg_encode PUBLIC bx)
|
||||
target_link_libraries(
|
||||
bimg_encode PUBLIC bx #
|
||||
${LIBSQUISH_LIBRARIES} #
|
||||
)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
foreach(flag "-Wno-implicit-fallthrough" "-Wno-shadow" "-Wno-shift-negative-value" "-Wno-undef")
|
||||
|
||||
Reference in New Issue
Block a user