I'm trying to run a python script that uses a custom module written by someone else. I created that module by running CMake according to the creator's instructions. Running my python script, I get the error: ImportError: libopencv_imgproc.so.3.1: cannot open shared object file: No such file or directory. This error is caused by the module I created earlier.
There is no file of that name since I have OpenCV 3.2.0 installed, so in usr/local/lib there's libopencv_imgproc.so.3.2.0. I don't know how to fix this or where to start looking. The CMakeLists.txt of the module has a line 
find_package(OpenCV 3 COMPONENTS core highgui imgproc REQUIRED).
I tried changing it to 
find_package(OpenCV 3.2.0 COMPONENTS core highgui imgproc REQUIRED), 
without success.
The problem was an old version of the module lurking an a different folder where the python script was actually looking. This must have been created in the past with an OpenCV 3.1 environment.
How can I force CMake to use the correct OpenCV version?