Add an ENABLE_SHARED option, defaults to ON, when set to OFF
quassel_add_module() will build modules as static (does not affect
platforms where modules would be built as static anyway.)
The option name ENABLE_SHARED is frequently used for this purpose in
cmake.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
+# Shared library support
+#####################################################################
+
+option(ENABLE_SHARED "Build modules as shared libraries" ON)
+add_feature_info(ENABLE_SHARED ENABLE_SHARED "Build modules as shared libraries")
+
# Setup unit testing
#####################################################################
# Setup unit testing
#####################################################################
string(REPLACE "::" "_" target ${target})
string(REPLACE "_" "-" output_name ${target})
string(REPLACE "::" "_" target ${target})
string(REPLACE "_" "-" output_name ${target})
+ if (ARG_STATIC OR NOT ENABLE_SHARED)
set(buildmode STATIC)
else()
set(buildmode SHARED)
set(buildmode STATIC)
else()
set(buildmode SHARED)