From 2b28b3ca6ff65f1ff1840cfdedb45f72498cd15e Mon Sep 17 00:00:00 2001 From: Zam Date: Mon, 15 Oct 2018 16:05:40 +0800 Subject: add BUILD_SHARED to support library type and add BUILD_SHARED to README --- README.md | 15 ++++++++------- src/CMakeLists.txt | 7 ++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 29542c13..42239e03 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,14 @@ Build from command line: You can pass the following arguments to CMake: - BUILD_DOCUMENTATION to build the documentation - BUILD_EXAMPLES to build the examples - BUILD_TESTS to build the unit tests - WITH_OPUS to enable opus audio codec - WITH_SPEEX to enable speex audio codec - WITH_THEORA to enable theora video codec - WITH_VPX to enable vpx video codec + BUILD_SHARED to build with shared type library, otherwise static (default: true) + BUILD_DOCUMENTATION to build the documentation (default: false) + BUILD_EXAMPLES to build the examples (default: true) + BUILD_TESTS to build the unit tests (default: true) + WITH_OPUS to enable opus audio codec (default: false) + WITH_SPEEX to enable speex audio codec (default: false) + WITH_THEORA to enable theora video codec (default: false) + WITH_VPX to enable vpx video codec (default: false) INSTALLING QXMPP ================ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac46cf4c..976f069e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -161,6 +161,7 @@ option(WITH_SPEEX "Support the Speex codec" OFF) option(WITH_OPUS "Support the Opus codec" OFF) option(WITH_THEORA "Support the Theora codec" OFF) option(WITH_VPX "Support the VPX codec" OFF) +option(BUILD_SHARED "Build SHARED library" ON) if(WITH_SPEEX) find_package(Speex REQUIRED) @@ -187,7 +188,11 @@ if(WITH_VPX) add_definitions(-DQXMPP_USE_VPX) endif() -add_library(qxmpp SHARED ${SOURCE_FILES}) +if(BUILD_SHARED) + add_library(qxmpp SHARED ${SOURCE_FILES}) +else() + add_library(qxmpp STATIC ${SOURCE_FILES}) +endif() set_target_properties(qxmpp PROPERTIES VERSION ${VERSION_STRING} -- cgit v1.2.3