papi: add support for enumflag part 1 of 2
[vpp.git] / src / vpp-api / python / CMakeLists.txt
index 1b6aefa..6450fd9 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-find_package(PythonInterp 2.7)
-find_package(PythonLibs 2.7)
+if (CMAKE_VERSION VERSION_LESS 3.12)
+  find_package(PythonInterp 2.7)
+else()
+  find_package(Python3 COMPONENTS Interpreter)
+endif()
 
 if(PYTHONINTERP_FOUND)
   install(
@@ -28,5 +31,6 @@ if(PYTHONINTERP_FOUND)
          --dist-dir=${CMAKE_INSTALL_PREFIX}
       OUTPUT_QUIET
     )"
+    COMPONENT vpp-api-python
   )
 endif()