12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- # ---------------------------------
- # Finds LUA
- # Adds library to target
- # Adds include path
- # ---------------------------------
-
- GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyLua)
-
- IF(WIN32)
- FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lua/include NO_DEFAULT_PATH)
- ELSEIF(UNIX)
- if(${CMAKE_SYSTEM} MATCHES fc21)
- FIND_PACKAGE(Lua REQUIRED)
- else ()
- FIND_PACKAGE(Lua51 REQUIRED)
- endif()
- ENDIF()
-
- IF(LUA_INCLUDE_DIR)
- OV_PRINT(OV_PRINTED " Found Lua... in '${LUA_INCLUDE_DIR}'")
-
- IF(WIN32)
- FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIR}/../lib NO_DEFAULT_PATH)
- FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIR}/../lib)
- ENDIF()
-
- IF(LUA_LIBRARIES)
- OV_PRINT(OV_PRINTED " [ OK ] lib ${LUA_LIBRARIES}")
-
- INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LUA_LIBRARIES})
- ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyLua)
- IF(WIN32)
- INSTALL(FILES "${LUA_INCLUDE_DIR}/../bin/lua5.1.dll" DESTINATION "${DIST_BINDIR}")
- ENDIF()
- ELSE()
- OV_PRINT(OV_PRINTED " [FAILED] lib lua5.1")
- ENDIF()
-
- ELSE()
- OV_PRINT(OV_PRINTED " FAILED to find Lua")
- ENDIF()
-
-
- SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyLua "Yes")
|