Bad PThreads4W CMake Config
Building on Windows fails unless I make edits to the PThreads4W cmake config.
System:
- Windows 11 x64 22635
- CMake 3.24.2 w/ MS Visual Studio 2022 toolchain
Reproduce:
vcpkg install
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH="../vcpkg_installed"
Which fails with message:
CMake Error at CMakeLists.txt:139 (find_package):
By not providing "Findpthreads_windows.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"pthreads_windows", but CMake did not find one.
Could not find a package configuration file provided by "pthreads_windows"
with any of the following names:
pthreads_windowsConfig.cmake
pthreads_windows-config.cmake
The pthreads_windows cmake config in vcpkg_installed/x64-windows/share/pthreads_windows
doesn't have either of those names, and renaming the config results in more errors. Instead, I changed CMakeLists:139:
- find_package(pthreads_windows REQUIRED)
+ find_package(PThreads4W REQUIRED)
and in vcpkg_installed/x64-windows/share/PThreads4W/PThreads4WConfig.cmake
replaced all ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
to ${PACKAGE_PREFIX_DIR}
(the paths weren't being found).
Then everything builds nicely. Not sure if this is a bug, or if it's just me.