Activation of the PvAPI in Cmake

I have a problem to turn on PvAPI using Cmake.
I have run the following command in Linux Terminal:

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_GENERATE_PKGCONFIG=ON
-D WITH_GSTREAMER=ON
-D WITH_PVAPI=ON
-D PVAPI_LIBRARY="/usr/local/lib/libPvAPI.a"
-D PVAPI_LIBRARY="/usr/local/lib/libImagelib.a"
-D OPENCV_EXTRA_MODULES_PATH=~/adehome/Application/opencv_contrib/modules
-D BUILD_EXAMPLES=ON …

I have add “-D WITH_PVAPI=ON " and -D PVAPI_LIBRARY=”/usr/local/lib/libPvAPI.a" , but PvAPi was not activated anyway. As you can see below, PvAPI says “NO” :

x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.3.0)
GDAL: YES (/usr/lib/libgdal.so)
GDCM: YES (3.0.4)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: YES (2.2.5)
FFMPEG: YES
avcodec: YES (58.54.100)
avformat: YES (58.29.100)
avutil: YES (56.31.100)
swscale: YES (5.5.100)
avresample: YES (4.0.0)
GStreamer: YES (1.16.2)
PvAPI: NO
v4l/v4l2: YES (linux/videodev2.h)

Can anyone here help me what else I need to do here to enable PvAPI ?

duplication. 2nd define will overwrite the 1st (i guess)

then, since cap_pvapi.cpp includes PvApi.h it must also find this header

I put the header file PvApi.h in the folder where the file cap_pvapi.cpp is located, then I executed the command:

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_GENERATE_PKGCONFIG=ON
-D WITH_GSTREAMER=ON
-D WITH_PVAPI=ON
-D PVAPI_LIBRARY="/usr/local/lib/libPvAPI.a"
-D OPENCV_EXTRA_MODULES_PATH=~/adehome/Application/opencv_contrib/modules
-D BUILD_EXAMPLES=ON …

But PvApi is still not activated. It still says “NO” for PvAPI.
Is there anything missing that I need to add ?

bad idea, imo. it rather looks like you need to add something like PVAPI_INCLUDE to the cmake cmdline