diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-01-09 18:39:29 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-01-19 09:07:16 +0100 |
commit | ad1ef1b64590b72a3286046f8baa79ac055f9923 (patch) | |
tree | 05950e99844a12c4c37a9a7a4f8b2cbbe6a59be4 /host/lib | |
parent | 734180c44b438cf707c4ff48bf4b11a8c5a94136 (diff) | |
download | uhd-ad1ef1b64590b72a3286046f8baa79ac055f9923.tar.gz uhd-ad1ef1b64590b72a3286046f8baa79ac055f9923.tar.bz2 uhd-ad1ef1b64590b72a3286046f8baa79ac055f9923.zip |
cmake: Added ENABLE_STATIC_LIBS option
- Allows building static libraries
- For users calling find_package(UHD), provides extra options
for building apps statically linking UHD.
- Updated the init_usrp example to link UHD statically.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index eed8b642c..5755a6c4c 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010-2014 Ettus Research LLC +# Copyright 2010-2015 Ettus Research LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -128,3 +128,14 @@ IF(NOT UHDHOST_PKG) #Syntax makes it unusable by UHD_INSTALL RUNTIME DESTINATION ${RUNTIME_DIR} COMPONENT libraries # .dll file ) ENDIF(NOT UHDHOST_PKG) + +####################################################### +# Setup libuhd library (static) +####################################################### +IF(ENABLE_STATIC_LIBS) + ADD_LIBRARY(uhd_static STATIC ${libuhd_sources}) + SET_TARGET_PROPERTIES(uhd_static PROPERTIES OUTPUT_NAME uhd) + INSTALL(TARGETS uhd_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib or .a file + ) +ENDIF(ENABLE_STATIC_LIBS) |