From df81fa11fc8972a5775a57ccde1e0ef8d7fbfe64 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Sun, 24 Apr 2016 23:39:25 +0800 Subject: CMakeLists: Use imported version of Threads::Threads This requires bumping up to a minimum of CMake 3.1. The benefit of using the imported target is that you can switch to the -pthread compiler flag on request, which may be necessary for some systems if available. --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ddde19760..019321ad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -# CMake 2.8.11 required for Qt5 settings to be applied automatically on -# dependent libraries. -cmake_minimum_required(VERSION 2.8.11) +# CMake 3.1 required for Qt5 settings to be applied automatically on +# dependent libraries and IMPORTED targets. +cmake_minimum_required(VERSION 3.1) function(download_bundled_external remote_path lib_name prefix_var) set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") @@ -135,6 +135,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) +# Prefer the -pthread flag on Linux. +set (THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) if (ENABLE_SDL2) -- cgit v1.2.3