summaryrefslogtreecommitdiffstats
path: root/Tests/SwigTest/CMakeLists.txt
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-30 16:17:06 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-30 16:17:06 (GMT)
commita828368232fe08e0065c26e07c38f4dafc78aadf (patch)
tree4d241763e626a7af5d127864e3afff22953d2633 /Tests/SwigTest/CMakeLists.txt
parent257daa4635ed9b88035c84c5cb1fcc689268a949 (diff)
downloadCMake-a828368232fe08e0065c26e07c38f4dafc78aadf.zip
CMake-a828368232fe08e0065c26e07c38f4dafc78aadf.tar.gz
CMake-a828368232fe08e0065c26e07c38f4dafc78aadf.tar.bz2
ENH: Here is test for swig module
Diffstat (limited to 'Tests/SwigTest/CMakeLists.txt')
-rw-r--r--Tests/SwigTest/CMakeLists.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt
new file mode 100644
index 0000000..9fbb1f4
--- /dev/null
+++ b/Tests/SwigTest/CMakeLists.txt
@@ -0,0 +1,45 @@
+SET(language "python")
+
+
+PROJECT(example_${language}_class)
+
+FIND_PACKAGE(SWIG)
+IF(SWIG_FOUND)
+ INCLUDE(${SWIG_USE_FILE})
+
+ IF(${language} MATCHES python)
+ FIND_PACKAGE(PythonLibs)
+ INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+ ENDIF(${language} MATCHES python)
+ IF(${language} MATCHES perl)
+ FIND_PACKAGE(PerlLibs)
+ INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
+ ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
+ ENDIF(${language} MATCHES perl)
+ IF(${language} MATCHES tcl)
+ FIND_PACKAGE(TCL)
+ INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
+ ENDIF(${language} MATCHES tcl)
+ IF(${language} MATCHES ruby)
+ FIND_PACKAGE(Ruby)
+ INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
+ ENDIF(${language} MATCHES ruby)
+ IF(${language} MATCHES php4)
+ FIND_PACKAGE(PHP4)
+ INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
+ ENDIF(${language} MATCHES php4)
+ IF(${language} MATCHES pike)
+ FIND_PACKAGE(Pike)
+ INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
+ ENDIF(${language} MATCHES pike)
+
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+ 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_LINK_LIBRARIES(example ${PYTHON_LIBRARY})
+ENDIF(SWIG_FOUND)