From 6f741542d9f90f40a10e9c12de2cfaba5bc3c922 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sat, 14 Jan 2023 07:53:54 -0500 Subject: [PATCH] Move nvtt to file --- cmake/bimg/3rdparty/nvtt.cmake | 25 +++++++++++++++++++++++++ cmake/bimg/CMakeLists.txt | 1 + cmake/bimg/bimg_encode.cmake | 6 +++--- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 cmake/bimg/3rdparty/nvtt.cmake diff --git a/cmake/bimg/3rdparty/nvtt.cmake b/cmake/bimg/3rdparty/nvtt.cmake new file mode 100644 index 0000000..26a0b76 --- /dev/null +++ b/cmake/bimg/3rdparty/nvtt.cmake @@ -0,0 +1,25 @@ +# 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 NVTT_LIBRARIES) + file( + GLOB_RECURSE # + NVTT_SOURCES # + ${BIMG_DIR}/3rdparty/nvtt/**.cpp # + ${BIMG_DIR}/3rdparty/nvtt/**.h # + ) + set(NVTT_INCLUDE_DIR ${BIMG_DIR}/3rdparty/nvtt) +endif() diff --git a/cmake/bimg/CMakeLists.txt b/cmake/bimg/CMakeLists.txt index 236f575..a546753 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/nvtt.cmake) include(3rdparty/pvrtc.cmake) include(3rdparty/tinyexr.cmake) include(3rdparty/iqa.cmake) diff --git a/cmake/bimg/bimg_encode.cmake b/cmake/bimg/bimg_encode.cmake index 57e6666..94021ce 100644 --- a/cmake/bimg/bimg_encode.cmake +++ b/cmake/bimg/bimg_encode.cmake @@ -25,7 +25,7 @@ target_include_directories( PRIVATE ${BIMG_DIR}/3rdparty # ${LIBSQUISH_INCLUDE_DIR} # ${ASTC_ENCODER_INCLUDE_DIR} - ${BIMG_DIR}/3rdparty/nvtt # + ${NVTT_INCLUDE_DIR} # ${PVRTC_INCLUDE_DIR} ${TINYEXR_INCLUDE_DIR} # ${IQA_INCLUDE_DIR} # @@ -45,8 +45,7 @@ file( ${BIMG_DIR}/3rdparty/etc1/**.h # ${BIMG_DIR}/3rdparty/etc2/**.cpp # ${BIMG_DIR}/3rdparty/etc2/**.hpp # - ${BIMG_DIR}/3rdparty/nvtt/**.cpp # - ${BIMG_DIR}/3rdparty/nvtt/**.h # + ${NVTT_SOURCES} # ${PVRTC_SOURCES} # ${TINYEXR_SOURCES} ${IQA_SOURCES} # @@ -59,6 +58,7 @@ target_link_libraries( PUBLIC bx # ${LIBSQUISH_LIBRARIES} # ${ASTC_ENCODER_LIBRARIES} # + ${NVTT_LIBRARIES} ${PVRTC_LIBRARIES} # ${TINYEXR_LIBRARIES} # ${IQA_LIBRARIES} #