Skip to content

Commit 39a8213

Browse files
authored
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.
1 parent 7b08daa commit 39a8213

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,10 @@ elseif(APPLE OR LINUX)
466466
endif()
467467
endif()
468468

469+
set(KTX_BASISU_INCLUDE_DIRS
470+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/transcoder>
471+
)
472+
469473
# Main library
470474
add_library( ktx ${LIB_TYPE}
471475
${KTX_MAIN_SRC}
@@ -551,7 +555,7 @@ macro(common_libktx_settings target enable_write library_type)
551555
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
552556
$<INSTALL_INTERFACE:include>
553557
PRIVATE
554-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/transcoder>
558+
${KTX_BASISU_INCLUDE_DIRS}
555559
$<INSTALL_INTERFACE:lib/basisu/transcoder>
556560

557561
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/zstd>

interface/basisu_c_binding/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ target_include_directories(
2525
obj_basisu_cbind
2626
PUBLIC
2727
inc
28+
${KTX_BASISU_INCLUDE_DIRS}
2829
PRIVATE
2930
$<TARGET_PROPERTY:ktx,INCLUDE_DIRECTORIES>
3031
${PROJECT_SOURCE_DIR}/utils

tests/transcodetests/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ set_code_sign(transcodetests)
1010
target_include_directories(
1111
transcodetests
1212
PRIVATE
13-
$<TARGET_PROPERTY:ktx,INCLUDE_DIRECTORIES>
14-
$<TARGET_PROPERTY:obj_basisu_cbind,INTERFACE_INCLUDE_DIRECTORIES>
15-
${CMAKE_CURRENT_SOURCE_DIR}/../../other_include
16-
${CMAKE_CURRENT_SOURCE_DIR}/../../lib
13+
${PROJECT_SOURCE_DIR}/lib
1714
)
1815

1916
target_link_libraries(
@@ -28,7 +25,6 @@ target_compile_definitions(
2825
transcodetests
2926
PRIVATE
3027
$<TARGET_PROPERTY:ktx,INTERFACE_COMPILE_DEFINITIONS>
31-
$<TARGET_PROPERTY:obj_basisu_cbind,INTERFACE_COMPILE_DEFINITIONS>
3228
)
3329

3430
target_compile_features(transcodetests PUBLIC cxx_std_11)

0 commit comments

Comments
 (0)