3 # LUAJIT_FOUND, if false, do not try to link to Lua
5 # LUAJIT_INCLUDE_DIR, where to find lua.h
7 # Note that the expected include convention is
10 # #include <lua/lua.h>
11 # This is because, the lua location is not standardized and may exist
12 # in locations other than lua/
14 #=============================================================================
15 # Copyright 2007-2009 Kitware, Inc.
17 # Distributed under the OSI-approved BSD License (the "License");
18 # see accompanying file Copyright.txt for details.
20 # This software is distributed WITHOUT ANY WARRANTY; without even the
21 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 # See the License for more information.
23 #=============================================================================
24 # (To distributed this file outside of CMake, substitute the full
25 # License text for the above reference.)
28 # 2010 - modified for cronkite to find luajit instead of lua, as it was before.
31 FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
34 PATH_SUFFIXES luajit-2.0 luajit2.0 luajit luajit-2.1
41 /opt/local # DarwinPorts
46 FIND_LIBRARY(LUAJIT_LIBRARY
47 NAMES libluajit-51.a libluajit-5.1.a libluajit.a libluajit-5.1.so
50 PATH_SUFFIXES lib64 lib
63 IF(UNIX AND NOT APPLE)
64 FIND_LIBRARY(LUAJIT_MATH_LIBRARY m)
65 FIND_LIBRARY(LUAJIT_DL_LIBRARY dl)
66 SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_DL_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
67 ELSE(UNIX AND NOT APPLE)
68 SET( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
69 ENDIF(UNIX AND NOT APPLE)
72 INCLUDE(FindPackageHandleStandardArgs)
73 # handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
74 # all listed variables are TRUE
75 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
77 MARK_AS_ADVANCED(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)