nevermind I've figured out a generic way to do what I need, build once and link in multiple locations. <div><br></div><div><div>MACRO ( SRC_TARGET_REF _TARGET _REFS_EXPR _SRCREFS )</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span># 1st obtain the srcs</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>get_target_property ( _LSRCS ${_TARGET} SOURCES )</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#loop through srouces and check matches</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>foreach ( _TARGET_SRC_FILE ${_LSRCS} )</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#for each src file check all refs.</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>foreach ( _REF ${_REFS_EXPR} )</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span># if matches </div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>if(${_TARGET_SRC_FILE} MATCHES ${_REF})</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if(${_SRCREFS})</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>set (${_SRCREFS} "${${_SRCREFS}};${_TARGET_SRC_FILE}")</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>else(${_SRCREFS})</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>set (${_SRCREFS} ${_TARGET_SRC_FILE})</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>endif(${_SRCREFS})</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>endif()</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>endforeach( _REF )</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>endforeach( _TARGET_SRC_FILE )</div>
<div><br></div><div>ENDMACRO ( SRC_TARGET_REF )</div></div><div><br></div><div>############################################</div><div>## begin excerpt </div><div><br></div><div>src_target_ref( small_lib "^.*$" SMALL_LIB_REFS)</div>
<div>add_library( big_mundge_redistro_lib STATIC blah_blah.cpp;${SMALL_LIB_REFS} )</div><div>add_dependencies (big_mundge_redistro_lib small_lib) </div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br><div class="gmail_quote">On Thu, Sep 9, 2010 at 11:19 AM, Tim St. Clair <span dir="ltr"><<a href="mailto:timothysc@gmail.com">timothysc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">