Commit 04e3f5d6 authored by Marc-André Moreau's avatar Marc-André Moreau

cmake: add detection of pthreads, gcrypt

parent 69328d17
......@@ -15,7 +15,6 @@ Makefile.in
aclocal.m4
_configs.sed
config.h
config.h.in
config.log
config.status
config.guess
......
......@@ -28,6 +28,8 @@ include(CheckCCompilerFlag)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
include(FindOptionalPackage)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
......@@ -61,6 +63,16 @@ set(REMMINA_PLUGINDIR "${CMAKE_INSTALL_PREFIX}/share/remmina")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
find_suggested_package(PTHREAD)
if(PTHREAD_FOUND)
add_definitions(-DHAVE_PTHREAD)
endif()
find_suggested_package(GCRYPT)
if(GCRYPT_FOUND)
add_definitions(-DHAVE_GCRYPT)
endif()
add_subdirectory(remmina)
add_subdirectory(remmina-plugins)
#add_subdirectory(remmina-plugins-gnome)
......
# 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., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307, USA.
find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h)
find_library(GCRYPT_LIBRARY NAMES gcrypt)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR)
if(GCRYPT_FOUND)
set(GCRYPT_LIBRARIES ${GCRYPT_LIBRARY})
set(GCRYPT_INCLUDE_DIRS ${GCRYPT_INCLUDE_DIR})
endif()
mark_as_advanced(GCRYPT_INCLUDE_DIR GCRYPT_LIBRARY)
# - FindOptionalPackage
# Enable or disable optional packages. Also force optional packages.
#
# This module defines the following macros:
# find_required_package : find a required package, can not be disabled
# find_suggested_package : find a suggested package - required but can be disabled
# find_optional_package : find an optional package - required only if enabled
#
#=============================================================================
# Copyright 2011 Nils Andresen <nils@nils-andresen.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
macro(find_required_package _normal_package)
find_package(${_normal_package} REQUIRED)
endmacro(find_required_package)
macro(find_suggested_package _normal_package)
string(TOUPPER ${_normal_package} _upper_package)
option(WITH_${_upper_package} "Add dependency to ${_normal_package} - recommended" ON)
if(WITH_${_upper_package})
message(STATUS "Finding suggested package ${_normal_package}.")
message(STATUS " Disable this using \"-DWITH_${_upper_package}=OFF\".")
find_package(${_normal_package} REQUIRED)
endif(WITH_${_upper_package})
endmacro(find_suggested_package)
macro(find_optional_package _normal_package)
string(TOUPPER ${_normal_package} _upper_package)
option(WITH_${_upper_package} "Add dependency to ${_normal_package}" OFF)
if(WITH_${_upper_package})
find_package(${_normal_package} REQUIRED)
else(WITH_${_upper_package})
message(STATUS "Skipping optional package ${_normal_package}.")
message(STATUS " Enable this using \"-DWITH_${_upper_package}=ON\".")
endif(WITH_${_upper_package})
endmacro(find_optional_package)
# 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., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307, USA.
find_path(PTHREAD_INCLUDE_DIR NAMES pthread.h)
find_library(PTHREAD_LIBRARY NAMES pthread)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PTHREAD DEFAULT_MSG PTHREAD_LIBRARY PTHREAD_INCLUDE_DIR)
if(PTHREAD_FOUND)
set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
set(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR})
endif()
mark_as_advanced(PTHREAD_INCLUDE_DIR PTHREAD_LIBRARY)
#ifndef __CONFIG_H
#define __CONFIG_H
#cmakedefine HAVE_SYS_PARAM_H
#cmakedefine HAVE_SYS_SOCKET_H
#cmakedefine HAVE_ARPA_INET_H
#cmakedefine HAVE_NETINET_IN_H
#cmakedefine HAVE_TERMIOS_H
#cmakedefine HAVE_NETDB_H
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_SYS_UN_H
#cmakedefine HAVE_ERRNO_H
#define remmina "remmina"
#define VERSION "${REMMINA_VERSION}"
#define GETTEXT_PACKAGE remmina
#define REMMINA_DATADIR "${REMMINA_DATADIR}"
#define REMMINA_LOCALEDIR "${REMMINA_LOCALEDIR}"
#define REMMINA_PLUGINDIR "${REMMINA_PLUGINDIR}"
#endif
......@@ -90,15 +90,13 @@ set(REMMINA_SRCS
add_executable(remmina ${REMMINA_SRCS})
find_package(GTK3 REQUIRED)
find_required_package(GTK3)
if(GTK3_FOUND)
add_definitions(-DWITH_GTK3)
include_directories(${GTK3_INCLUDE_DIRS})
target_link_libraries(remmina ${GTK3_LIBRARY_DIRS})
endif()
find_package(AVAHI)
find_suggested_package(AVAHI)
if(AVAHI_FOUND)
add_definitions(-DHAVE_LIBAVAHI_UI)
add_definitions(-DHAVE_LIBAVAHI_CLIENT)
......@@ -106,21 +104,21 @@ if(AVAHI_FOUND)
target_link_libraries(remmina ${AVAHI_LIBRARIES})
endif()
find_package(VTE)
find_suggested_package(VTE)
if(VTE_FOUND)
add_definitions(-DHAVE_LIBVTE)
include_directories(${VTE_INCLUDE_DIRS})
target_link_libraries(remmina ${VTE_LIBRARIES})
endif()
find_package(SSH)
find_suggested_package(SSH)
if(SSH_FOUND)
add_definitions(-DHAVE_LIBSSH)
include_directories(${SSH_INCLUDE_DIRS})
target_link_libraries(remmina ${SSH_LIBRARIES})
endif()
find_package(APPINDICATOR)
find_suggested_package(APPINDICATOR)
if(APPINDICATOR_FOUND)
add_definitions(-DHAVE_LIBAPPINDICATOR)
include_directories(${APPINDICATOR_INCLUDE_DIRS})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment