To build OpenCV as static library you need to set BUILD_SHARED_LIBS
flag to false/off:
cmake -DBUILD_SHARED_LIBS=OFF ..
But I think it is not enough for your task because you actually need to cross-compile library for you architecture. In case of Android or IOS such port already exists and you can simply use it. In case of another platform you need to create your own cmake toolchain file for cross-compiling and probably make a number of fixes in OpenCV build system.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…