configuration - Exclude feature in CMake's configure -


with autotool's configure every feature can explicitly enabled --with-feature=... / --enable-feature=... or explicitly disabled --without-feature / --disable-feature.

some cmake find packages scripts evaluate variablesfeature_root search there first, uncommon , discouraged. cmake evaluates several paths , tries find libraries there. add feature not located in default paths, right path can added.

how can feature disabled, installed on system , found cmake's configure? example java installed in default below /usr , found cmake without adding path cmake; how can disable java? found.

i don't want manually modify cmakecache.txt.

to sum up: have project don't want/can modify, has find_package , have package (e.g. java) installed don't want cmake use package. want switch/flag deactivate installed , found package.

as discovered, not difficult @ all. prevent feature being found, pass

-dfeature_found=false 

to cmake , not found, when installed.

or 1 can pass

-dcmake_disable_find_package_feature=true 

to suppress find module completely.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -