The correct CMakeLists.txt file to call a MAXON libarary in a Python script using pybind11

后端 未结 2 1317
一整个雨季
一整个雨季 2020-12-12 05:55

I\'m very new to the whole CMake. Following this and this posts, now I want to call a MAXON function inside Python, using pybind11. What I have done so far:

  • The
2条回答
  •  余生分开走
    2020-12-12 06:19

    pybind11_add_module already creates a target for you. So you don't need add_executable anymore. Just remove that line and when you will build you will get a library with the name HelloEposCmd

    add_executable is needed if you are building an executable (.exe), which I believe is not what you want.

    Documenation of pybind11 says.

    This function behaves very much like CMake’s builtin add_library (in fact, it’s a wrapper function around that command).

提交回复
热议问题