INCLUDE( ${SWIG_USE_FILE} )

SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern)

INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} )

SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE( PList python plist.i )
SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} )

EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
    ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib()\nexcept: pass\n'"
    OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
    )

INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX}
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i
   DESTINATION include/plist/swig COMPONENT dev)


INCLUDE( ${SWIG_USE_FILE} )

SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern)

INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} )

SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE( PList python plist.i )
SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} )

EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
    ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)\nexcept: pass\n'"
    OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
    )

INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX}
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
   DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i
   DESTINATION include/plist/swig COMPONENT dev)


Install python bindings in the right directory on 64bit machines.
Install python bindings in the right directory on 64bit machines.
