Salome HOME
Copyright update 2022
[modules/gui.git] / tools / RemoteFileBrowser / CMakeLists.txt
1 # Copyright (C) 2017-2022  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19 # Author : Anthony GEAY (EDF R&D)
20
21 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
22 PROJECT(RemoteFileBrowser CXX)
23
24 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake files")
25 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
26   LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
27   INCLUDE(SalomeMacros NO_POLICY_SCOPE)
28 ELSE()
29   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
30 ENDIF()
31
32 SET(REMOTEFILEBROWSER_INSTALL_BINS bin CACHE PATH "Install path: RemoteFileBrowser binaries")
33 SET(REMOTEFILEBROWSER_INSTALL_LIBS lib CACHE PATH "Install path: RemoteFileBrowser libraries")
34 SET(REMOTEFILEBROWSER_INSTALL_HEADERS include CACHE PATH "Install path: RemoteFileBrowser headers")
35
36 INCLUDE(SalomeSetupPlatform)
37 SET(BUILD_SHARED_LIBS TRUE)
38 FIND_PACKAGE(SalomeQt5 REQUIRED)
39 INCLUDE(UseQtExt)
40 INCLUDE_DIRECTORIES(
41   ${QT_INCLUDES}
42   )
43
44 ADD_DEFINITIONS(
45   ${QT_DEFINITIONS}
46   )
47
48 SET(qremotefilebrowser_SOURCES
49   QRemoteFileBrowser.cxx
50   QMachineBrowser.cxx
51   QRemoteCopyWidget.cxx
52   )
53
54 SET(qremotefilebrowser_HEADERS
55   QRemoteFileBrowser.h
56   QRemoteCopyWidget.h
57   QMachineBrowser.h
58   RemoteFileBrowser.h 
59   )
60
61 SET(qremotefilebrowser_LIBRARIES
62   "Qt5::Core;Qt5::Widgets"
63   )
64
65 SET(_moc_HEADERS
66   QRemoteFileBrowser.h
67   QMachineBrowser.h
68   QRemoteCopyWidget.h
69   )
70
71 # sources / moc wrappings
72 QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
73
74 ADD_LIBRARY(qremotefilebrowser ${qremotefilebrowser_SOURCES} ${_moc_SOURCES})
75 TARGET_LINK_LIBRARIES(qremotefilebrowser ${qremotefilebrowser_LIBRARIES})
76 ADD_EXECUTABLE(remotefilebrowser remotefilebrowser.cxx)
77 TARGET_LINK_LIBRARIES(remotefilebrowser qremotefilebrowser)
78 INSTALL(TARGETS remotefilebrowser DESTINATION ${REMOTEFILEBROWSER_INSTALL_BINS})
79 INSTALL(TARGETS qremotefilebrowser DESTINATION ${REMOTEFILEBROWSER_INSTALL_LIBS})
80 INSTALL(FILES ${_moc_HEADERS} DESTINATION ${REMOTEFILEBROWSER_INSTALL_HEADERS})