[CMake] install a demo program only if requestet

Wilfried Holzke cmake at holzke.net
Sun Jan 11 10:00:12 EST 2009


Hi,

> cmake -DWITH_DEMO=ON srcdir
> 
> in CMakeLists.txt:
> 
> if(WITH_DEMO)
>    install( demo ....)
> endif(WITH_DEMO)

If nothing else depends on the demo code I could do

if(WITH_DEMO)
  add_subdirectory(example)
endif(WITH_DEMO)

to avoid building the whole source, right?

regards

  W. Holzke


More information about the CMake mailing list