<table><tr><td style="">habacker added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9404" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D9404#181209" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D9404#181209</a>, <a href="https://phabricator.kde.org/p/dfaure/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;" rel="noreferrer">@dfaure</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>So the if() is needed,</p></div>
</blockquote>
<p>yes,</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>the AFTER isn't enough?</p></blockquote>
<p>I tried that and it does not help - AFTER|BEFORE affects only the order of directories added with include_directories</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I wonder how AFTER works in combination with linking to targets that provide include dirs.</p></blockquote>
<p>It does not, see the explanations below</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">includes added by target_include_directories</li>
</ol>
<p>-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/KF5KDELibs4Support_autogen/include<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/../../..<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kdecore<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kdeui<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kio<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kssl<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/kssl<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kparts<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/solid<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/..<br />
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0</p>
<ol class="remarkup-list" start="2">
<li class="remarkup-list-item">includes added by include_directories are added here (the following is from openssl) BEFORE|AFTER only affects the order here -isystem /usr/i686-w64-mingw32/sys-root/mingw/include</li>
</ol>
<ol class="remarkup-list" start="3">
<li class="remarkup-list-item">includes added by target_link_libraries follows here in the order they are added to the target</li>
</ol>
<p>-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5<br />
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtWidgets<br />
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtGui<br />
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore<br />
...<br />
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtTest</p>
<ol class="remarkup-list" start="4">
<li class="remarkup-list-item">the following comes from the imported kdewin target</li>
</ol>
<p>-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/mingw<br />
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include</p>
<p>To get the above mentioned list by yourself you can install osc (<a href="https://en.opensuse.org/openSUSE:OSC" class="remarkup-link" target="_blank" rel="noreferrer">https://en.opensuse.org/openSUSE:OSC</a>) on a linux machine and run</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">osc co home:rhabacker:branches:windows:mingw:win32:KF541/mingw32-kdelibs4support
cd home:rhabacker:branches:windows:mingw:win32:KF541/mingw32-kdelibs4support
osc build
osc chroot
cd /home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src
cat CMakeFiles/KF5KDELibs4Support.dir/includes_CXX.rsp | sed 's, ,\n,g' | less</pre></div>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>This looks all a bit hackish,</p></blockquote>
<p>Not been able to specify include directories in the order the user wants looks to be a cmake limitation and may be fixed there. In KDE4 time this has been solved by using CMAKE_REQUIRED_INCLUDES (see <a href="https://cgit.kde.org/kdewin.git/tree/cmake/modules/FindKDEWin.cmake#n76" class="remarkup-link" target="_blank" rel="noreferrer">https://cgit.kde.org/kdewin.git/tree/cmake/modules/FindKDEWin.cmake#n76</a>) but this was limited to module based find_package modules I guess.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>but I don't have a better suggestion other than this possible simplification.</p></blockquote>
<ol class="remarkup-list">
<li class="remarkup-list-item">Someone with win32 api knowledge can remove the kdewin dependencies from kdelibs4support, which required to port kill() and probably other functions to native win32 api - wishlist topic ?</li>
<li class="remarkup-list-item">making openssl a config based find_package would solve this specific issue too, but only hides the real cause - the cmake limitation in this area.</li>
</ol>
<p>BTW: After relooking at the patch I saw that I added an obsolate AFTER - will update the patch</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R239 KDELibs4Support</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9404" rel="noreferrer">https://phabricator.kde.org/D9404</a></div></div><br /><div><strong>To: </strong>habacker, dfaure, ltoscano, bcooksley<br /><strong>Cc: </strong>Frameworks<br /></div>