summaryrefslogtreecommitdiff
path: root/gr-trellis/lib
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-06-27 15:10:31 -0400
committerTom Rondeau <tom@trondeau.com>2014-06-28 13:58:57 -0400
commit0099eb9bd7a11afdf9276d6f4a5dafa757ebdb7c (patch)
treeb278b8598719ce8a1284b1707c49d4e39c1a639c /gr-trellis/lib
parent3d8a19b55a15a285d5a95d1e786cb93e26cb4f3a (diff)
build: adds an ENABLE_STATIC_LIB option to cmake to build static (.a) versions of the libraries.
Diffstat (limited to 'gr-trellis/lib')
-rw-r--r--gr-trellis/lib/CMakeLists.txt28
1 files changed, 23 insertions, 5 deletions
diff --git a/gr-trellis/lib/CMakeLists.txt b/gr-trellis/lib/CMakeLists.txt
index 2fe7d3218c..67a339d029 100644
--- a/gr-trellis/lib/CMakeLists.txt
+++ b/gr-trellis/lib/CMakeLists.txt
@@ -68,7 +68,7 @@ macro(expand_cc root)
list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
endforeach(sig)
-
+
#create a command to generate the source files
add_custom_command(
OUTPUT ${expanded_files_cc}
@@ -86,15 +86,15 @@ macro(expand_cc root)
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.h.t ${ARGN}
)
-
+
#make source files depends on headers to force generation
set_source_files_properties(${expanded_files_cc}
PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
)
-
+
#install rules for the generated cc files
- list(APPEND generated_sources ${expanded_files_cc})
- list(APPEND generated_headers ${expanded_files_h})
+ list(APPEND generated_sources ${expanded_files_cc})
+ list(APPEND generated_headers ${expanded_files_h})
endmacro(expand_cc)
########################################################################
@@ -154,3 +154,21 @@ GR_LIBRARY_FOO(gnuradio-trellis RUNTIME_COMPONENT "trellis_runtime" DEVEL_COMPON
add_dependencies(gnuradio-trellis
trellis_generated_includes trellis_generated_swigs
gnuradio-runtime gnuradio-digital)
+
+if(ENABLE_STATIC_LIBS)
+ add_library(gnuradio-trellis_static STATIC ${trellis_sources})
+
+ add_dependencies(gnuradio-trellis_static
+ trellis_generated_includes trellis_generated_swigs
+ gnuradio-runtime_static gnuradio-digital_static
+ )
+
+ if(NOT WIN32)
+ set_target_properties(gnuradio-trellis_static
+ PROPERTIES OUTPUT_NAME gnuradio-trellis)
+ endif(NOT WIN32)
+
+ install(TARGETS gnuradio-trellis_static
+ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "trellis_devel" # .lib file
+ )
+endif(ENABLE_STATIC_LIBS)