diff options
author | Robert Adam <krzmbrzl@gmail.com> | 2020-10-29 13:45:11 +0300 |
---|---|---|
committer | Robert Adam <krzmbrzl@gmail.com> | 2020-10-29 14:02:12 +0300 |
commit | 7babebf0f9769bead8ffece92bb3117ea22d16ba (patch) | |
tree | 7b35e76b01d1140a8e79ceebb56b100b00f1ed8c /cmake | |
parent | f5489231a9d3d23a8bed241217c9968826ab45c7 (diff) |
BUILD(cmake): Only install shared libraries
Libraries should only be installed if they are built as shared
libraries. Static libraries should only be needed during Mumble's
compilation and are therefore no required dependencies that have to be
installed alongside Mumble.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/install-library.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/install-library.cmake b/cmake/install-library.cmake new file mode 100644 index 000000000..8a57de7b8 --- /dev/null +++ b/cmake/install-library.cmake @@ -0,0 +1,17 @@ +# Copyright 2020 The Mumble Developers. All rights reserved. +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file at the root of the +# Mumble source tree or at <https://www.mumble.info/LICENSE>. + +function(install_library lib component) + get_target_property(lib_type ${lib} TYPE) + + if(NOT lib_type STREQUAL "STATIC_LIBRARY") + # only install non-static libraries + if(WIN32) + install(TARGETS ${lib} RUNTIME DESTINATION "${MUMBLE_INSTALL_LIBDIR}" COMPONENT "${component}") + else() + install(TARGETS ${lib} LIBRARY DESTINATION "${MUMBLE_INSTALL_LIBDIR}" COMPONENT "${component}") + endif() + endif() +endfunction() |