2022-07-05 11:26:52 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2022-08-19 13:21:34 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 11:26:52 +00:00
|
|
|
|
2021-08-16 16:14:46 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2019-10-04 08:39:26 +00:00
|
|
|
project(hellovulkancubes LANGUAGES CXX)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2020-07-07 13:24:45 +00:00
|
|
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
2021-12-08 16:25:35 +00:00
|
|
|
set(INSTALL_EXAMPLESDIR "examples")
|
2020-07-07 13:24:45 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/vulkan/hellovulkancubes")
|
2019-10-04 08:39:26 +00:00
|
|
|
|
2021-12-02 07:54:27 +00:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Concurrent Core Gui Widgets)
|
2019-10-04 08:39:26 +00:00
|
|
|
|
2020-10-16 09:55:24 +00:00
|
|
|
qt_add_executable(hellovulkancubes
|
2019-10-04 08:39:26 +00:00
|
|
|
camera.cpp camera.h
|
|
|
|
main.cpp
|
|
|
|
mainwindow.cpp mainwindow.h
|
|
|
|
mesh.cpp mesh.h
|
|
|
|
renderer.cpp renderer.h
|
|
|
|
shader.cpp shader.h
|
|
|
|
vulkanwindow.cpp vulkanwindow.h
|
|
|
|
)
|
2021-12-08 16:25:35 +00:00
|
|
|
|
2020-10-26 15:22:32 +00:00
|
|
|
set_target_properties(hellovulkancubes PROPERTIES
|
|
|
|
WIN32_EXECUTABLE TRUE
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
)
|
2021-12-08 16:25:35 +00:00
|
|
|
|
2019-10-04 08:39:26 +00:00
|
|
|
target_link_libraries(hellovulkancubes PUBLIC
|
|
|
|
Qt::Concurrent
|
|
|
|
Qt::Core
|
|
|
|
Qt::Gui
|
|
|
|
Qt::Widgets
|
|
|
|
)
|
|
|
|
|
|
|
|
# Resources:
|
|
|
|
set_source_files_properties("../shared/block.buf"
|
|
|
|
PROPERTIES QT_RESOURCE_ALIAS "block.buf"
|
|
|
|
)
|
2021-12-08 16:25:35 +00:00
|
|
|
|
2019-10-04 08:39:26 +00:00
|
|
|
set_source_files_properties("../shared/qt_logo.buf"
|
|
|
|
PROPERTIES QT_RESOURCE_ALIAS "qt_logo.buf"
|
|
|
|
)
|
2021-12-08 16:25:35 +00:00
|
|
|
|
2019-10-04 08:39:26 +00:00
|
|
|
set(hellovulkancubes_resource_files
|
|
|
|
"../shared/block.buf"
|
|
|
|
"../shared/qt_logo.buf"
|
|
|
|
"color_frag.spv"
|
|
|
|
"color_phong_frag.spv"
|
|
|
|
"color_phong_vert.spv"
|
|
|
|
"color_vert.spv"
|
|
|
|
)
|
|
|
|
|
|
|
|
qt6_add_resources(hellovulkancubes "hellovulkancubes"
|
|
|
|
PREFIX
|
|
|
|
"/"
|
|
|
|
FILES
|
|
|
|
${hellovulkancubes_resource_files}
|
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS hellovulkancubes
|
|
|
|
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
)
|