CMakeLists.txt 6.75 KB
Newer Older
1
# src/remmina - The GTK+ Remote Desktop Client
Antenore Gatta's avatar
Antenore Gatta committed
2 3 4
#
# Copyright (C) 2011 Marc-Andre Moreau
# Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5
# Copyright (C) 2016-2019 Antenore Gatta, Giovanni Panozzo
Antenore Gatta's avatar
Antenore Gatta committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#
# 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.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the
# OpenSSL library under certain conditions as described in each
# individual source file, and distribute linked combinations
# including the two.
# You must obey the GNU General Public License in all respects
# for all of the code used other than OpenSSL. If you modify
# file(s) with this exception, you may extend this exception to your
# version of the file(s), but you are not obligated to do so. If you
# do not wish to do so, delete this exception statement from your
# version. If you delete this exception statement from all source
# files in the program, then also delete it here.

35

Antenore Gatta's avatar
Antenore Gatta committed
36 37
cmake_minimum_required(VERSION 2.8)

38
list(APPEND REMMINA_SRCS
39 40 41 42 43 44 45 46 47
    "remmina_about.c"
    "remmina_about.h"
    "remmina_applet_menu.c"
    "remmina_applet_menu.h"
    "remmina_applet_menu_item.c"
    "remmina_applet_menu_item.h"
    "remmina_avahi.c"
    "remmina_avahi.h"
    "remmina.c"
48
    "remmina.h"
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    "remmina_chat_window.c"
    "remmina_chat_window.h"
    "remmina_crypt.c"
    "remmina_crypt.h"
    "remmina_exec.c"
    "remmina_exec.h"
    "remmina_file.c"
    "remmina_file_editor.c"
    "remmina_file_editor.h"
    "remmina_file.h"
    "remmina_file_manager.c"
    "remmina_file_manager.h"
    "remmina_ftp_client.c"
    "remmina_ftp_client.h"
    "remmina_icon.c"
    "remmina_icon.h"
    "remmina_key_chooser.c"
    "remmina_key_chooser.h"
    "remmina_log.c"
    "remmina_log.h"
    "remmina_main.c"
    "remmina_main.h"
    "remmina_marshals.c"
    "remmina_marshals.h"
    "remmina_marshals.list"
    "remmina_masterthread_exec.c"
    "remmina_masterthread_exec.h"
76 77
    "remmina_message_panel.c"
    "remmina_message_panel.h"
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
    "remmina_plugin_manager.c"
    "remmina_plugin_manager.h"
    "remmina_ext_exec.c"
    "remmina_ext_exec.h"
    "remmina_pref.c"
    "remmina_pref_dialog.c"
    "remmina_pref_dialog.h"
    "remmina_pref.h"
    "remmina_protocol_widget.c"
    "remmina_protocol_widget.h"
    "remmina_public.c"
    "remmina_public.h"
    "remmina_scrolled_viewport.c"
    "remmina_scrolled_viewport.h"
    "remmina_sftp_client.c"
    "remmina_sftp_client.h"
    "remmina_sftp_plugin.c"
    "remmina_sftp_plugin.h"
    "remmina_ssh.c"
    "remmina_ssh.h"
    "remmina_ssh_plugin.c"
    "remmina_ssh_plugin.h"
    "remmina_string_array.c"
    "remmina_string_array.h"
    "remmina_string_list.c"
    "remmina_string_list.h"
    "remmina_utils.c"
    "remmina_utils.h"
    "remmina_widget_pool.c"
    "remmina_widget_pool.h"
    "remmina_external_tools.c"
    "remmina_external_tools.h"
    "remmina_sysinfo.h"
    "remmina_sysinfo.c"
    "remmina_connection_window.c"
    "remmina_connection_window.h"
    "remmina_mpchange.c"
    "remmina_mpchange.h"
    "remmina_stats.c"
    "remmina_stats.h"
    "remmina_stats_sender.c"
    "remmina_stats_sender.h"
120
    )
121 122

add_executable(remmina ${REMMINA_SRCS})
123 124
include_directories(${GTK_INCLUDE_DIRS})
target_link_libraries(remmina ${GTK_LIBRARIES})
125

126
if(WITH_MANPAGES)
127
    install(FILES remmina.1 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1)
Antenore Gatta's avatar
Antenore Gatta committed
128
endif()
129

130 131 132 133
find_package(X11)
include_directories(${X11_INCLUDE_DIR})
target_link_libraries(remmina ${X11_LIBRARIES})

134 135
target_link_libraries(remmina ${CMAKE_THREAD_LIBS_INIT})

136 137 138 139 140 141 142
find_package(Intl)
if(INTL_FOUND AND "${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD|OpenBSD|NetBSD")
    message(STATUS "${CMAKE_SYSTEM_NAME} detected, building with Intl")
    include_directories(${Intl_INCLUDE_DIRS})
    target_link_libraries(remmina ${Intl_LIBRARIES})
endif()

Daniel M Weeks's avatar
Daniel M Weeks committed
143 144
find_suggested_package(LIBSSH)
if(LIBSSH_FOUND)
145 146 147
        add_definitions(-DHAVE_LIBSSH)
        include_directories(${LIBSSH_INCLUDE_DIRS})
        target_link_libraries(remmina ${LIBSSH_LIBRARIES})
Daniel M Weeks's avatar
Daniel M Weeks committed
148
endif()
149 150

if(GCRYPT_FOUND)
151 152
        include_directories(${GCRYPT_INCLUDE_DIRS})
        target_link_libraries(remmina ${GCRYPT_LIBRARIES})
153 154
endif()

155
if(AVAHI_FOUND)
156 157
        include_directories(${AVAHI_INCLUDE_DIRS})
        target_link_libraries(remmina ${AVAHI_LIBRARIES})
158 159
endif()

160
if(OPENSSL_FOUND)
Giovanni Panozzo's avatar
Giovanni Panozzo committed
161 162 163 164
        include_directories(${OPENSSL_INCLUDE_DIRS})
        target_link_libraries(remmina ${OPENSSL_LIBRARIES})
endif()

165 166
option(WITH_VTE "Build with support for VTE" ON)
if(GTK3_FOUND AND WITH_VTE)
167 168 169 170 171 172 173 174
        set(_VTE_VERSION_NUMS 2.91 2.90)
        foreach(__VTE_VERSION ${_VTE_VERSION_NUMS})
                set(_VTE_VERSION_NUM ${__VTE_VERSION})
                find_package(VTE)
                if(VTE_FOUND)
                        break()
                endif()
                message(STATUS "VTE ${__VTE_VERSION} not found")
Antenore Gatta's avatar
Antenore Gatta committed
175
        endforeach()
176
elseif(WITH_VTE)
177 178
        set(_VTE_VERSION_NUM)
        find_package(VTE)
179 180
endif()

Antenore Gatta's avatar
Antenore Gatta committed
181
if(VTE_FOUND)
182 183 184
        add_definitions(-DHAVE_LIBVTE)
        include_directories(${VTE_INCLUDE_DIRS})
        target_link_libraries(remmina ${VTE_LIBRARIES})
185 186
endif()

187
if(GTK3_FOUND)
188 189 190 191 192 193
        find_suggested_package(APPINDICATOR)
        if(APPINDICATOR_FOUND)
                add_definitions(-DHAVE_LIBAPPINDICATOR)
                include_directories(${APPINDICATOR_INCLUDE_DIRS})
                target_link_libraries(remmina ${APPINDICATOR_LIBRARIES})
        endif()
194
        find_required_package(JSONGLIB)
195 196 197 198 199 200 201 202 203 204 205 206 207
        if(JSONGLIB_FOUND)
            include_directories(${JSONGLIB_INCLUDE_DIRS})
            target_link_libraries(remmina ${JSONGLIB_LIBRARIES})
        else()
            message(FATAL_ERROR "json-glib library not found")
        endif()
        find_required_package(LIBSOUP24)
        if(LIBSOUP24_FOUND)
            include_directories(${LIBSOUP24_INCLUDE_DIRS})
            target_link_libraries(remmina ${LIBSOUP24_LIBRARIES})
        else()
            message(FATAL_ERROR "libsoup 2.4 library not found")
        endif()
208
endif()
209

210
add_subdirectory(external_tools)
211

212
install(TARGETS remmina DESTINATION ${CMAKE_INSTALL_BINDIR})
Antenore Gatta's avatar
Antenore Gatta committed
213 214 215
install(DIRECTORY include/remmina/
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/remmina
    FILES_MATCHING PATTERN "*.h")
216