diff --git a/CMakeLists.txt b/CMakeLists.txt index 2295b1b..7e7f236 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,22 +3,8 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR) project(UECS VERSION 0.9.5) message(STATUS "[Project] ${PROJECT_NAME}") -include(FetchContent) -set(UCMake_VERSION 0.5.4) -message(STATUS "find package: UCMake ${UCMake_VERSION}") -find_package(UCMake ${UCMake_VERSION} QUIET) -if(NOT UCMake_FOUND) - message(STATUS "UCMake ${UCMake_VERSION} not found") - set(_address "https://github.com/Ubpa/UCMake") - message(STATUS "fetch: ${_address} with tag ${UCMake_VERSION}") - FetchContent_Declare( - UCMake - GIT_REPOSITORY ${_address} - GIT_TAG ${UCMake_VERSION} - ) - FetchContent_MakeAvailable(UCMake) - message(STATUS "UCMake ${UCMake_VERSION} build done") -endif() +include(cmake/InitUCMake.cmake) +Ubpa_InitUCMake() Ubpa_InitProject() diff --git a/cmake/InitUCMake.cmake b/cmake/InitUCMake.cmake new file mode 100644 index 0000000..a50a91a --- /dev/null +++ b/cmake/InitUCMake.cmake @@ -0,0 +1,18 @@ +macro(Ubpa_InitUCMake) + include(FetchContent) + set(UCMake_VERSION 0.5.5) + message(STATUS "find package: UCMake ${UCMake_VERSION}") + find_package(UCMake ${UCMake_VERSION} QUIET) + if(NOT UCMake_FOUND) + message(STATUS "UCMake ${UCMake_VERSION} not found") + set(_address "https://github.com/Ubpa/UCMake") + message(STATUS "fetch: ${_address} with tag ${UCMake_VERSION}") + FetchContent_Declare( + UCMake + GIT_REPOSITORY ${_address} + GIT_TAG ${UCMake_VERSION} + ) + FetchContent_MakeAvailable(UCMake) + message(STATUS "UCMake ${UCMake_VERSION} build done") + endif() +endmacro() diff --git a/include/UECS/detail/RTSCmptTraits.inl b/include/UECS/detail/RTSCmptTraits.inl index 5c2d1aa..33159a1 100644 --- a/include/UECS/detail/RTSCmptTraits.inl +++ b/include/UECS/detail/RTSCmptTraits.inl @@ -2,6 +2,8 @@ #include "../RTDCmptTraits.h" +#include + namespace Ubpa { inline size_t RTSCmptTraits::Sizeof(CmptType type) const { assert(sizeofs.find(type) != sizeofs.end());