4 PROJECT(example_${language}_class)
6 FIND_PACKAGE(SWIG REQUIRED)
7 INCLUDE(${SWIG_USE_FILE})
9 IF(${language} MATCHES python)
10 FIND_PACKAGE(PythonLibs)
11 INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
12 SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
13 ENDIF(${language} MATCHES python)
14 IF(${language} MATCHES perl)
15 FIND_PACKAGE(PerlLibs)
16 INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
17 ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
18 SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
19 ENDIF(${language} MATCHES perl)
20 IF(${language} MATCHES tcl)
22 INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
23 SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
24 ENDIF(${language} MATCHES tcl)
25 IF(${language} MATCHES ruby)
27 INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
28 SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
29 ENDIF(${language} MATCHES ruby)
30 IF(${language} MATCHES php4)
32 INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
33 SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
34 ENDIF(${language} MATCHES php4)
35 IF(${language} MATCHES pike)
37 INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
38 SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
39 ENDIF(${language} MATCHES pike)
41 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
43 SET(CMAKE_SWIG_FLAGS "")
45 SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
46 SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
47 SWIG_ADD_MODULE(example "${language}"
48 example.i example.cxx)
49 SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})