i am tiring to make my library on Cmake
inside of CmakeLists.txt
# CMakeList.txt : CMake project for Engine, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()
project ("Engine" VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_VISIBLITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINE_HIDDEN YES)
#set obj for headers and src
set("Engine_src" mimiEngine.cpp Window.cpp Text_Component.cpp Texture2D.cpp)
set("Engine_headers" MimiEngine.h Window.h Text_Component.h Texture2D.h ${CMAKE_CURRENT_BINARY_DIR}/Engine_export.h)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
# Add source to this project's executable.
#add_executable (MimiEngine "scr/MimiEngine.cpp" "include/MimiEngine.h" "include/Window.h" "scr/Window.cpp" "include/Text_Component.h" "include/Texture2D.h" "scr/Texture2D.cpp" "scr/Text_Component.cpp")
add_library(Engine "Engine.cpp" "Engine.h" "include/Window.h" "scr/Window.cpp" "include/Text_Component.h" "include/Texture2D.h" "scr/Texture2D.cpp" "scr/Text_Component.cpp")
add_library(Engine::Engine ALIAS Engine)
target_link_libraries( Engine SDL2::SDL2 SDL2::SDL2main SDL2_image::SDL2_image SDL2_ttf::SDL2_ttf)
set_target_properties(Engine PROPERTIES
PUBLIC_HEADER "${Engine_headers}"
)
target_include_directories(Engine PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:include/Engine>
)
target_include_directories(Engine PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:include>
)
# gnarte marcro
include(GenerateExportHeader)
generate_export_header(Engine)
install(TARGETS Engine
EXPORT EngineTARGETS
LIBRARY
COMPONENT Engine-Llib
DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER
COMPONENT Engine-DEV
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT EngineTARGETS
NAMESPACE Engine::
COMPONENT Engine-DEV
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lib/Engine
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/include
)
include(CMakePackageConfigHelpers)
configure_package_config_file (
"${CMAKE_CURRENT_SOURCE_DIR}/EngineConfig.cmake.in" "${_output_file}"
"${CMAKE_CURRENT_BINARY_DIR}/EngineConfig.cmake" "${_output_file}"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Engine
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/EngineConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/EngineConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/EngineconfigVersion.cmake
COMPONENT Engine-DEV
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lib/Engine
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/include
)
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET Engine PROPERTY CXX_STANDARD 20)
endif()
# TODO: Add tests and install targets if needed.
here is error
**1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/CMakePackageConfigHelpers.cmake:390 (message):**
**1> [CMake] Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE():**
**1> [CMake] "C:/Users/memeo/Desktop/c++/MimiEngine/out/build/x64-debug/Engine/EngineConfig.cmake"**
**1> [CMake] Call Stack (most recent call first):**
**1> [CMake] Engine/CMakeLists.txt:71 (configure_package_config_file)**
**1> [CMake] -- Configuring incomplete, errors occurred!**