Skip to content

Commit

Permalink
[brief] Fix the install logic.
Browse files Browse the repository at this point in the history
[detailed]
- Forgot to rename the include variable.
- Remove the status message from Findlua.
  • Loading branch information
marovira committed Nov 11, 2024
1 parent 927d47c commit 085449b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(LUA_TEST_ROOT ${LUA_SOURCE_ROOT}/test)
add_subdirectory(${LUA_SOURCE_ROOT})

#================================
# Lua interpreter
# Install
#================================
if (LUA_INSTALL_TARGET)
install(TARGETS liblua
Expand Down Expand Up @@ -59,7 +59,7 @@ if (LUA_INSTALL_TARGET)
)

install(FILES
${LUA_LIBRARY_PUBLIC_INCLUDE}
${LUA_INSTALL_INCLUDE}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lua"
)

Expand Down
9 changes: 4 additions & 5 deletions cmake/Findlua.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Locate Lua library
# This module defines
# LUA_EXECUTABLE, if found
# LUA_FOUND, if false, do not try to link to Lua
# LUA_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
Expand Down Expand Up @@ -31,7 +31,7 @@ set(_POSSIBLE_LUA_LIBRARY_DEBUG luad lua_libd)

# Determine the possible naming suffixes (there is not standard for this).
if (lua_FIND_VERSION_MAJOR AND lua_FIND_VERSION_MINOR)
set(_POSSBILE_SUFFIXES
set(_POSSBILE_SUFFIXES
"${lua_FIND_VERSION_MAJOR}${lua_FIND_VERSION_MINOR}"
"${lua_FIND_VERSION_MAJOR}.${lua_FIND_VERSION_MINOR}"
"-${lua_FIND_VERSION_MAJOR}.${lua_FIND_VERSION_MINOR}"
Expand Down Expand Up @@ -80,7 +80,7 @@ find_program(LUA_EXECUTABLE

# Find the Lua header.
find_path(LUA_INCLUDE_DIR lua.h
HINTS $ENV{LUA_DIR}
HINTS $ENV{LUA_DIR}
PATH_SUFFIXES ${_POSSIBLE_LUA_INCLUDE}
PATHS ${_POSSIBLE_PATHS}
)
Expand Down Expand Up @@ -145,10 +145,9 @@ find_package_handle_standard_args(lua
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY
LUA_EXECUTABLE)

message(STATUS "found: ${lua_FOUND}")
if(lua_FOUND AND NOT TARGET lua::lua_lib)
add_library(lua::lua STATIC IMPORTED)
set_target_properties(lua::lua PROPERTIES
set_target_properties(lua::lua PROPERTIES
IMPORTED_LOCATION_DEBUG ${LUA_LIBRARY_DEBUG}
IMPORTED_LOCATION_RELEASE ${LUA_LIBRARY_RELEASE}
IMPORTED_LOCATION_RELWITHDEBINFO ${LUA_LIBRARY_RELEASE}
Expand Down

0 comments on commit 085449b

Please sign in to comment.