Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Merge requests
!99
Resolve "Automatische Generierung von cmake-Files für Projekte"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Automatische Generierung von cmake-Files für Projekte"
107-automatische-generierung-von-cmake-files-fur-projekte
into
develop
Overview
0
Commits
11
Pipelines
12
Changes
24
Merged
Tobias Frisch
requested to merge
107-automatische-generierung-von-cmake-files-fur-projekte
into
develop
3 years ago
Overview
0
Commits
11
Pipelines
12
Changes
1
Expand
Closes
#107 (closed)
Edited
3 years ago
by
Tobias Frisch
0
0
Merge request reports
Compare
version 13
version 13
e653d0ca
3 years ago
version 12
2790179f
3 years ago
version 11
2790179f
3 years ago
version 10
2790179f
3 years ago
version 9
2790179f
3 years ago
version 8
e1e08f2f
3 years ago
version 7
f0eba63b
3 years ago
version 6
a2a9ed7a
3 years ago
version 5
74f3e2f3
3 years ago
version 4
7cfd54ab
3 years ago
version 3
1eb4d3b8
3 years ago
version 2
1150a709
3 years ago
version 1
98094098
3 years ago
develop (base)
and
latest version
latest version
8b26d7cc
11 commits,
3 years ago
version 13
e653d0ca
10 commits,
3 years ago
version 12
2790179f
9 commits,
3 years ago
version 11
2790179f
9 commits,
3 years ago
version 10
2790179f
9 commits,
3 years ago
version 9
2790179f
9 commits,
3 years ago
version 8
e1e08f2f
8 commits,
3 years ago
version 7
f0eba63b
7 commits,
3 years ago
version 6
a2a9ed7a
6 commits,
3 years ago
version 5
74f3e2f3
5 commits,
3 years ago
version 4
7cfd54ab
4 commits,
3 years ago
version 3
1eb4d3b8
3 commits,
3 years ago
version 2
1150a709
2 commits,
3 years ago
version 1
98094098
1 commit,
3 years ago
Show latest version
1 file
+
58
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
scripts/generate.sh
0 → 100755
+
58
−
0
Options
#!/bin/sh
CMAKE_PROJECT_DIR
=
"
$(
pwd
)
"
CMAKE_PROJECT_NAME
=
"
$(
basename
"
$CMAKE_PROJECT_DIR
"
)
"
# Navigate to the main directory of the cloned repository
cd
"
$(
dirname
"
$0
"
)
"
||
exit
cd
..
CMAKE_FRAMEWORK_DIR
=
"
$(
realpath
-s
--relative-to
=
"
$CMAKE_PROJECT_DIR
"
"
$(
pwd
)
"
)
"
# Navigate back to the project directory
cd
"
$CMAKE_PROJECT_DIR
"
||
exit
test
-f
"CMakeLists.txt"
&&
echo
"WARNING: CMakeLists.txt exists already! Project generation stops!"
&&
exit
test
-f
"src/main.cpp"
&&
echo
"WARNING: src/main.cpp exists already! Project generation stops!"
&&
exit
generate_cmake_lists
()
{
echo
"cmake_minimum_required(VERSION 3.16)"
echo
"project(
$CMAKE_PROJECT_NAME
)"
echo
echo
"set(CMAKE_CXX_STANDARD 20)"
echo
"set(CMAKE_CXX_STANDARD_REQUIRED ON)"
echo
echo
"set(BUILD_MODULES ON CACHE INTERNAL
\"\"
)"
echo
"set(BUILD_PROJECTS OFF CACHE INTERNAL
\"\"
)"
echo
"set(BUILD_DOXYGEN_DOCS OFF CACHE INTERNAL
\"\"
)"
echo
"set(BUILD_SHARED OFF CACHE INTERNAL
\"\"
)"
echo
"add_subdirectory(
$CMAKE_FRAMEWORK_DIR
)"
echo
echo
"add_executable(
$CMAKE_PROJECT_NAME
src/main.cpp)"
echo
echo
"target_include_directories(
$CMAKE_PROJECT_NAME
SYSTEM BEFORE PRIVATE
\$
{vkcv_includes})"
echo
"target_link_libraries(
$CMAKE_PROJECT_NAME
\$
{vkcv_libraries})"
}
generate_main_cpp
()
{
echo
"#include <vkcv/Core.hpp>"
echo
echo
"int main(int argc, const char** argv) {"
echo
" vkcv::Core core = vkcv::Core::create("
echo
"
\"
$CMAKE_PROJECT_NAME
\"
,"
echo
" VK_MAKE_VERSION(0, 0, 1),"
echo
" { vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute },"
echo
" { VK_KHR_SWAPCHAIN_EXTENSION_NAME }"
echo
" );"
echo
" "
echo
" vkcv::WindowHandle windowHandle = core.createWindow(
\"
$CMAKE_PROJECT_NAME
\"
, 800, 600, true);"
echo
" "
echo
" while (vkcv::Window::hasOpenWindow()) {"
echo
" vkcv::Window::pollEvents();"
echo
" }"
echo
"}"
}
generate_cmake_lists
>
"CMakeLists.txt"
mkdir
-p
"src"
generate_main_cpp
>
"src/main.cpp"
Loading