-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
57 lines (46 loc) · 2.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ontrack-4k
# Copyright (C) 2023 Alexander Kraus <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.25)
project(physics-girl-st ASM_NASM)
find_package(OpenGL REQUIRED)
add_subdirectory(code)
# Automatic video rendering; only enabled if python is present.
find_package(Python)
if(Python_FOUND)
set(VIDEO_DURATION 85)
make_directory("${PROJECT_BINARY_DIR}/frames")
make_directory("${PROJECT_BINARY_DIR}/video")
add_custom_target(frames
COMMAND ${Python_EXECUTABLE} -m poetry run python -m video -o "${PROJECT_BINARY_DIR}/frames" -s "${PROJECT_SOURCE_DIR}/graphics/gfx.frag" -w 1920 -j 1080 -d ${VIDEO_DURATION} -r 60
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Rendering video frames..."
)
add_custom_target(frames-fill
COMMAND ${Python_EXECUTABLE} -m poetry run python -m video -o "${PROJECT_BINARY_DIR}/frames" -s "${PROJECT_SOURCE_DIR}/graphics/gfx.frag" -w 1920 -j 1080 -d ${VIDEO_DURATION} -r 60 -f
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Rendering video frames with fill..."
)
add_custom_target(music
COMMAND wav
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Rendering music wave file..."
)
add_custom_target(video
COMMAND ${FFMPEG} -framerate 60 -i frames/image.%d.png -f f32le -ac 2 -ar 44100 -i msx.raw "video/${PROJECT_NAME}-1920x1080.mp4" -y
)
add_dependencies(video frames music)
add_custom_target(video-fill
COMMAND ${FFMPEG} -framerate 60 -i frames/image.%d.png -f f32le -ac 2 -ar 44100 -i msx.raw "video/${PROJECT_NAME}-1920x1080.mp4" -y
)
add_dependencies(video-fill frames-fill music)
endif()