-INSTALL(TARGETS ${SWIG_MODULE_libBatch_Swig_REAL_NAME} DESTINATION lib/python${PYTHON_VERSION}/site-packages)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libBatch_Swig.py
- DESTINATION lib/python${PYTHON_VERSION}/site-packages)
-INSTALL(FILES Batch_PyVersatile.hxx DESTINATION include/Batch)
+SET(SWIG_EXTAR_DEPS
+ libBatch_Swig_exception.i
+ libBatch_Swig_typemap.i
+ )
+SET(SWIG_LB_DPYS
+ ../Core/Defines.hxx
+ ../Core/Constants.hxx
+ ../Core/Job.hxx
+ ../Core/JobId.hxx
+ ../Core/JobInfo.hxx
+ ../Core/CommunicationProtocol.hxx
+ ../Core/BatchManager.hxx
+ ../Core/BatchManagerCatalog.hxx
+ ../Core/FactBatchManager.hxx
+ )
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
+ SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES CPLUSPLUS ON
+ SWIG_FLAGS "-py3")
+ # SWIG source file and module name differ - the following needs to be
+ # set to avoid unnecessary rebuilds:
+ SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES SWIG_MODULE_NAME libbatch)