2022-05-03 18:53:24 +02:00
|
|
|
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
|
|
|
|
2020-09-29 13:47:50 +02:00
|
|
|
project(opengl_primitives CXX)
|
|
|
|
|
|
|
|
file(GLOB_RECURSE CPP_FILES src/*.cpp)
|
|
|
|
file(GLOB_RECURSE HPP_FILES src/*.hpp)
|
|
|
|
|
2022-05-03 18:53:24 +02:00
|
|
|
add_library(opengl_primitives
|
|
|
|
src/mm/opengl/buffer.hpp
|
|
|
|
src/mm/opengl/buffer.cpp
|
|
|
|
src/mm/opengl/fbo_builder.hpp
|
|
|
|
src/mm/opengl/fbo_builder.cpp
|
|
|
|
src/mm/opengl/frame_buffer_object.hpp
|
|
|
|
src/mm/opengl/frame_buffer_object.cpp
|
|
|
|
src/mm/opengl/instance_buffer.hpp
|
|
|
|
src/mm/opengl/shader.hpp
|
|
|
|
src/mm/opengl/shader.cpp
|
|
|
|
src/mm/opengl/shader_builder.hpp
|
|
|
|
src/mm/opengl/shader_builder.cpp
|
|
|
|
src/mm/opengl/spritesheet.hpp
|
|
|
|
src/mm/opengl/texture.hpp
|
|
|
|
src/mm/opengl/texture.cpp
|
|
|
|
src/mm/opengl/texture_loader.hpp
|
|
|
|
src/mm/opengl/texture_loader.cpp
|
|
|
|
src/mm/opengl/vertex_array_object.hpp
|
|
|
|
src/mm/opengl/vertex_array_object.cpp
|
|
|
|
|
|
|
|
|
|
|
|
src/mm/opengl/components/texture.hpp
|
|
|
|
)
|
2020-09-29 13:47:50 +02:00
|
|
|
|
|
|
|
target_include_directories(opengl_primitives PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
|
|
|
|
|
|
target_link_libraries(opengl_primitives
|
|
|
|
glm
|
|
|
|
stb_image
|
2021-04-11 21:28:40 +02:00
|
|
|
#sdl
|
|
|
|
sdl_service
|
2020-09-29 13:47:50 +02:00
|
|
|
|
|
|
|
logger
|
|
|
|
resource_manager
|
|
|
|
filesystem_service
|
|
|
|
)
|
|
|
|
|
|
|
|
if(MM_OPENGL_3_GLES)
|
|
|
|
target_link_libraries(opengl_primitives "GL") # TODO: make more specific
|
|
|
|
if(EMSCRIPTEN)
|
2021-06-13 20:54:45 +02:00
|
|
|
set_target_properties(opengl_primitives PROPERTIES COMPILE_FLAGS "-s USE_WEBGL2=1 -s USE_SDL=2")
|
|
|
|
set_target_properties(opengl_primitives PROPERTIES LINK_FLAGS "-s USE_WEBGL2=1 -s USE_SDL=2")
|
2020-09-29 13:47:50 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
else()
|
|
|
|
target_link_libraries(opengl_primitives glad)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BUILD_TESTING)
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|