CMake/Tests/SwigTest/CMakeLists.txt

50 lines
1.5 KiB
CMake
Raw Normal View History

2004-05-04 01:51:06 +04:00
SET(language "python")
2004-04-30 20:17:06 +04:00
PROJECT(example_${language}_class)
2004-05-04 01:51:06 +04:00
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
2004-04-30 20:17:06 +04:00
2004-05-04 01:51:06 +04:00
IF(${language} MATCHES python)
FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
ENDIF(${language} MATCHES python)
IF(${language} MATCHES perl)
FIND_PACKAGE(PerlLibs)
INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
ENDIF(${language} MATCHES perl)
IF(${language} MATCHES tcl)
FIND_PACKAGE(TCL)
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
ENDIF(${language} MATCHES tcl)
IF(${language} MATCHES ruby)
FIND_PACKAGE(Ruby)
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
ENDIF(${language} MATCHES ruby)
IF(${language} MATCHES php4)
FIND_PACKAGE(PHP4)
INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
ENDIF(${language} MATCHES php4)
IF(${language} MATCHES pike)
FIND_PACKAGE(Pike)
INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
ENDIF(${language} MATCHES pike)
2004-04-30 20:17:06 +04:00
2004-05-04 01:51:06 +04:00
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
2004-04-30 20:17:06 +04:00
2004-05-04 01:51:06 +04:00
SET(CMAKE_SWIG_FLAGS "")
2004-04-30 20:17:06 +04:00
2004-05-04 01:51:06 +04:00
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 ${SWIG_LANG_LIBRARIES})