Skip to content

Commit

Permalink
Move Ktx*.cmake files to Development component. (#841)
Browse files Browse the repository at this point in the history
Fixes #838.

Contains 2 minor unrelated fixes due to overhead of PRs:
* Move include of CMakePrintHelpers to root CMakeLists.txt so it is
  available everywhere.
* Don't set Vulkan_INCLUDE_DIR in mkvk.cmake.
  - Fixes vkloadtests build when KTX_GENERATE_VK_FILES is ON.
  • Loading branch information
MarkCallow authored Jan 19, 2024
1 parent e77a531 commit 4ac5403
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

cmake_minimum_required(VERSION 3.15)

include(CMakePrintHelpers)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")

find_package(Bash REQUIRED)
Expand Down Expand Up @@ -1154,7 +1156,7 @@ install(EXPORT KTXTargets
FILE KtxTargets.cmake
NAMESPACE KTX::
DESTINATION lib/cmake/ktx
COMPONENT library
COMPONENT dev
)

include(CMakePackageConfigHelpers)
Expand All @@ -1167,7 +1169,7 @@ install( FILES
"cmake/KtxConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KtxConfigVersion.cmake"
DESTINATION lib/cmake/ktx
COMPONENT library
COMPONENT dev
)

# CPack
Expand Down
9 changes: 6 additions & 3 deletions cmake/mkvk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ if (NOT IOS AND NOT ANDROID)
# # find_package doesn't find the Vulkan SDK when building for IOS.
# # I haven't investigated why.
# find_package(Vulkan REQUIRED)
set(Vulkan_INCLUDE_DIR lib/dfdutils)

# This file is included from so has the same scope as the including file.
# If we change Vulkan_INCLUDE_DIR, other users will be effected.
set(mkvk_vulkan_include_dir lib/dfdutils)
else()
# Skip mkvk. There is no need to use iOS or Android to regenerate
# the files.
return()
endif()

set(vulkan_header "${Vulkan_INCLUDE_DIR}/vulkan/vulkan_core.h")
set(vulkan_header "${mkvk_vulkan_include_dir}/vulkan/vulkan_core.h")

# CAUTION: On Windows use a version of Perl built for Windows, i.e. not
# one found in Cygwin or MSYS (Git for Windows). This is needed so the
Expand Down Expand Up @@ -72,7 +75,7 @@ list(APPEND mkvkformatfiles_output
# parses successfully.

list(APPEND mvffc_as_list
Vulkan_INCLUDE_DIR="${Vulkan_INCLUDE_DIR}" lib/mkvkformatfiles lib)
Vulkan_INCLUDE_DIR="${mkvk_vulkan_include_dir}" lib/mkvkformatfiles lib)
list(JOIN mvffc_as_list " " mvffc_as_string)
set(mkvkformatfiles_command "${BASH_EXECUTABLE}" -c "${mvffc_as_string}")

Expand Down
2 changes: 0 additions & 2 deletions tests/loadtests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Copyright 2017-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

include(CMakePrintHelpers)

if(WIN32)
cmake_print_variables(
CMAKE_SYSTEM_VERSION
Expand Down

0 comments on commit 4ac5403

Please sign in to comment.