<div dir="auto">Thanks for your comment, I seem to have misunderstood the usage of BUILD_SHARED_LIBS. I will remove the hack to serve either a static or shared libprimesieve from my cmake config file.<div dir="auto"><br></div><div dir="auto">Kim</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Feb 14, 2018 11:42 PM, "Hendrik Sattler" <<a href="mailto:post@hendrik-sattler.de" target="_blank">post@hendrik-sattler.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Am 14. Februar 2018 21:47:24 MEZ schrieb Kim Walisch <<a href="mailto:kim.walisch@gmail.com">kim.walisch@gmail.com</a>>:<br>
>Thanks, I got it working!<br>
><br>
>Unfortunately I could not make the generator expression work inside<br>
><a href="http://PrimesieveConfig.cmake.in" rel="noreferrer" target="_blank">PrimesieveConfig.cmake.in</a>, here is the error message:<br>
><br>
>CMake Error:<br>
> Error evaluating generator expression:<br>
> $<BUILD_SHARED_LIBS:<wbr>libprimesieve><br>
> Expression did not evaluate to a known generator expression<br>
><br>
>Note that in my main CMakeLists.txt the generator expression worked<br>
>fine. But I figured out I don't actually need the generator expression,<br>
>the following code inside my <a href="http://PrimesieveConfig.cmake.in" rel="noreferrer" target="_blank">PrimesieveConfig.cmake.in</a> does the trick:<br>
><br>
>if(BUILD_SHARED_LIBS)<br>
<br>
This is IMHO using the wrong variable! This variable tells that I want to build MY libs as static, not that I want to link 3rdParty libs statically!<br>
At least this is surprising behavior.<br>
<br>
OTOH and luckily, there are still the real targets to choose from.<br>
<br>
>This trick is also used by the c-ares library:<br>
<br>
Others also doing this wrong does not make it any better.<br>
<br>
HS<br>
<br>
--<br>
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
</blockquote></div></div>