ENH: Use improved target dependencies for Xcode
[cmake.git] / Tests / SwigTest / CMakeLists.txt
blob5a8e61922aef46858b9675885fe802b86523fcd9
1 SET(language "python")
3 cmake_minimum_required (VERSION 2.6)
5 PROJECT(example_${language}_class)
7 FIND_PACKAGE(SWIG REQUIRED)
8 INCLUDE(${SWIG_USE_FILE})
10 IF(${language} MATCHES python)
11   FIND_PACKAGE(PythonLibs)
12   INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
13   SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
14 ENDIF(${language} MATCHES python)
15 IF(${language} MATCHES perl)
16   FIND_PACKAGE(PerlLibs)
17   INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
18   ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
19   SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
20 ENDIF(${language} MATCHES perl)
21 IF(${language} MATCHES tcl)
22   FIND_PACKAGE(TCL)
23   INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
24   SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
25 ENDIF(${language} MATCHES tcl)
26 IF(${language} MATCHES ruby)
27   FIND_PACKAGE(Ruby)
28   INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
29   SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
30 ENDIF(${language} MATCHES ruby)
31 IF(${language} MATCHES php4)
32   FIND_PACKAGE(PHP4)
33   INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH}) 
34   SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
35 ENDIF(${language} MATCHES php4)
36 IF(${language} MATCHES pike)
37   FIND_PACKAGE(Pike)
38   INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
39   SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
40 ENDIF(${language} MATCHES pike)
42 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
44 SET(CMAKE_SWIG_FLAGS "")
46 SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
47 SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
48 SWIG_ADD_MODULE(example "${language}"
49   example.i example.cxx)
50 SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})