From 02e3438c34f8e9028cf04914dd7ce8650fc03179 Mon Sep 17 00:00:00 2001 From: Sukender Date: Fri, 16 Sep 2016 10:23:32 +0200 Subject: [PATCH] Added an (advanced) CMake option to build the whole squish library (with an adequate warning to tell this is not the 'official' way). --- CMakeLists.txt | 3 +++ src/nvtt/squish/CMakeLists.txt | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9315a26..f4c219f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,9 @@ ENABLE_TESTING() SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") +OPTION(SQUISH_FULL_LIBRARY "Makes the whole squish library compiled, instead of just what's needed in NVTT. Please be aware that this build path is not officially maintained." OFF) +MARK_AS_ADVANCED(SQUISH_FULL_LIBRARY) + # GCC check (needs -std:c++11 flag) if(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS("-std=c++11") diff --git a/src/nvtt/squish/CMakeLists.txt b/src/nvtt/squish/CMakeLists.txt index 832013e..48a52e6 100644 --- a/src/nvtt/squish/CMakeLists.txt +++ b/src/nvtt/squish/CMakeLists.txt @@ -20,6 +20,23 @@ SET(SQUISH_SRCS simd_sse.h simd_ve.h) +# Additionnal squish source files which are not included in NVTT by default +IF(SQUISH_FULL_LIBRARY) + SET(SQUISH_SRCS ${SQUISH_SRCS} + alpha.h + alpha.cpp + clusterfit.h + clusterfit.cpp + rangefit.h + rangefit.cpp + singlechannelfit.h + singlechannelfit.cpp + singlecolourfit.h + singlecolourfit.cpp + squish.cpp + ) +ENDIF(SQUISH_FULL) + ADD_LIBRARY(squish STATIC ${SQUISH_SRCS}) IF(NOT WIN32)