Commit 013193d0 authored by Daniele E. Domenichelli's avatar Daniele E. Domenichelli

SwigTest: Update for swig_add_library and add lua example

parent ec1d585c
Pipeline #34759 passed with stage
......@@ -7,6 +7,7 @@ project(example_${language}_class)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
unset(SWIG_LANG_TYPE)
if(${language} MATCHES python)
find_package(PythonLibs)
include_directories(${PYTHON_INCLUDE_PATH})
......@@ -38,6 +39,12 @@ if(${language} MATCHES pike)
include_directories(${PIKE_INCLUDE_PATH})
set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
endif()
if(${language} MATCHES lua)
find_package(Lua)
include_directories(${LUA_INCLUDE_DIR})
set(SWIG_LANG_TYPE TYPE SHARED)
set(SWIG_LANG_LIBRARIES ${LUA_LIBRARIES})
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
......@@ -45,6 +52,8 @@ set(CMAKE_SWIG_FLAGS "")
set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON)
set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
SWIG_ADD_MODULE(example "${language}"
example.i example.cxx)
SWIG_ADD_LIBRARY(example
LANGUAGE "${language}"
${SWIG_LANG_TYPE}
SOURCES example.i example.cxx)
SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment