mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

PThreads4W is mistyped in CMakeLists.txt

Open MarieKalouguine opened this issue 7 months ago • 2 comments

Mosquitto version with the issue: 2.0.21

The line find_package(Pthreads4W REQUIRED) contains a lower-case "t" in the package name, but it should be an upper-case "T". When installing the dependencies with vcpkg and attempting a windows compilation, CMake throws a warning. Replacing this line by find_package(PThreads4W REQUIRED) has fixed it for me.

MarieKalouguine avatar Jun 04 '25 10:06 MarieKalouguine

@MarieKalouguine can you share the logs of the CMake throwing a warning?

atifali avatar Jun 08 '25 21:06 atifali

Hi @atifali , yes of course, here is the warning that CMake throws at the end of the configuration step:

Completed submission of libuv:[email protected] to 1 binary cache(s) in 443 ms
Waiting for 1 remaining binary cache submissions...
Completed submission of libwebsockets:[email protected] to 1 binary cache(s) in 552 ms (1/1)
All requested installations completed successfully in: 9.1 min
-- Running vcpkg install - done
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
CMake Warning (dev) at C:/Program Files/CMake_4.0.2/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:430 (message):
  The package name passed to find_package_handle_standard_args() (PThreads4W)
  does not match the name of the calling package (Pthreads4W).  This can lead
  to problems in calling code that expects find_package() result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/vcpkg_installed/x86-windows/share/PThreads4W/Pthreads4WConfig.cmake:74 (find_package_handle_standard_args)
  C:/Users/myUser/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (_find_package)
  CMakeLists.txt:75 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- PThreads4W_DLL_DIR: Z:/src/mosquitto_eclipse/build/vcpkg_installed/x86-windows/include/../bin
-- PThreads4W_DEBUG_DLL_DIR: Z:/src/mosquitto_eclipse/build/vcpkg_installed/x86-windows/include/../debug/bin
-- WITH_DLT = OFF
-- TRUE
CMake Warning at man/CMakeLists.txt:44 (message):
  xsltproc not found: manpages cannot be built


-- Configuring done (558.8s)
-- Generating done (0.6s)

-- Build files have been written to: Z:/src/mosquitto_eclipse/build

I am compiling on Windows 10 with Visual Studio 2022, CMake 4.0.2, and for the dependencies I used the latest version of vcpkg (cloned locally).

MarieKalouguine avatar Jun 10 '25 15:06 MarieKalouguine

Thank you, that's now fixed

ralight avatar Aug 09 '25 21:08 ralight