Lua/lua-5.4.6/LuaConfig.cmake.in

24 lines
878 B
CMake
Raw Normal View History

2023-07-11 11:21:55 +00:00
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/LuaTargets.cmake")
set_and_check(LUA_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")
add_library(Lua::Library ALIAS "Lua::@LUA_EXPORT_LIBRARY@")
get_target_property(LUA_CONFIG "Lua::@LUA_EXPORT_LIBRARY@" IMPORTED_CONFIGURATIONS)
get_target_property(LUA_LIBRARY "Lua::@LUA_EXPORT_LIBRARY@" "IMPORTED_LOCATION_${LUA_CONFIG}")
set(LUA_LIBRARIES "${LUA_LIBRARY}")
add_library(LUA_INCLUDE_LIB INTERFACE)
target_include_directories(LUA_INCLUDE_LIB INTERFACE "${LUA_INCLUDE_DIR}")
list(APPEND LUA_LIBRARIES LUA_INCLUDE_LIB)
foreach(LIB_NAME @LUA_LINKED_LIBRARIES@)
find_library(LIB_LOCATION "${LIB_NAME}")
if(NOT LIB_LOCATION)
message(FATAL_ERROR "lib${LIB_NAME} not found and is required by lua")
else()
list(APPEND LUA_LIBRARIES "${LIB_LOCATION}")
endif()
endforeach()
check_required_components(Lua)