ENH: Cleanup example a bit
This commit is contained in:
parent
baee28ce9b
commit
b691517eeb
|
@ -1,51 +1,49 @@
|
||||||
SET(language "tcl")
|
SET(language "python")
|
||||||
|
|
||||||
|
|
||||||
PROJECT(example_${language}_class)
|
PROJECT(example_${language}_class)
|
||||||
|
|
||||||
FIND_PACKAGE(SWIG)
|
FIND_PACKAGE(SWIG REQUIRED)
|
||||||
IF(SWIG_FOUND)
|
INCLUDE(${SWIG_USE_FILE})
|
||||||
INCLUDE(${SWIG_USE_FILE})
|
|
||||||
|
|
||||||
IF(${language} MATCHES python)
|
IF(${language} MATCHES python)
|
||||||
FIND_PACKAGE(PythonLibs)
|
FIND_PACKAGE(PythonLibs)
|
||||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
|
||||||
SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
|
SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
|
||||||
ENDIF(${language} MATCHES python)
|
ENDIF(${language} MATCHES python)
|
||||||
IF(${language} MATCHES perl)
|
IF(${language} MATCHES perl)
|
||||||
FIND_PACKAGE(PerlLibs)
|
FIND_PACKAGE(PerlLibs)
|
||||||
INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
|
||||||
ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
|
ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
|
||||||
SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
|
SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
|
||||||
ENDIF(${language} MATCHES perl)
|
ENDIF(${language} MATCHES perl)
|
||||||
IF(${language} MATCHES tcl)
|
IF(${language} MATCHES tcl)
|
||||||
FIND_PACKAGE(TCL)
|
FIND_PACKAGE(TCL)
|
||||||
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
|
||||||
SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
|
SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
|
||||||
ENDIF(${language} MATCHES tcl)
|
ENDIF(${language} MATCHES tcl)
|
||||||
IF(${language} MATCHES ruby)
|
IF(${language} MATCHES ruby)
|
||||||
FIND_PACKAGE(Ruby)
|
FIND_PACKAGE(Ruby)
|
||||||
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
|
||||||
SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
|
SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
|
||||||
ENDIF(${language} MATCHES ruby)
|
ENDIF(${language} MATCHES ruby)
|
||||||
IF(${language} MATCHES php4)
|
IF(${language} MATCHES php4)
|
||||||
FIND_PACKAGE(PHP4)
|
FIND_PACKAGE(PHP4)
|
||||||
INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
|
||||||
SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
|
SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
|
||||||
ENDIF(${language} MATCHES php4)
|
ENDIF(${language} MATCHES php4)
|
||||||
IF(${language} MATCHES pike)
|
IF(${language} MATCHES pike)
|
||||||
FIND_PACKAGE(Pike)
|
FIND_PACKAGE(Pike)
|
||||||
INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
|
||||||
SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
|
SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
|
||||||
ENDIF(${language} MATCHES pike)
|
ENDIF(${language} MATCHES pike)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
SET(CMAKE_SWIG_FLAGS "")
|
SET(CMAKE_SWIG_FLAGS "")
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
|
SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
|
||||||
SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
||||||
SWIG_ADD_MODULE(example "${language}"
|
SWIG_ADD_MODULE(example "${language}"
|
||||||
example.i example.cxx)
|
example.i example.cxx)
|
||||||
SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})
|
SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})
|
||||||
ENDIF(SWIG_FOUND)
|
|
||||||
|
|
Loading…
Reference in New Issue