Solved by Sven1 in post #6 
              
              
                The export is ignored by cmake. I solved it by adding the -DUSE_CUDA=OFF parameter to the cmake command. 
cmake -j 8 -DUSE_CUDA=OFF -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DPYTHON_EXECUTABLE:PATH=which python3 -DCMAKE_INSTALL_PREFIX:PATH=../$INSTALL_DIR ../$SOURCE_DIR