diff --git a/cmake/bimg/3rdparty/etc1.cmake b/cmake/bimg/3rdparty/etc1.cmake new file mode 100644 index 0000000..f16eba3 --- /dev/null +++ b/cmake/bimg/3rdparty/etc1.cmake @@ -0,0 +1,22 @@ +# bgfx.cmake - bgfx building in cmake +# Written in 2017 by Joshua Brookover +# +# 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 . + +# 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 ETC1_LIBRARIES) + file(GLOB_RECURSE ETC1_SOURCES ${BIMG_DIR}/3rdparty/etc1/**.cpp # + ${BIMG_DIR}/3rdparty/etc1/**.hpp # + ) + set(ETC1_INCLUDE_DIR ${BIMG_DIR}/3rdparty) +endif() diff --git a/cmake/bimg/CMakeLists.txt b/cmake/bimg/CMakeLists.txt index 066bbe3..cceb22a 100644 --- a/cmake/bimg/CMakeLists.txt +++ b/cmake/bimg/CMakeLists.txt @@ -11,6 +11,7 @@ include(3rdparty/loadpng.cmake) include(3rdparty/libsquish.cmake) include(3rdparty/astc_encoder.cmake) +include(3rdparty/etc1.cmake) include(3rdparty/etc2.cmake) include(3rdparty/nvtt.cmake) include(3rdparty/pvrtc.cmake) diff --git a/cmake/bimg/bimg_encode.cmake b/cmake/bimg/bimg_encode.cmake index 8209f16..5702bc3 100644 --- a/cmake/bimg/bimg_encode.cmake +++ b/cmake/bimg/bimg_encode.cmake @@ -25,6 +25,7 @@ target_include_directories( PRIVATE ${BIMG_DIR}/3rdparty # ${LIBSQUISH_INCLUDE_DIR} # ${ASTC_ENCODER_INCLUDE_DIR} + ${ETC1_INCLUDE_DIR} ${ETC2_INCLUDE_DIR} ${NVTT_INCLUDE_DIR} # ${PVRTC_INCLUDE_DIR} @@ -42,8 +43,7 @@ file( ${LIBSQUISH_SOURCES} # ${BIMG_DIR}/3rdparty/edtaa3/**.cpp # ${BIMG_DIR}/3rdparty/edtaa3/**.h # - ${BIMG_DIR}/3rdparty/etc1/**.cpp # - ${BIMG_DIR}/3rdparty/etc1/**.h # + ${ETC1_SOURCES} # ${ETC2_SOURCES} # ${NVTT_SOURCES} # ${PVRTC_SOURCES} # @@ -58,6 +58,7 @@ target_link_libraries( PUBLIC bx # ${LIBSQUISH_LIBRARIES} # ${ASTC_ENCODER_LIBRARIES} # + ${ETC1_LIBRARIES} # ${ETC2_LIBRARIES} # ${NVTT_LIBRARIES} ${PVRTC_LIBRARIES} #