[CMake] User defined variable not propagating into subdirs

Stephen Collyer scollyer at netspinner.co.uk
Fri Nov 16 10:15:05 EST 2007


Bill Hoffman wrote:

> If you want to change all the libraries in your project to shared, you
> can use the global variable BUILD_SHARED_LIBS, and use add_library
> without specifying shared or static.
> 
> $ cmake --help-command add_library
> cmake version 2.4-patch 7
>   ADD_LIBRARY
>        Add a library to the project using the specified source files.
> 
>          ADD_LIBRARY(libname [SHARED | STATIC | MODULE]
> .....  If no keywords appear as the
>        second argument, the type defaults to the current value of
>        BUILD_SHARED_LIBS.  If this variable is not set, the type
>        defaults to STATIC.

Thanks for that. I'd read it before but hadn't understood the
significance.

-- 
Regards

Steve Collyer
Netspinner Ltd


More information about the CMake mailing list