<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le lun. 20 août 2018 à 19:05, Damir Porobic <<a href="mailto:damir_porobic@live.com">damir_porobic@live.com</a>> a écrit :<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 dir="ltr">
<div id="gmail-m_-1091032348120381152divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">Hi Eric,</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">yes, this is the project. I have pushed my current state to this branch
<a href="https://github.com/DamirPorobic/kImageAnnotator/tree/sharedLibTestBranch" class="gmail-m_-1091032348120381152OWAAutoLink" id="gmail-m_-1091032348120381152LPlnk669383" target="_blank">
https://github.com/DamirPorobic/kImageAnnotator/tree/sharedLibTestBranch</a><br>
</p>
<br>
<p style="margin-top:0px;margin-bottom:0px">I've tried also without the generate_export_headers (cleaned everything up before trying out) but I get the same result.
<br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace;font-size:16px;background-color:rgb(255,255,255);float:none;display:inline">KImageAnnotator::</span><span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace;font-size:16px;background-color:rgb(255,255,255);float:none;display:inline">KImageAnnotator(QPixmap
 const&)<span style="font-family:Calibri,Helvetica,sans-serif">should be exposed by the handwritten file, that's true, I think I got something mixed up there and I don't actually need the
<span>generate_export_headers</span>, but as said, even without the line, it's not working.
<br></span></span></p></div></div></blockquote><div><br></div><div>I'm quite lost with the file layout.</div><div><br></div><div>in example/main.cpp you do:</div><div>#include <kImageAnnotator/KImageAnnotator.h></div><div>so I guess you expect that </div><div>target_link_libraries(kImageAnnotator-example PRIVATE kImageAnnotator::kImageAnnotator)<br></div><div><br></div><div>will bring you the include path to "kImageAnnotator/KImageAnnotator.h" along with the [imported] target</div><div><br></div><div>in your main tree (not in example) there is a trick because you did:</div><div><br></div><div>add_library(kImageAnnotator::kImageAnnotator ALIAS kImageAnnotator)<br></div><div><br></div><div>and then in the test directory you do:</div><div><br></div><div>target_link_libraries(${UnitTestName} Qt5::Test kimageannotator_LIB)<br></div><div><br></div><div>with </div><div><br></div><div>add_library(kimageannotator_LIB STATIC ${kimageannotator_SRCS})<br></div><div><br></div><div>so AFAIU you compile your kImageAnnotator library twice. Once for building the target you expect to use in example/ subdir</div><div>and another time as a STATIC lib for the unit test. So the unit test is not linking to the same object lib at all ??</div><div><br></div><div>I am not used to KDE development but all this seems very fuzzy to me.</div><div><br></div><div>May be you could get more precise help from people who know better about KDE dev and the specific CMake machinery that comes along </div><div>like ECM (<a href="https://github.com/KDE/extra-cmake-modules">https://github.com/KDE/extra-cmake-modules</a>) you seems to be using.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>