Disable features in cmake command line

Identical to "./configure --help", when a project uses cmake, we get building instructions like below,

1
2
3
4
mkdir bld
cd bld
cmake ..
cmake . -L

wait a while we will see all the variables cmake defined in cache.

Or directly look into CMakeCache.txt.

If we want to modify a variable to off, or say, disable some functionality,

1
FEATURE_test_name:BOOL=ON

we run cmake once again like this,

1
cmake -DFEATURE_test_name:BOOL=OFF ..

refer to:
https://www.oschina.net/question/231677_45266