From 39a821390c314742d594c90108fe51f911515cb6 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 27 Mar 2024 06:43:03 +0100 Subject: [PATCH] fix(cmake): Fix public includes of `obj_basisu_cbind` by adding (only) BasisU include directories to its public interface. (#883) There are two commits. The first commit adds BasisU specific include directories to the target `obj_basisu_cbind`'s public interface. Now targets that add `obj_basisu_cbind` as dependency automatically have the correct include directories setup. The second commit makes use of the first's improvements, by simplifying `transcodetests` include directory setup. --- CMakeLists.txt | 6 +++++- interface/basisu_c_binding/CMakeLists.txt | 1 + tests/transcodetests/CMakeLists.txt | 6 +----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff38918d50..4d15bc4dcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -466,6 +466,10 @@ elseif(APPLE OR LINUX) endif() endif() +set(KTX_BASISU_INCLUDE_DIRS + $ +) + # Main library add_library( ktx ${LIB_TYPE} ${KTX_MAIN_SRC} @@ -551,7 +555,7 @@ macro(common_libktx_settings target enable_write library_type) $ $ PRIVATE - $ + ${KTX_BASISU_INCLUDE_DIRS} $ $ diff --git a/interface/basisu_c_binding/CMakeLists.txt b/interface/basisu_c_binding/CMakeLists.txt index 9f3e5124c7..02a361e7f0 100644 --- a/interface/basisu_c_binding/CMakeLists.txt +++ b/interface/basisu_c_binding/CMakeLists.txt @@ -25,6 +25,7 @@ target_include_directories( obj_basisu_cbind PUBLIC inc + ${KTX_BASISU_INCLUDE_DIRS} PRIVATE $ ${PROJECT_SOURCE_DIR}/utils diff --git a/tests/transcodetests/CMakeLists.txt b/tests/transcodetests/CMakeLists.txt index 157b10eee3..ed8bed7c21 100644 --- a/tests/transcodetests/CMakeLists.txt +++ b/tests/transcodetests/CMakeLists.txt @@ -10,10 +10,7 @@ set_code_sign(transcodetests) target_include_directories( transcodetests PRIVATE - $ - $ - ${CMAKE_CURRENT_SOURCE_DIR}/../../other_include - ${CMAKE_CURRENT_SOURCE_DIR}/../../lib + ${PROJECT_SOURCE_DIR}/lib ) target_link_libraries( @@ -28,7 +25,6 @@ target_compile_definitions( transcodetests PRIVATE $ - $ ) target_compile_features(transcodetests PUBLIC cxx_std_11)