This fixes also similar error with msvc in case openssl development
header has been installed into the same location as KDEWin.
Details
cross compiled with mingw
Diff Detail
- Repository
- R239 KDELibs4Support
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
So the if() is needed, the AFTER isn't enough?
I wonder how AFTER works in combination with linking to targets that provide include dirs.
This looks all a bit hackish, but I don't have a better suggestion other than this possible simplification.
yes,
the AFTER isn't enough?
I tried that and it does not help - AFTER|BEFORE affects only the order of directories added with include_directories
I wonder how AFTER works in combination with linking to targets that provide include dirs.
It does not, see the explanations below
- includes added by target_include_directories
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/KF5KDELibs4Support_autogen/include
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/../../..
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kdecore
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kdeui
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kio
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kssl
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/kssl
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/kparts
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/src/solid
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0/build/src/..
-I/home/abuild/rpmbuild/BUILD/kdelibs4support-5.41.0
- 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
- includes added by target_link_libraries follows here in the order they are added to the target
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtWidgets
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtGui
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore
...
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtTest
- the following comes from the imported kdewin target
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include/mingw
-isystem /usr/i686-w64-mingw32/sys-root/mingw/include
To get the above mentioned list by yourself you can install osc (https://en.opensuse.org/openSUSE:OSC) on a linux machine and run
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
This looks all a bit hackish,
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 https://cgit.kde.org/kdewin.git/tree/cmake/modules/FindKDEWin.cmake#n76) but this was limited to module based find_package modules I guess.
but I don't have a better suggestion other than this possible simplification.
- 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 ?
- 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.
BTW: After relooking at the patch I saw that I added an obsolate AFTER - will update the patch