Bug 382175

Summary: Some ThreadWeaver examples cannot be compiled standalone
Product: [Frameworks and Libraries] frameworks-threadweaver Reporter: athairus
Component: generalAssignee: Mirko Boehm <mirko>
Status: RESOLVED WORKSFORME    
Severity: normal CC: athairus, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.36.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description athairus 2017-07-09 21:24:59 UTC
I encountered issues trying to follow chapter 2 of the "KDE Frameworks Cookbook". I wanted to follow along with the chapter, placing the code snippets into a project as they appeared in the book and seeing if it ran. However, that didn't work. I next tried cloning ThreadWeaver's source. There are issues preventing the examples from being configured individually with each example's CMakeLists.txt file (as opposed to configuring the examples as part of configuring ThreadWeaver using its root CMakeLists.txt file):

1. HelloWorld: The call to project()[1] is after the call to find_package()[2]. This causes CMake 3.8.2 to break in odd ways. It's strongly recommended to put the call to project() *before* any other calls since project() apparently sets some important variables.

[1] https://github.com/KDE/threadweaver/blob/v5.36.0/examples/HelloWorld/CMakeLists.txt#L18
[2] https://github.com/KDE/threadweaver/blob/v5.36.0/examples/HelloWorld/CMakeLists.txt#L6

2. HelloInternet: 
- Missing cmake_minimum_required()
- Missing fix found in f75f0ca (already applied to HelloWorld)
    - kde_enable_exceptions() and set(CMAKE_INCLUDE_CURRENT_DIR ON) need to go into an else() block (it's defined in a CMakeLists.txt outside this folder)
- Missing find_package() for Qt
- Won't compile despite these fixes:
    R:\include\KF5\ThreadWeaver\threadweaver/exception.h(34): fatal error C1083: Cannot open include file: 'threadweaver_export.h': No such file or directory

Found in 5.36.0 and master (aec8f5e as of writing) and most likely since the examples were added to the repo. The other two examples (HelloWorldRaw, ThumbNailer) also have most of the issues HelloInternet does. 

I'd like to see these fixed as that would make them good *standalone* examples as opposed to something more like unit tests that aren't being run.
Comment 1 Justin Zobel 2022-11-06 09:25:15 UTC
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!
Comment 2 Bug Janitor Service 2022-11-21 05:14:23 UTC
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!
Comment 3 Bug Janitor Service 2022-12-06 05:21:07 UTC
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!