2 FIND_PACKAGE(PythonLibs REQUIRED)
3 MESSAGE( STATUS "Python include path: ${PYTHON_INCLUDE_PATH}" )
5 SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
6 SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
9 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx
10 COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for python..."
11 COMMAND ${SWIG_EXECUTABLE} -c++ -python -xmlout ${CMAKE_CURRENT_BINARY_DIR}/parse.xml -o ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx -I${ZYPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../zypp.i
12 COMMAND ${CMAKE_COMMAND} -E echo "Done."
13 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
14 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i
17 ADD_CUSTOM_TARGET( glue
18 DEPENDS ${SWIG_OUTPUT}
21 ADD_LIBRARY( _zypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
22 SET_TARGET_PROPERTIES( _zypp PROPERTIES PREFIX "" )
23 ADD_DEPENDENCIES( _zypp glue )
25 INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} )
26 INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} )
27 TARGET_LINK_LIBRARIES( _zypp ${ZYPP_LIBRARY} )