${PROJECT_HEADERS}
)
-SWIG_ADD_MODULE(CollectionAPI python CollectionAPI.i ${PROJECT_HEADERS})
+IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
+ SWIG_ADD_LIBRARY(CollectionAPI LANGUAGE python SOURCES CollectionAPI.i ${PROJECT_HEADERS})
+ELSE()
+ SWIG_ADD_MODULE(CollectionAPI python CollectionAPI.i ${PROJECT_HEADERS})
+ENDIF()
SWIG_LINK_LIBRARIES(CollectionAPI ${SWIG_LINK_LIBRARIES})
IF(WIN32)