2020-03-29 00:01:01 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2019-12-16 18:12:24 +00:00
|
|
|
project(Informatikprojekt C)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
2020-03-18 11:29:08 +00:00
|
|
|
set(PROJECT_SOURCES particlesystem.h particlesystem.c utils.h utils.c)
|
|
|
|
set(PROJECT_SOURCES_OPENGL ${PROJECT_SOURCES} initOpenGL.h initOpenGL.c utils.h glad/src/glad.c)
|
2020-03-27 20:12:18 +00:00
|
|
|
set(PROJECT_SOURCES_VULKAN ${PROJECT_SOURCES} newVulkan/initVulkan.h newVulkan/initVulkan.c)
|
2019-12-16 18:12:24 +00:00
|
|
|
|
2020-03-16 20:21:04 +00:00
|
|
|
add_executable(Informatikprojekt cpuMain.c ${PROJECT_SOURCES_OPENGL})
|
|
|
|
add_executable(Informatikprojekt_OpenGL openglMain.c ${PROJECT_SOURCES_OPENGL})
|
2020-03-27 20:12:18 +00:00
|
|
|
add_executable(Informatikprojekt_Vulkan newVulkan/vulkanMain.c ${PROJECT_SOURCES_VULKAN})
|
2020-03-16 19:46:54 +00:00
|
|
|
|
2020-03-18 11:53:11 +00:00
|
|
|
# Copy shader file to output directory
|
2020-03-18 13:07:11 +00:00
|
|
|
## OpenGL
|
|
|
|
configure_file(./shaders/opengl/ComputeShader.glsl ./opengl/ComputeShader.glsl COPYONLY)
|
|
|
|
configure_file(./shaders/opengl/VertexShader.glsl ./opengl/VertexShader.glsl COPYONLY)
|
|
|
|
configure_file(./shaders/opengl/FragmentShader.glsl ./opengl/FragmentShader.glsl COPYONLY)
|
|
|
|
## Vulkan
|
|
|
|
configure_file(./shaders/vulkan/ComputeShader.comp ./vulkan/ComputeShader.comp COPYONLY)
|
2020-03-27 20:12:18 +00:00
|
|
|
configure_file("shaders/vulkan/VertexShader.vert" ./vulkan/VertexShader.vert COPYONLY)
|
|
|
|
configure_file("shaders/vulkan/FragmentShader.frag" ./vulkan/FragmentShader.frag COPYONLY)
|
2020-03-18 13:07:11 +00:00
|
|
|
configure_file(./shaders/vulkan/runCompiler.bat ./vulkan/runCompiler.bat COPYONLY)
|
|
|
|
execute_process(COMMAND runCompiler.bat WORKING_DIRECTORY ./vulkan)
|
|
|
|
|
2020-03-16 19:46:54 +00:00
|
|
|
# Vulkan
|
|
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC ${Vulkan_INCLUDE_DIRS})
|
2019-12-18 17:18:55 +00:00
|
|
|
|
2020-03-16 19:46:54 +00:00
|
|
|
# GLFW
|
2020-03-13 13:04:49 +00:00
|
|
|
include_directories(./glfw/include)
|
|
|
|
target_link_libraries(Informatikprojekt ${CMAKE_SOURCE_DIR}/glfw/lib-mingw-w64/libglfw3.a)
|
2020-03-16 19:46:54 +00:00
|
|
|
target_link_libraries(Informatikprojekt_OpenGL ${CMAKE_SOURCE_DIR}/glfw/lib-mingw-w64/libglfw3.a)
|
|
|
|
target_link_libraries(Informatikprojekt_Vulkan Vulkan::Vulkan ${CMAKE_SOURCE_DIR}/glfw/lib-mingw-w64/libglfw3.a)
|
2020-01-08 15:58:38 +00:00
|
|
|
|
|
|
|
# glad
|
|
|
|
include_directories(./glad/include)
|
2019-12-20 13:24:52 +00:00
|
|
|
|
|
|
|
|