<div dir="ltr"><div dir="ltr"> <div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_4493929061396688074WordSection1"><p class="MsoNormal">So in CMake parlance, what type is the last argument to target_compile_definitions?  Is it a list, string or something else?</p></div></div></blockquote><div><br></div><div>It's a series of VISIBILITY_SPECIFIER DEF1 DEF2 ... DEFN, so the visibility specifier followed by a list of definitions, optionally followed by another visibility specifier and list of definitions, etc.</div><div><br></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">add_library(Foo OBJECT Foo.cxx)<br></span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">target_compile_definitions(Foo</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">  PUBLIC</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">    COMMON_DEF_1 COMMON_DEF_2</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">  PRIVATE</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">    FOO_SPECIFIC_DEF=42</span></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">)</span></div><div><br></div><div>will translate to something like:</div><div><br></div><div style="margin-left:40px"><span style="font-family:monospace,monospace">c++ -DCOMMON_DEF_1 -DCOMMON_DEF_2 -DFOO_SPECIFIC_DEF=4 -o Foo.cxx.o -c Foo.cxx</span><br></div><div><br></div><div>- Chuck<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_4493929061396688074WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-color:rgb(181,196,223) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com" target="_blank">chuck.atkins@kitware.com</a>><br>
<b>Date: </b>Thursday, October 11, 2018 at 2:55 PM<br>
<b>To: </b>Rob Boehne <<a href="mailto:robb@datalogics.com" target="_blank">robb@datalogics.com</a>><br>
<b>Cc: </b>CMake Mail List <<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>><br>
<b>Subject: </b>Re: [CMake] Building arguments to target_comple_definitions()<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">So, are you suggesting that I make a “dummy” target and fill it with the common options in compile_definitions() and include_directories() (et. al.)<u></u><u></u></p>
<p class="MsoNormal">Then make my OBJECT libraries (and the shared library) depend on the “dummy” target?
<u></u><u></u></p>
</div>
</div>
</blockquote>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">If that’s not the suggestion, I’m afraid I don’t see how I can use this to set the common flags<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">That's certainly one way you can solve the problem, i.e. making an interface library with the common defs, and a good idea at that, but that's not what I was referring to.  I was simply tying to explain that the error your getting trying
 to pass arguments to target_compile_options is because you're missing the visibility argument.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">- Chuck<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote></div></div></div>