cmake: Update minimum to 3.14
This commit is contained in:
parent
a841bc8e07
commit
78448eda6e
2 changed files with 21 additions and 20 deletions
19
.github/workflows/linux.yml
vendored
19
.github/workflows/linux.yml
vendored
|
|
@ -25,8 +25,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: lukka/get-cmake@latest
|
||||||
|
with:
|
||||||
|
cmakeVersion: 3.15.0
|
||||||
- name: Configure Vulkan-Headers
|
- name: Configure Vulkan-Headers
|
||||||
run: cmake -S . -B build
|
run: cmake -S . -B build -G "Ninja"
|
||||||
- name: Install Vulkan-Headers
|
- name: Install Vulkan-Headers
|
||||||
run: cmake --install build --prefix ${GITHUB_WORKSPACE}/build/install
|
run: cmake --install build --prefix ${GITHUB_WORKSPACE}/build/install
|
||||||
- name: Test Vulkan-Headers find_package support
|
- name: Test Vulkan-Headers find_package support
|
||||||
|
|
@ -36,8 +39,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: lukka/get-cmake@latest
|
||||||
|
with:
|
||||||
|
cmakeVersion: 3.25.0
|
||||||
- name: Configure Vulkan-Headers
|
- name: Configure Vulkan-Headers
|
||||||
run: cmake -S . -B build -D BUILD_TESTS=ON
|
run: cmake -S . -B build -D BUILD_TESTS=ON --log-level=DEBUG -G "Ninja"
|
||||||
- name: Build Vulkan-Headers Tests
|
- name: Build Vulkan-Headers Tests
|
||||||
run: cmake --build build
|
run: cmake --build build
|
||||||
|
|
||||||
|
|
@ -47,11 +53,6 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
with:
|
with:
|
||||||
cmakeVersion: 3.10.2
|
cmakeVersion: 3.14.0
|
||||||
- name: CMake Version
|
|
||||||
run: cmake --version
|
|
||||||
- name: Create build directory
|
|
||||||
run: mkdir build/
|
|
||||||
- name: Configure Vulkan-Headers
|
- name: Configure Vulkan-Headers
|
||||||
working-directory: ./build
|
run: cmake -S . -B build/ -G "Ninja"
|
||||||
run: cmake ../
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ~~~
|
# ~~~
|
||||||
cmake_minimum_required(VERSION 3.10.2)
|
cmake_minimum_required(VERSION 3.14...3.25)
|
||||||
|
|
||||||
function(vlk_get_header_version)
|
function(vlk_get_header_version)
|
||||||
set(vulkan_core_header_file "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan_core.h")
|
set(vulkan_core_header_file "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan_core.h")
|
||||||
|
|
@ -42,17 +42,22 @@ endfunction()
|
||||||
vlk_get_header_version()
|
vlk_get_header_version()
|
||||||
|
|
||||||
project(Vulkan-Headers LANGUAGES C VERSION ${VK_VERSION_STRING})
|
project(Vulkan-Headers LANGUAGES C VERSION ${VK_VERSION_STRING})
|
||||||
message(STATUS "${PROJECT_NAME} = ${PROJECT_VERSION}")
|
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15")
|
||||||
|
message(DEBUG "${PROJECT_NAME} = ${PROJECT_VERSION}")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(Vulkan-Headers INTERFACE)
|
add_library(Vulkan-Headers INTERFACE)
|
||||||
target_include_directories(Vulkan-Headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
target_include_directories(Vulkan-Headers INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
||||||
add_library(Vulkan::Headers ALIAS Vulkan-Headers)
|
add_library(Vulkan::Headers ALIAS Vulkan-Headers)
|
||||||
|
|
||||||
# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
|
if (CMAKE_VERSION VERSION_LESS "3.21")
|
||||||
string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL)
|
# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
|
||||||
|
string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (PROJECT_IS_TOP_LEVEL)
|
if (PROJECT_IS_TOP_LEVEL)
|
||||||
option(BUILD_TESTS "Build the tests" OFF)
|
option(BUILD_TESTS "Build the tests")
|
||||||
if (BUILD_TESTS)
|
if (BUILD_TESTS)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -91,12 +96,7 @@ if (PROJECT_IS_TOP_LEVEL)
|
||||||
|
|
||||||
set(config_version "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfigVersion.cmake")
|
set(config_version "${CMAKE_CURRENT_BINARY_DIR}/VulkanHeadersConfigVersion.cmake")
|
||||||
|
|
||||||
# Add find_package() versioning support
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
|
|
||||||
write_basic_package_version_file(${config_version} COMPATIBILITY SameMajorVersion)
|
|
||||||
else()
|
|
||||||
write_basic_package_version_file(${config_version} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
|
write_basic_package_version_file(${config_version} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
|
||||||
endif()
|
|
||||||
|
|
||||||
install(FILES ${config_version} ${vulkan_headers_config} DESTINATION ${cmake_files_install_dir})
|
install(FILES ${config_version} ${vulkan_headers_config} DESTINATION ${cmake_files_install_dir})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue