1 #! This CMake macro adds the necessary library and incllude 2 #! directories to a swig-project. 5 #! swig_module : Name of the SWIG module, for example pyMITK 6 #! library_names : Semicolon separated list of the libraries that are included, for example "MitkCore;mbilog" 10 # function inspired by 11 # https://stackoverflow.com/questions/37205274/swig-and-cmake-make-use-of-information-provided-by-target-include-directories 12 # This function tells cmake which additional dependencies are existing 13 # especially with respect to the linker dependencies. 15 foreach(library_name ${library_names})
16 # Adding each library as a linker dependency:
17 swig_link_libraries(${swig_module} ${library_name})
18 # Extracting all include directories from each given project and
19 # then including these directories to the newly created swig project.
20 get_property(LIBRARY_INCLUDES
22 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
23 # Checking each given librarie to include all includes from
this library.
27 # In addition include python dependencies: 28 include_directories( ${PYTHON_INCLUDE_DIR})
mitkSwigAddLibraryDependencies(swig_module, library_names)