summary refs log tree commit diff
path: root/CMakeLists.txt
blob: 3dd75dfe5bda3de17eba6da8d33b66df77412d94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cmake_minimum_required(VERSION 3.23)
project(meowcraft)

set(CMAKE_CXX_STANDARD 17)

find_package(glfw3 3.3 REQUIRED)
find_package(GLEW REQUIRED)

add_executable(meowcraft src/main.cpp src/Window.cpp src/Window.hpp src/Mesh.cpp src/Mesh.hpp src/Math/Vector.hpp src/Math/Math.hpp src/Binder.cpp src/Binder.hpp src/Shader/ShaderSources.hpp src/Shader/Shader.cpp src/Shader/Shader.hpp src/Shader/ShaderProgram.cpp src/Shader/ShaderProgram.hpp src/Math/Matrix.hpp src/Math/MVP.cpp src/Math/MVP.hpp src/Camera.cpp src/Camera.hpp src/Math/Rotation.hpp src/Shader/Uniform.cpp src/Shader/Uniform.hpp)
target_link_libraries(meowcraft glfw GLEW::GLEW)

function(make_includable input_file output_file)
    file(READ ${input_file} content)
    set(delim "for_c++_include")
    set(content "R\"${delim}(\n${content})${delim}\"")
    file(WRITE ${output_file} "${content}")
endfunction(make_includable)

make_includable(src/Shader/fragment.glsl src/Shader/Generated/fragment.glsl.includable)
make_includable(src/Shader/vertex.glsl src/Shader/Generated/vertex.glsl.includable)