GPUOpen-Tools / compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs
1.29k stars 194 forks source link

-DOPTION_BUILD_KTX2=OFF has no effect #261

Closed bekorn closed 1 year ago

bekorn commented 1 year ago

OPTION_BUILD_KTX2 has no effect because it is overwritten by this section that only depends on CMake version(?). https://github.com/GPUOpen-Tools/compressonator/blob/0bea29d5ab01c688c8408edf50a8f13dfe7a915b/CMakeLists.txt#L119-L123

Maybe it can be replaced with this?

if(OPTION_BUILD_KTX2 AND ${CMAKE_VERSION} VERSION_LESS_EQUAL "3.14.0")
    message(WARNING "Turning off KTX2 because current CMake version is not supported")
    cmp_option(OPTION_BUILD_KTX2 "Build CLI KTX2 Support" OFF)
endif()

Though even with this change, there are several other points where KTX2 is included without checking the OPTION_BUILD_KTX2. Is it okay if I create a patch that makes KTX2 actually optional? If yes, should I enable/disable KTX and KTX2 together?

NPCompress commented 1 year ago

@bekorn Yes, let's make both enable/disable KTX and KTX2 together.

bekorn commented 1 year ago

Hi again. I think I've made the CMake -D arguments have an effect on the build (none were effective as I understand). You can check it here https://github.com/GPUOpen-Tools/compressonator/compare/master...bekorn:compressonator:improving_CMakeLists

However, I can't be sure if everything works, because I can't build the project because of all the dependencies that I don't have on my machine :/ Are there automated tests for this? Or can you test it? I can make a PR if that would be easier.