blob: 93accad1469d2de54922585a25ab943525cac40d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# generate JNI library and create a jar
# Make from within Eclipse fails miserably with the whole thing
find_package(Lua51)
if(LUA51_FOUND)
include_directories(${LUA_INCLUDE_DIR})
else()
message(STATUS "No Lua headers found - not building Lua wrappers")
return()
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")
SET(USCXML_LUA_DIR "uscxml")
# we need ; to produce a space with the package .. weird
SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES SWIG_FLAGS "-w473")
SET_SOURCE_FILES_PROPERTIES(uscxml.i PROPERTIES CPLUSPLUS ON)
SET(CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/${USCXML_LUA_DIR}")
SWIG_ADD_MODULE(uscxmlNativeLua lua uscxml.i)
foreach(LUA_LIBRARY ${LUA_LIBRARIES})
SWIG_LINK_LIBRARIES(uscxmlNativeLua ${LUA_LIBRARY})
endforeach()
set_target_properties(uscxmlNativeLua PROPERTIES FOLDER "Bindings")
set_target_properties(uscxmlNativeLua PROPERTIES COMPILE_FLAGS "-DSWIG")
swig_link_libraries(uscxmlNativeLua uscxml)
set(USCXML_LANGUAGE_BINDINGS "lua ${USCXML_LANGUAGE_BINDINGS}")
set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE)
|