summaryrefslogtreecommitdiffstats
path: root/Tests/SwigTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-14 14:44:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-11-14 14:44:17 (GMT)
commit4a4be0301bd9c6062738e87892cbe5bd8d900a49 (patch)
treeb295dd5100b0cce4c2baec04378571ae2a22b683 /Tests/SwigTest
parentbfa8831f0219d7c01ff3f434882e2ad941206e96 (diff)
parenta57e76301baf95bc4acf9a1ed50e349220b45579 (diff)
downloadCMake-4a4be0301bd9c6062738e87892cbe5bd8d900a49.zip
CMake-4a4be0301bd9c6062738e87892cbe5bd8d900a49.tar.gz
CMake-4a4be0301bd9c6062738e87892cbe5bd8d900a49.tar.bz2
Merge topic 'swig_add_library'
a57e7630 Help: Add notes for topic 'swig_add_library' 013193d0 SwigTest: Update for swig_add_library and add lua example ec1d585c UseSWIG: Do not set PREFIX property for SHARED and STATIC lua libraries 4c5b3c1c UseSWIG: Do not set NO_SONAME property for SHARED and STATIC libraries d0a9d8bb UseSWIG: Add swig_add_library macro.
Diffstat (limited to 'Tests/SwigTest')
-rw-r--r--Tests/SwigTest/CMakeLists.txt13
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})