2012-08-13 21:47:32 +04:00
|
|
|
set(language "python")
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
project(example_${language}_class)
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_package(SWIG REQUIRED)
|
|
|
|
include(${SWIG_USE_FILE})
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES python)
|
|
|
|
find_package(PythonLibs)
|
|
|
|
include_directories(${PYTHON_INCLUDE_PATH})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES perl)
|
|
|
|
find_package(PerlLibs)
|
|
|
|
include_directories(${PERL_INCLUDE_PATH})
|
|
|
|
add_definitions(${PERL_EXTRA_C_FLAGS})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES tcl)
|
|
|
|
find_package(TCL)
|
|
|
|
include_directories(${TCL_INCLUDE_PATH})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES ruby)
|
|
|
|
find_package(Ruby)
|
|
|
|
include_directories(${RUBY_INCLUDE_PATH})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES php4)
|
|
|
|
find_package(PHP4)
|
|
|
|
include_directories(${PHP4_INCLUDE_PATH})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${language} MATCHES pike)
|
|
|
|
find_package(Pike)
|
|
|
|
include_directories(${PIKE_INCLUDE_PATH})
|
|
|
|
set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_SWIG_FLAGS "")
|
2004-04-30 20:17:06 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON)
|
|
|
|
set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
2004-05-04 01:51:06 +04:00
|
|
|
SWIG_ADD_MODULE(example "${language}"
|
|
|
|
example.i example.cxx)
|
|
|
|
SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})
|