Is there a way for CMake to utilize dependencies generated by `swig -MM`?

后端 未结 1 1327
忘掉有多难
忘掉有多难 2021-02-08 05:21

SWIG generates wrapper code from your C/C++ in a desired target language (Python, Java, C#, etc) using an interface (.i) file that specifies the input code to be wrapped as desc

相关标签:
1条回答
  • 2021-02-08 05:46

    Turning my comments into an answer

    I don't think - if you want to do this automatically and e.g. want to utilize swig -MM - that this can be done without changing the UseSWIG.cmake code.

    When I look at why the previous attempt you have linked was reverted - namely the discussion of on "0012307: regression in 2.8.5 rc2: UseSWIG.cmake broken" - I don't believe that SWIG_GET_WRAPPER_DEPENDENCIES() was actually broken it just introduced a new restriction: "this simply require all headers for swig module to be present" before calling SWIG_ADD_MODULE().

    So I suggested to add the -ignoremissing SWIG option, but this would need further testing.


    Update (April 2017)

    With CMake version 3.8.0 there came a fix "Automatically scan dependencies of SWIG files for Makefile generators" that works for makefile generators.


    Reference

    The general discussion of how to fix this (including my suggestion) is discussed at "Issue #4147: [MODULES][UseSWIG] Use swig to compute dependencies". The ticket is still open (was reopened), so please feel free to add your support, suggestions or test results there.

    0 讨论(0)
提交回复
热议问题