find_package(KDE4 REQUIRED) adds C++ flags such as -fvisibility=hidden which leads to many undefined reference errors. There is no option to turn the flags off. Please add at least an option to turn them off.
Is this affecting some existing software or is it for something you're working on? AFAIK the situation is better for KF5 and extra-cmake-modules, and build system changes to kdelibs4 would require a good reason.
It is affecting my own software but adding an option which is by default the standard behaviour wouldn't break anything. I am wondering why this behaviour has been implemented in the first place.
When using a release configuration it actually compiles with "-fno-exceptions" enabled which makes the software unusable with most external C++ libraries. Is there at least any tutorial/documentation which covers this rather important behaviour of the CMake modules?!
(In reply to Barade from comment #3) > When using a release configuration it actually compiles with > "-fno-exceptions" enabled which makes the software unusable with most > external C++ libraries. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") > Is there at least any tutorial/documentation which covers this rather > important behaviour of the CMake modules?! Most of the variables you are interested in are in FindKDE4Internal.cmake. There should be some documentation in techbase.kde.org and in http://api.kde.org/cmake/modules.html#modules.module.FindKDE4Internal, but apparently these days some links are down and most people are focused on KF5. If you have additional questions like this one you can use the kde-buildsystem mailing list for help.
Thanks for the explanation! Maybe you could add this documentation to "cmake --help-module FindKDE4". When I use "cmake --help-module FindQt4" all necessary stuff is listed so every new user finds immediately what he's searching for. Besides https://techbase.kde.org/Development/Tutorials#Basics_of_KDE_4_Programming could cover an article like "CMake" which explains the usage of CMake in KDE 4 and such topics as compile flags etc. At least I found there "https://techbase.kde.org/Development/Tutorials/Creating_Libraries". The main problem was that it took quite some time to figure out what was going on. I think macros like KDE_EXPORT are rather unnecessary. Hopefully, they will be removed in KDE 5. The whole concept of modyfing compile flags leads to much confusion and errors.
(In reply to Barade from comment #5) > Maybe you could add this documentation to "cmake --help-module FindKDE4". > When I use "cmake --help-module FindQt4" all necessary stuff is listed so > every new user finds immediately what he's searching for. > Besides > https://techbase.kde.org/Development/Tutorials#Basics_of_KDE_4_Programming > could cover an article like "CMake" which explains the usage of CMake in KDE > 4 and such topics as compile flags etc. > At least I found there > "https://techbase.kde.org/Development/Tutorials/Creating_Libraries". I was able to find https://techbase.kde.org/Development/CMake and https://techbase.kde.org/Development/Tutorials/CMake there. They don't cover the symbol visibility part, though. The documentation is better for KF5 and extra-cmake-modules, though: http://api.kde.org/ecm/ As you're probably aware, KDE4 is mostly in maintenance mode these days, so I don't expect the documentation to improve considerably. > The main problem was that it took quite some time to figure out what was > going on. > I think macros like KDE_EXPORT are rather unnecessary. Hopefully, they will > be removed in KDE 5. The whole concept of modyfing compile flags leads to > much confusion and errors. I'm not sure if you're referring to passing -fvisibility=hidden in general or to setting it by default. In KF5/e-c-m, KDECompilerSettings.cmake still does this: # Default to hidden visibility for symbols set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) So you'll still have to properly export your symbols. Exporting everything by default in a shared library is not what most libraries (KDE and non-KDE ones) do.
Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone!
Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone!
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!