<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<div>
<p style="margin-top:0;margin-bottom:0">Any idea how I could fix the last issue in my shared library?
<br>
</p>
<p style="margin-top:0;margin-bottom:0">Cmake seems to expect a file with version in its name (<span style="font-family:Consolas,Courier,monospace">/usr/local/lib64/libkImageAnnotator.so.0.0.1</span>) but my cmake for the shared library only creates a file
without version in it's name (<span style="font-family:Consolas,Courier,monospace">/usr/local/lib64/libkImageAnnotator.so</span>)</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Manually creating a link seems to fix the issue, but I guess there is a way to let cmake generate it.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
Any idea?</div>
<p></p>
<br>
<div style="color: rgb(49, 54, 59);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Damir Porobic <damir_porobic@live.com><br>
<b>Sent:</b> Sunday, August 26, 2018 13:50<br>
<b>To:</b> Sebastián Mancilla<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] Problem with creating shared library</font>
<div> </div>
</div>
<meta content="text/html; charset=iso-8859-1">
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0"></p>
<div>
<p style="margin-top:0; margin-bottom:0">Ok, I've found the issue for the latest problem but I'm not sure how to fix it in the CMake file. The make was using an old version of
<span style="font-family:Consolas,Courier,monospace">/usr/local/lib64/libkImageAnnotator.so.0.0.1</span> so I removed everything with kImageAnnotato in its name from this directory and run again the s<span style="font-family:Consolas,Courier,monospace">udo
make install</span> which gave me this output <br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<div><span style="font-family:Consolas,Courier,monospace">-- Install configuration: "Debug"</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/lib64/cmake/kImageAnnotator/kImageAnnotator-config.cmake</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/lib64/cmake/kImageAnnotator/kImageAnnotator-config-version.cmake</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/lib64/cmake/kImageAnnotator/kImageAnnotator-targets.cmake</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/lib64/cmake/kImageAnnotator/kImageAnnotator-targets-debug.cmake</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Installing: /usr/local/lib64/libkImageAnnotator.so</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Set runtime path of "/usr/local/lib64/libkImageAnnotator.so" to "/usr/local/lib64"</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/include/kImageAnnotator</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/include/kImageAnnotator/KImageAnnotator.h</span><br>
<span style="font-family:Consolas,Courier,monospace">-- Up-to-date: /usr/local/include/kImageAnnotator/KImageAnnotatorExport.h</span></div>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">So only <span style="font-family:Consolas,Courier,monospace">
libkImageAnnotator.so</span> is created and installed, but not the one with the version at the end which cmake seems to expect: in my test project</p>
<div><span style="font-family:Consolas,Courier,monospace">CMake Error at /usr/local/share/kImageAnnotatorConfig/cmake/kImageAnnotatorConfig.cmake:79 (message):</span><br>
<span style="font-family:Consolas,Courier,monospace"> The imported target "kImageAnnotator" references the file</span><br>
<br>
<span style="font-family:Consolas,Courier,monospace"> "/usr/local/lib64/libkImageAnnotator.so.0.0.1"</span><br>
<br>
<span style="font-family:Consolas,Courier,monospace"> but this file does not exist.</span></div>
<div><br>
</div>
<div>When I manually create a link to the installed file:<br>
</div>
<p style="margin-top:0; margin-bottom:0"><span></span></p>
<div><span style="font-family:Consolas,Courier,monospace">$ sudo ln -s /usr/local/lib64/libkImageAnnotator.so /usr/local/lib64/libkImageAnnotator.so.0.0.1</span><br>
<br>
</div>
Everything finally works, but I need to fix this final issue with the missing link. This was working earlier I think.</div>
<br>
<p></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Damir Porobic <damir_porobic@live.com><br>
<b>Sent:</b> Friday, August 24, 2018 9:37:30 PM<br>
<b>To:</b> Sebastián Mancilla<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] Problem with creating shared library</font>
<div> </div>
</div>
<meta content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">I've fixed both issues, the second by implementing
<span>the pimpl idiom but still I can't used the library in the other project, again I get the error with
<span>undefined reference to </span>the constructor (and a method that I've added):<br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span></span></p>
<div><span style="font-family:Consolas,Courier,monospace">[ 75%] Linking CXX executable testApp</span><br>
<span style="font-family:Consolas,Courier,monospace">CMakeFiles/testApp.dir/main.cpp.o: In function `main':</span><br>
<span style="font-family:Consolas,Courier,monospace">/home/dporobic/projects/testApp/main.cpp:9: undefined reference to `KImageAnnotator::KImageAnnotator(QPixmap const&)'</span><br>
<span style="font-family:Consolas,Courier,monospace">/home/dporobic/projects/testApp/main.cpp:11: undefined reference to `KImageAnnotator::testMethod()'</span><br>
<span style="font-family:Consolas,Courier,monospace">collect2: error: ld returned 1 exit status</span></div>
<div><br>
</div>
<div>But the constructor and the method don't seem to be private anymore:</div>
<div><br>
</div>
<div>
<div><span style="font-family:Consolas,Courier,monospace">dporobic@linux ~/projects/kImageAnnotator/build (sharedLibTestBranch)</span><br>
<span style="font-family:Consolas,Courier,monospace">$ nm -g lib/libkImageAnnotator.so | c++filt | grep "::testMethod\|::KImage"</span><br>
<span style="font-family:Consolas,Courier,monospace">0000000000014f08 T KImageAnnotator::testMethod()</span><br>
<span style="font-family:Consolas,Courier,monospace">0000000000014b18 T KImageAnnotator::KImageAnnotator(QPixmap const&)</span><br>
<span style="font-family:Consolas,Courier,monospace">0000000000014b18 T KImageAnnotator::KImageAnnotator(QPixmap const&)</span></div>
</div>
<div><br>
</div>
<div>Also, after the constructor call and before the call to the test method in my test project, there is a call to an inherited method (<span style="font-family:Consolas,Courier,monospace">s</span><span style="font-family:Consolas,Courier,monospace">how()</span>)
from QWidget and the linker is not complaining about this one:</div>
<div><br>
</div>
<div>
<div><span style="font-family:Consolas,Courier,monospace">auto kImageAnnotator = new KImageAnnotator(pixmap);</span><br>
<span style="font-family:Consolas,Courier,monospace">kImageAnnotator->show();</span><br>
<span style="font-family:Consolas,Courier,monospace">kImageAnnotator->testMethod();</span></div>
</div>
<div><br>
</div>
<p></p>
<div style="color:rgb(49,54,59)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Sebastián Mancilla <smancill@jlab.org><br>
<b>Sent:</b> Thursday, August 23, 2018 22:13<br>
<b>To:</b> Damir Porobic<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] Problem with creating shared library</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">I forgot to update the include path in the patch I sent you.
<div><br>
</div>
<div>It should be like this (note that it contains just "include", not "include/kImageAnnotator"):<br>
</div>
<div><br>
</div>
<div>
<div>target_include_directories(kImageAnnotator</div>
<div> PUBLIC</div>
<div> $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include></div>
<div> $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include></div>
<div> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}></div>
<div> )</div>
</div>
<div><br>
</div>
<div>And kImageAnnotator.h should change the export include to:</div>
<div><br>
</div>
<div>
<div>#include "kImageAnnotatorExport.h"</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>You still have a bigger problem, though. kImageAnnotator.h is including private headers</div>
<div><br>
</div>
<div>
<div>#include "../../src/gui/VisibilitySwitcher.h"</div>
<div>#include "../../src/annotations/core/AnnotationArea.h"</div>
<div>#include "../../src/backend/Config.h"</div>
<div>#include "../../src/widgets/ToolPicker.h"</div>
<div>#include "../../src/widgets/ColorPicker.h"</div>
<div>#include "../../src/widgets/SizePicker.h"</div>
<div>#include "../../src/widgets/FillPicker.h"</div>
</div>
<div><br>
</div>
<div>If those are required by your clients, then they should be in the "include/kImageAnnotator" directory and installed along with "kImageAnnotator.h".</div>
<div>Otherwise, consider using the pimpl idiom and remove the includes from the public header.</div>
<div><br>
</div>
</div>
<br>
<div class="x_x_x_gmail_quote">
<div dir="ltr">El mié., 22 de ago. de 2018 a la(s) 17:08, Damir Porobic (<a href="mailto:damir_porobic@live.com" id="LPlnk910269" class="x_x_OWAAutoLink" previewremoved="true">damir_porobic@live.com</a>) escribió:<br>
</div>
<blockquote class="x_x_x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_x_x_m_-8484292771848977463divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Thanks you <span>Sebastián</span> for finding the issue and fixing the CMake, probably would have never found out that it was set to private.
<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">The kImageAnnotator-example is working now as expected. Do I need something else, except installing the lib, in order to use it in different projects? I've created a second project which is identical to the
<span>kImageAnnotator-example</span> but I get following when I try to build it:</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div><span style="font-family:Consolas,Courier,monospace">[ 50%] Building CXX object CMakeFiles/testApp.dir/main.cpp.o</span><br>
<span style="font-family:Consolas,Courier,monospace">In file included from /home/dporobic/projects/testApp/main.cpp:2:0:</span><br>
<span style="font-family:Consolas,Courier,monospace">/usr/local/include/kImageAnnotator/KImageAnnotator.h:31:35: fatal error: KImageAnnotatorExport.h: No such file or directory</span><br>
<span style="font-family:Consolas,Courier,monospace"> #include <KImageAnnotatorExport.h></span></div>
<div><span style="font-family:Consolas,Courier,monospace"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"></font>
<div> ^<br>
compilation terminated.<br>
<br>
</div>
</span></div>
<p></p>
<p style="margin-top:0; margin-bottom:0">The includes look like this:</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div><span style="font-family:Consolas,Courier,monospace">#include <QApplication></span><br>
<span style="font-family:Consolas,Courier,monospace">#include <kImageAnnotator/KImageAnnotator.h></span></div>
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">And the CMake looks like this:</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div><span style="font-family:Consolas,Courier,monospace">find_package(kImageAnnotator REQUIRED)</span><br>
<br>
<span style="font-family:Consolas,Courier,monospace">add_executable(testApp main.cpp)</span><br>
<span style="font-family:Consolas,Courier,monospace">target_link_libraries(testApp kImageAnnotator)</span></div>
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Am I missing something again?<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<br>
<div style="color:rgb(49,54,59)">
<hr style="display:inline-block; width:98%">
<div id="x_x_x_m_-8484292771848977463divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Sebastián Mancilla <<a href="mailto:smancill@jlab.org" target="_blank" id="LPlnk833674" class="x_x_OWAAutoLink" previewremoved="true">smancill@jlab.org</a>><br>
<b>Sent:</b> Wednesday, August 22, 2018 00:51<br>
<b>To:</b> Eric Noulard<br>
<b>Cc:</b> Damir Porobic; <a href="mailto:cmake@cmake.org" target="_blank" id="LPlnk835190" class="x_x_OWAAutoLink" previewremoved="true">
cmake@cmake.org</a><br>
<b>Subject:</b> Re: [CMake] Problem with creating shared library</font>
<div> </div>
</div>
<div>
<div dir="ltr">I fixed your problem. Get the attached patch and apply it with "git apply <patch_file>".
<div><br>
</div>
<div>The kImageAnnotator constructor was private to the library (I just learned that Qt does that when creating shared libraries), and that's why you get the undefined reference error. You could have checked it with:</div>
<div><br>
</div>
<div>nm lib/libkImageAnnotator.so | c++filt | grep ::KImage</div>
<div>00000000000141f6 t KImageAnnotator::KImageAnnotator(QPixmap const&)</div>
<div>00000000000141f6 t KImageAnnotator::KImageAnnotator(QPixmap const&)</div>
<div><br>
</div>
<div>The "t" shows it is private.</div>
<div><br>
</div>
<div>You have to set the proper export macros to make it visible:</div>
<div><br>
</div>
<div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.qt.io_How-5Fto-5Fcreate-5Fa-5Flibrary-5Fwith-5FQt-5Fand-5Fuse-5Fit-5Fin-5Fan-5Fapplication&d=DwMFAw&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=y6-B01YTd3TICi74QxO0LfDQVtz1m7fckmS3ItKkAmE&s=WmSjv8Q5QDreoWKNX4mS9hZm6lMR1pfhmDpjVug9nKU&e=" id="LPlnk621965" class="x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" target="_blank" previewremoved="true">https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application</a><br>
</div>
<div><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__doc.qt.io_qt-2D5_sharedlibrary.html&d=DwMFAw&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=y6-B01YTd3TICi74QxO0LfDQVtz1m7fckmS3ItKkAmE&s=I_GD4gkI-8u5o_gjXOD-wZKguDdfF2Gu4YG3Swst3hY&e=" id="LPlnk203679" class="x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" target="_blank" previewremoved="true">http://doc.qt.io/qt-5/sharedlibra<br>
<div id="x_x_x_m_-8484292771848977463LPBorder_GT_15349676105240.2538911332902525" style="margin-bottom:20px; overflow:auto; width:100%; text-indent:0px">
<table id="x_x_x_m_-8484292771848977463LPContainer_15349676105220.1114939049832483" style="width:90%; background-color:rgb(255,255,255)" cellspacing="0">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td id="x_x_x_m_-8484292771848977463TextCell_15349676105220.977705330934571" colspan="2" style="vertical-align:top">
<div id="x_x_x_m_-8484292771848977463LPRemovePreviewContainer_15349676105220.2907840355011231">
</div>
<div id="x_x_x_m_-8484292771848977463LPTitle_15349676105220.08623757792943798" style="color:rgb(0,120,215); font-weight:400; font-size:21px; font-family:"wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height:21px">
<a id="LPlnk672819" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.qt.io_How-5Fto-5Fcreate-5Fa-5Flibrary-5Fwith-5FQt-5Fand-5Fuse-5Fit-5Fin-5Fan-5Fapplication&d=DwMFAw&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=y6-B01YTd3TICi74QxO0LfDQVtz1m7fckmS3ItKkAmE&s=WmSjv8Q5QDreoWKNX4mS9hZm6lMR1pfhmDpjVug9nKU&e=" target="_blank" class="x_x_OWAAutoLink" style="text-decoration:none" previewremoved="true">How
to create a library with Qt and use it in an application</a></div>
<div id="x_x_x_m_-8484292771848977463LPMetadata_15349676105230.5626165396632882" style="margin:10px 0px 16px; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:14px">
wiki.qt.io</div>
<div id="x_x_x_m_-8484292771848977463LPDescription_15349676105240.4457276471544921" style="display:block; color:rgb(102,102,102); font-weight:400; font-family:"wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size:14px; line-height:20px; max-height:100px; overflow:hidden">
This tutorial illustrates different approaches for using a custom library in your application on Windows. The first part explains how to create a shared library and how to link against it in your application. The second part is about creating and using a static
library. Creating a shared library ...</div>
</td>
</tr>
</tbody>
</table>
</div>
ry.html</a><br>
</div>
<div><br>
</div>
<div>The patch does that, and now the example links with the library just fine. The kImageAnnotatorExport.h header defines the macro, the compile definition is set for the shared library target in the CMakeLists.txt. I guess you'll have to do the same for
all classes used by the unit tests, no sure of the Qt development practices.</div>
<div><br>
</div>
<div>I also reworked your CMake files a bit. I am sending a single patch, though. Sorry.</div>
<div><br>
</div>
</div>
<br>
<div class="x_x_x_m_-8484292771848977463x_gmail_quote">
<div dir="ltr">El mar., 21 de ago. de 2018 a la(s) 14:29, Eric Noulard (<a href="mailto:eric.noulard@gmail.com" id="LPlnk494443" class="x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" target="_blank" previewremoved="true">eric.noulard@gmail.com</a>)
escribió:<br>
</div>
<blockquote class="x_x_x_m_-8484292771848977463x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr"><br>
<br>
<div class="x_x_x_m_-8484292771848977463x_gmail_quote">
<div dir="ltr">Le lun. 20 août 2018 à 19:05, Damir Porobic <<a href="mailto:damir_porobic@live.com" id="LPlnk126737" class="x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" target="_blank" previewremoved="true">damir_porobic@live.com</a>> a écrit :<br>
</div>
<blockquote class="x_x_x_m_-8484292771848977463x_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="x_x_x_m_-8484292771848977463x_m_2941313824199028209m_-7251925163260502270gmail-m_-1091032348120381152divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif">
<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://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_DamirPorobic_kImageAnnotator_tree_sharedLibTestBranch&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=r4LA5jjr_jrRNhddqyy5IsuqRRwHEPCwRMFbxoU1ChI&s=j_vYMAeNlkSJPzPWt5eGGRXiqm4RocWUGgyctA8SGE4&e=" class="x_x_x_m_-8484292771848977463x_m_2941313824199028209m_-7251925163260502270gmail-m_-1091032348120381152OWAAutoLink x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" id="LPlnk21457" target="_blank" previewremoved="true">
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://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_KDE_extra-2Dcmake-2Dmodules&d=DwMFaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=8hmSv9ww5s9qu3iT8h5WMi8-YcKXaJvelxT3fMih7S4&m=r4LA5jjr_jrRNhddqyy5IsuqRRwHEPCwRMFbxoU1ChI&s=LaNKLek4ewlsoy7ECnW4qRmkBAAVUeo6iTSFqsT9ACo&e=" id="LPlnk29389" class="x_x_x_m_-8484292771848977463OWAAutoLink x_x_OWAAutoLink" target="_blank" previewremoved="true">https://github.com/KDE/extra-cmake-modules</a>)
you seems to be using.</div>
</div>
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_x_x_m_-8484292771848977463x_m_2941313824199028209m_-7251925163260502270gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Eric<br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_x_x_m_-8484292771848977463x_m_2941313824199028209gmail_signature">
<div dir="ltr">
<div style="font-size:small; font-family:arial">Sebastian Mancilla Matta</div>
<div style="font-size:small; font-family:arial">CCTVal, UTFSM</div>
<div style="font-size:small; font-family:arial">Valparaíso, Chile</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_x_x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div style="font-size:small; font-family:arial">Sebastian Mancilla</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>