<div dir="ltr"><div dir="ltr" style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">Hi,<div><br></div><div>I am trying to find a good way to compile a python module for a c++ library using boost-python for both python2 and python3 in the same compilation. So far, <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The only solution I found for using</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div>FIND_PACKAGE(PythonInterp REQUIRED)</div><div>FIND_PACKAGE(PythonLibs REQUIRED)<br></div></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div>FIND_PACKAGE(Boost REQUIRED COMPONENTS python # or python3)</div><div><br></div></div>with different python versions is to use one CMakeLists.txt per python version, each in a subdirectory, and with almost equal contents. I would appreciate suggestions for a better approach, with less duplication.</div><div><br></div><div>Best regards,</div><div><br></div><div>Alexander Bürger</div><div>MET Norway</div></div><br></div>