diff options
author | Daniele E. Domenichelli <daniele.domenichelli@iit.it> | 2016-11-10 16:02:23 (GMT) |
---|---|---|
committer | Daniele E. Domenichelli <daniele.domenichelli@iit.it> | 2016-11-11 07:14:10 (GMT) |
commit | 013193d0b00f5a9db5440b2306548b44cbcfc21c (patch) | |
tree | 1a30cdef5bdff0c724c2e181f3ab5f0ee58a015e /Tests | |
parent | ec1d585c43b60a8f9c7b3cb1636e831915b37eb0 (diff) | |
download | CMake-013193d0b00f5a9db5440b2306548b44cbcfc21c.zip CMake-013193d0b00f5a9db5440b2306548b44cbcfc21c.tar.gz CMake-013193d0b00f5a9db5440b2306548b44cbcfc21c.tar.bz2 |
SwigTest: Update for swig_add_library and add lua example
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/SwigTest/CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt index 17a502d..65f5c93 100644 --- a/Tests/SwigTest/CMakeLists.txt +++ b/Tests/SwigTest/CMakeLists.txt @@ -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}) |