From 74814cc68f86d748037046d60d0bdaf467d78d37 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 24 Feb 2022 19:01:08 +0000 Subject: [PATCH] Simplify cmake threads detection on Windows Requires cmake 3.1. --- CMakeLists.txt | 17 ++++------------- ChangeLog.txt | 4 ++++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9c94fec..bd5bad3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # To configure the build options either use the CMake gui, or run the command # line utility including the "-i" option. -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.1) cmake_policy(SET CMP0042 NEW) project(mosquitto) @@ -67,18 +67,9 @@ option(WITH_THREADING "Include client library threading support?" ON) if (WITH_THREADING) add_definitions("-DWITH_THREADING") if (WIN32) - if (CMAKE_VERSION VERSION_LESS "3.1") - if (CMAKE_CL_64) - set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib) - else (CMAKE_CL_64) - set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib) - endif (CMAKE_CL_64) - set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include) - else() - find_package(Threads REQUIRED) - set (PTHREAD_LIBRARIES Threads::Threads) - set (PTHREAD_INCLUDE_DIR "") - endif() + find_package(Threads REQUIRED) + set (PTHREAD_LIBRARIES Threads::Threads) + set (PTHREAD_INCLUDE_DIR "") elseif (ANDROID) set (PTHREAD_LIBRARIES "") set (PTHREAD_INCLUDE_DIR "") diff --git a/ChangeLog.txt b/ChangeLog.txt index e1149940..9bccedc7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -6,6 +6,10 @@ Broker: MOSQ_EVT_MESSAGE. - Fix bridge `restart_timeout` not being honoured. +Client library: +- Fix threads library detection on Windows under cmake. Bumps the minimum + cmake version to 3.1, which is still ancient. + 2.0.14 - 2021-11-17 ===================