# # The configuration file for CMake build engine. See the documentation of the CMake project for details. # # Find and include required packages FIND_PACKAGE( SWIG REQUIRED ) FIND_PACKAGE( PythonLibs REQUIRED ) # Include all necessarry CMake modules INCLUDE( ${SWIG_USE_FILE} ) # Set include python path INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) # Tell to SWIG that generated file is C++, and that .i files to include are one directory up SET_SOURCE_FILES_PROPERTIES( MyModulePython.i PROPERTIES CPLUSPLUS ON ) SET_SOURCE_FILES_PROPERTIES( MyModulePython.i PROPERTIES SWIG_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../") # Create wrapping c++ file from .i files SWIG_ADD_MODULE( my_module python MyModulePython.i ) # Link all together to create wrapping library (MyModule is C++ library) SWIG_LINK_LIBRARIES( my_module MyModule pthread )