-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to link to system Lua5.3 #609
Open
h3xx
wants to merge
1
commit into
opentomb:master
Choose a base branch
from
h3xx:allow-system-lua
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+110
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't the cmake provided |
||
# file Copyright.txt or https://cmake.org/licensing for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindLua53 | ||
--------- | ||
|
||
|
||
|
||
Locate Lua library This module defines | ||
|
||
:: | ||
|
||
LUA53_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) | ||
|
||
|
||
|
||
Note that the expected include convention is | ||
|
||
:: | ||
|
||
#include "lua.h" | ||
|
||
and not | ||
|
||
:: | ||
|
||
#include <lua/lua.h> | ||
|
||
This is because, the lua location is not standardized and may exist in | ||
locations other than lua/ | ||
#]=======================================================================] | ||
|
||
find_path(LUA_INCLUDE_DIR lua.h | ||
HINTS | ||
ENV LUA_DIR | ||
PATH_SUFFIXES include/lua53 include/lua5.3 include/lua-5.3 include/lua include | ||
PATHS | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/sw # Fink | ||
/opt/local # DarwinPorts | ||
/opt/csw # Blastwave | ||
/opt | ||
) | ||
|
||
find_library(LUA_LIBRARY | ||
NAMES lua53 lua5.3 lua-5.3 lua | ||
HINTS | ||
ENV LUA_DIR | ||
PATH_SUFFIXES lib lib/lua53 | ||
PATHS | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/sw | ||
/opt/local | ||
/opt/csw | ||
/opt | ||
) | ||
|
||
if(LUA_LIBRARY) | ||
# include the math library for Unix | ||
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) | ||
find_library(LUA_MATH_LIBRARY m) | ||
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") | ||
# For Windows and Mac, don't need to explicitly include the math library | ||
else() | ||
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") | ||
endif() | ||
endif() | ||
|
||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") | ||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"") | ||
|
||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") | ||
unset(lua_version_str) | ||
endif() | ||
|
||
# include(${CMAKE_MODULE_PATH}/FindPackageHandleStandardArgs.cmake) | ||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if | ||
# all listed variables are TRUE | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua53 | ||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR | ||
VERSION_VAR LUA_VERSION_STRING) | ||
|
||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong condition