Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--cmake/FindPTHREAD.cmake38
-rw-r--r--remmina-plugins/CMakeLists.txt2
-rw-r--r--remmina-plugins/rdp/CMakeLists.txt4
-rw-r--r--remmina/CMakeLists.txt7
5 files changed, 12 insertions, 47 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4661256cf..0e8d26bf2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -191,7 +191,13 @@ add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
find_required_package(GTK)
-find_required_package(PTHREAD)
+
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package(Threads REQUIRED)
+if(NOT CMAKE_USE_PTHREADS_INIT)
+ message(FATAL_ERROR "pthreads thread library not found")
+endif()
+
find_suggested_package(GCRYPT)
find_suggested_package(AVAHI)
diff --git a/cmake/FindPTHREAD.cmake b/cmake/FindPTHREAD.cmake
deleted file mode 100644
index cd22882cb..000000000
--- a/cmake/FindPTHREAD.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-# Remmina - The GTK+ Remote Desktop Client
-#
-# Copyright (C) 2011 Marc-Andre Moreau
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-
-find_package(PkgConfig)
-pkg_check_modules(PC_PTHREAD pthread)
-set(PTHREAD_DEFINITIONS ${PC_PTHREAD_CFLAGS_OTHER})
-
-find_path(PTHREAD_INCLUDE_DIR NAMES pthread.h
- HINTS ${PC_PTHREAD_INCLUDEDIR} ${PC_PTHREAD_INCLUDE_DIRS})
-
-find_library(PTHREAD_LIBRARY NAMES pthread
- HINTS ${PC_PTHREAD_LIBDIR} ${PC_PTHREAD_LIBRARY_DIRS})
-
-include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(PTHREAD DEFAULT_MSG PTHREAD_LIBRARY PTHREAD_INCLUDE_DIR)
-
-set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
-set(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
-
-mark_as_advanced(PTHREAD_INCLUDE_DIR PTHREAD_LIBRARY)
-
diff --git a/remmina-plugins/CMakeLists.txt b/remmina-plugins/CMakeLists.txt
index c5913c74d..945755983 100644
--- a/remmina-plugins/CMakeLists.txt
+++ b/remmina-plugins/CMakeLists.txt
@@ -44,7 +44,7 @@ set(APPICON16_EMBLEMS_DIR "${REMMINA_DATADIR}/icons/hicolor/16x16/emblems")
set(APPICON22_EMBLEMS_DIR "${REMMINA_DATADIR}/icons/hicolor/22x22/emblems")
set(REMMINA_COMMON_INCLUDE_DIRS ${GTK_INCLUDE_DIRS})
-set(REMMINA_COMMON_LIBRARIES ${GTK_LIBRARIES} ${PTHREAD_LIBRARY})
+set(REMMINA_COMMON_LIBRARIES ${GTK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
find_suggested_package(LIBSSH)
if(LIBSSH_FOUND)
diff --git a/remmina-plugins/rdp/CMakeLists.txt b/remmina-plugins/rdp/CMakeLists.txt
index c8a188545..2a8a47a15 100644
--- a/remmina-plugins/rdp/CMakeLists.txt
+++ b/remmina-plugins/rdp/CMakeLists.txt
@@ -32,8 +32,8 @@
# files in the program, then also delete it here.
-set(CMAKE_THREAD_PREFER_PTHREAD)
-find_package(Threads)
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package(Threads REQUIRED)
find_package(X11)
set(REMMINA_PLUGIN_RDP_SRCS
diff --git a/remmina/CMakeLists.txt b/remmina/CMakeLists.txt
index 3b6ed757b..df6f580e7 100644
--- a/remmina/CMakeLists.txt
+++ b/remmina/CMakeLists.txt
@@ -123,6 +123,8 @@ find_package(X11)
include_directories(${X11_INCLUDE_DIR})
target_link_libraries(remmina ${X11_LIBRARIES})
+target_link_libraries(remmina ${CMAKE_THREAD_LIBS_INIT})
+
find_suggested_package(LIBSSH)
if(LIBSSH_FOUND)
add_definitions(-DHAVE_LIBSSH)
@@ -130,11 +132,6 @@ if(LIBSSH_FOUND)
target_link_libraries(remmina ${LIBSSH_LIBRARIES})
endif()
-if(PTHREAD_FOUND)
- include_directories(${PTHREAD_INCLUDE_DIRS})
- target_link_libraries(remmina ${PTHREAD_LIBRARIES})
-endif()
-
if(GCRYPT_FOUND)
include_directories(${GCRYPT_INCLUDE_DIRS})
target_link_libraries(remmina ${GCRYPT_LIBRARIES})