On Monday 31 August 2015 14:41:00 Friedrich W. H. Kossebau wrote: > > The only place lxr.kde.org pointed out to use the *TEST_EXPORT approach was > grantlee, which simply creates a separate file with the define that then is > appended to the file generated with generate_export_header: > http://lxr.kde.org/source/grantlee/templates/lib/CMakeLists.txt
Konqueror has a simpler approach, a file that includes the generated file and adds the tests_export macro on top. #include "konquerorprivate_export.h" /* Classes from the Konqueror application, which are exported only for unit tests */ #ifdef COMPILING_TESTS # ifndef KONQ_TESTS_EXPORT # define KONQ_TESTS_EXPORT KONQUERORPRIVATE_EXPORT # endif #else /* not compiling tests */ # define KONQ_TESTS_EXPORT #endif See kde/applications/kde-baseapps/konqueror/src/konqprivate_export.h branch frameworks. -- David Faure, fa...@kde.org, http://www.davidfaure.fr Working on KDE Frameworks 5