cmake_minimum_required(VERSION 3.14) project(weasel) include(cmake/bgfx_shaders.cmake) set(SOURCE_FILES weasel.hpp core/app.hpp core/app.cpp core/event.hpp core/event.cpp ec/entity.hpp ec/component.hpp ec/comp/sprite_component.hpp ec/comp/sprite_component.cpp gfx/renderer.hpp gfx/renderer.cpp gfx/texture.hpp gfx/vertex.hpp util/color.hpp util/color.cpp util/n_ary_tree.hpp util/n_ary_tree.tpp util/vector.hpp win/system_events.hpp win/system_events.cpp win/window.hpp win/window.cpp ) list(TRANSFORM SOURCE_FILES PREPEND src/) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_subdirectory(vendor/CrossWindow) add_subdirectory(vendor/bgfx.cmake) add_shader_cmd( FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/gfx/shader/mesh/mesh.vsh OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/shader/mesh.vsh.bin TYPE VERTEX) add_shader_cmd( FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/gfx/shader/mesh/mesh.fsh OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/shader/mesh.fsh.bin TYPE FRAGMENT) add_custom_target(compile_shaders ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shader/mesh.vsh.bin ${CMAKE_CURRENT_BINARY_DIR}/shader/mesh.fsh.bin) add_library(weasel ${SOURCE_FILES}) target_include_directories(weasel PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) target_compile_features(weasel PUBLIC cxx_std_17) target_link_libraries(weasel CrossWindow bgfx bx) if(WIN32) target_link_libraries(weasel Dwmapi) endif() target_compile_definitions(CrossWindow PRIVATE _WIN32_WINNT=0x0A00) add_subdirectory(examples)