0
|
1 # use lua
|
|
2 include_directories(${LUA_INCLUDE_DIR})
|
|
3
|
|
4 # Lua Module Names:
|
|
5 set(CMAKE_SHARED_MODULE_PREFIX "")
|
|
6
|
|
7 # DynLoad and DynCall:
|
|
8 include_directories( ${DynCall_SOURCE_DIR}/dyncall ${DynCall_SOURCE_DIR}/dynload ${DynCall_SOURCE_DIR}/dyncallback )
|
|
9
|
|
10 # Fix arch x86_64: force PIC always (even in static libraries)
|
|
11
|
|
12 if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
|
13 add_definitions("-fPIC")
|
|
14 endif()
|
|
15
|
|
16 add_library(smartptr MODULE smartptr.c)
|
|
17 add_library(intutils MODULE intutils.cpp)
|
|
18 add_library(ldynload MODULE ldynload.c)
|
|
19 add_library(ldyncall MODULE ldyncall.c)
|
|
20 add_library(ldynguess MODULE ldynguess.c)
|
|
21 add_library(ldynstruct MODULE ldynstruct.c)
|
|
22 add_library(ldyntype MODULE ldyntype.c)
|
|
23 add_library(larray MODULE larray.c dyntype.c)
|
|
24
|
|
25 target_link_libraries(ldynload dynload_s)
|
|
26 target_link_libraries(ldyncall dyncall_s)
|
|
27
|
|
28 install(TARGETS
|
|
29 ldynload smartptr
|
|
30 ldyncall
|
|
31 larray
|
|
32 intutils
|
|
33 ldynguess
|
|
34 # ldynstruct ldyntype
|
|
35 LIBRARY DESTINATION lib/lua
|
|
36 )
|
|
37
|
|
38 install(FILES
|
|
39 dynload.lua
|
|
40 dyncall.lua
|
|
41 dynport.lua path.lua
|
|
42 array.lua
|
|
43 # dynstruct.lua
|
|
44 # dyntype.lua
|
|
45 DESTINATION lib/lua
|
|
46 )
|
|
47
|
|
48 if(APPLE)
|
|
49 set(CMAKE_MODULE_LINKER_FLAGS "-bundle -undefined dynamic_lookup")
|
|
50 # build cocoautil library on mac os x
|
|
51 add_library(cocoautil MODULE cocoautil.m)
|
|
52 endif()
|
|
53
|