Skip to content

Conversation

@dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Aug 9, 2025

thread_safe_queue.h is in the same directory as thread_pool.h.

The original path prefix made #include "..." perform worse, because the first attempt (same dir) would always fail, and it requires user to have the parent dir of thread_pool in the header search path.

@DeveloperPaul123
Copy link
Owner

Just curious: How are you including thread-pool in your project?

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 11, 2025

Just curious: How are you including thread-pool in your project?

The original issue was reported for thread-pool installed in Visual Studio via vcpkg, using

#include <thread-pool-0.7.0/thread_pool/thread_pool.h>

I still think it shouldn't be used with this statement. But I noticed that a simple change could resolve that issue and improve regular use (installed CMake, sub-project, whatever).

@UMU618
Copy link

UMU618 commented Aug 13, 2025

Just curious: How are you including thread-pool in your project?

Better #include <thread_pool/thread_pool.h>, but vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

@UMU618
Copy link

UMU618 commented Aug 13, 2025

image

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 13, 2025

vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

The installation of the header is made by this pristine command;

thread-pool/CMakeLists.txt

Lines 130 to 135 in 03f4b67

install(FILES ${headers}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/thread_pool
)
install(FILES ${PROJECT_BINARY_DIR}/include/thread_pool/version.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/thread_pool
)

But this is not the topic of this PR.

@DeveloperPaul123
Copy link
Owner

Just curious: How are you including thread-pool in your project?

Better #include <thread_pool/thread_pool.h>, but vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

Yes my original idea was to allow for multiple versions to be installed side-by-side but I realize now that it's not idiomatic to do that 😅 Certainly something that can be fixed in the future.

@DeveloperPaul123
Copy link
Owner

Once I have time to pull this locally and test it should be good to merge

@DeveloperPaul123 DeveloperPaul123 merged commit a0aa5bc into DeveloperPaul123:main Aug 14, 2025
13 checks passed
@dg0yt dg0yt deleted the includes branch August 14, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants