From b813dac79f4ea022e927e6aef1ad71b38baa35f6 Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Sun, 8 Mar 2026 11:03:59 +0100 Subject: [PATCH] Add EnTT library --- .gitmodules | 3 +++ CMakeLists.txt | 17 +++++++++++++++++ ref/entt | 1 + 3 files changed, 21 insertions(+) create mode 160000 ref/entt diff --git a/.gitmodules b/.gitmodules index df7f5dda..7bccc4e3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,3 +32,6 @@ [submodule "betterRenderer/thirdparty/bvh"] path = betterRenderer/thirdparty/bvh url = https://github.com/madmann91/bvh.git +[submodule "ref/entt"] + path = ref/entt + url = https://github.com/skypjack/entt.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a776a8d1..73fe7ca9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,6 +371,9 @@ endif() set(cppzmq_INCLUDE_DIR ${cppzmq_INCLUDE_DIR} "${DEPS_DIR}/cppzmq/include") set(GLM_INCLUDE_DIR ${GLM_INCLUDE_DIR} "${DEPS_DIR}/glm/") +set(ENTT_INCLUDE_DIR ${ENTT_INCLUDE_DIR} "${DEPS_DIR}/entt/src") +set(ENTT_INCLUDE_DIRS ${ENTT_INCLUDE_DIRS} "${DEPS_DIR}/entt/src") + # Process version.rc.in into version.rc configure_file(${CMAKE_SOURCE_DIR}/eu07.rc.in ${CMAKE_BINARY_DIR}/eu07.rc @ONLY) @@ -476,6 +479,20 @@ target_link_libraries(${PROJECT_NAME} Threads::Threads) find_package(GLM REQUIRED) target_include_directories(${PROJECT_NAME} PRIVATE ${GLM_INCLUDE_DIR}) +find_package(EnTT CONFIG QUIET) +if (TARGET EnTT::EnTT) + message(STATUS "Using EnTT package target EnTT::EnTT") +elseif (EXISTS "${DEPS_DIR}/entt/src/entt/entt.hpp") + add_library(EnTT::EnTT INTERFACE IMPORTED) + set_target_properties(EnTT::EnTT PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${DEPS_DIR}/entt/src") + message(STATUS "Using bundled EnTT from ${DEPS_DIR}/entt/src") +else() + message(FATAL_ERROR + "EnTT not found. Install EnTT package (EnTTConfig.cmake) or provide ${DEPS_DIR}/entt/src.") +endif() +target_link_libraries(${PROJECT_NAME} EnTT::EnTT) + # JSON lib add_subdirectory(ref/json) target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json) diff --git a/ref/entt b/ref/entt new file mode 160000 index 00000000..9fdc43f6 --- /dev/null +++ b/ref/entt @@ -0,0 +1 @@ +Subproject commit 9fdc43f6f8189581ccc81dace2ece1d5a981ace0