Help minor upd after #1700
[far2l.git] / NetRocks / CMakeLists.txt
blob03b2582e15cfda700d64a102549760f9f5e063cc
1 project(NetRocks)
3 set(SOURCES
4 src/Erroring.cpp
5 src/Globals.cpp
6 src/SitesConfig.cpp
7 src/NetRocks.cpp
8 src/PluginImpl.cpp
9 src/PluginPanelItems.cpp
10 src/PooledStrings.cpp
11 src/GetItems.cpp
12 src/BackgroundTasks.cpp
13 src/Location.cpp
14 src/ConnectionsPool.cpp
15 src/ImportFarFtpSites.cpp
16 src/Host/HostLocal.cpp
17 src/Host/HostRemote.cpp
18 src/UI/DialogUtils.cpp
19 src/UI/Settings/ConfigurePlugin.cpp
20 src/UI/Settings/SiteConnectionEditor.cpp
21 src/UI/Settings/ConfigureProtocolFile.cpp
22 src/UI/Settings/ConfigureProtocolSFTPSCP.cpp
23 src/UI/Settings/ConfigureProtocolFTP.cpp
24 src/UI/Settings/ConfigureProtocolSMB.cpp
25 src/UI/Settings/ConfigureProtocolNFS.cpp
26 src/UI/Settings/ConfigureProtocolWebDAV.cpp
27 src/UI/Activities/Confirm.cpp
28 src/UI/Activities/ConfirmXfer.cpp
29 src/UI/Activities/ConfirmOverwrite.cpp
30 src/UI/Activities/ConfirmChangeMode.cpp
31 src/UI/Activities/SimpleOperationProgress.cpp
32 src/UI/Activities/ComplexOperationProgress.cpp
33 src/UI/Activities/AbortOperationRequest.cpp
34 src/UI/Activities/InteractiveLogin.cpp
35 src/UI/Activities/ConfirmNewServerIdentity.cpp
36 src/UI/Activities/WhatOnError.cpp
37 src/UI/Activities/BackgroundTasksUI.cpp
38 src/Op/Utils/ProgressStateUpdate.cpp
39 src/Op/Utils/Enumer.cpp
40 src/Op/Utils/IOBuffer.cpp
41 src/Op/OpBase.cpp
42 src/Op/OpConnect.cpp
43 src/Op/OpCheckDirectory.cpp
44 src/Op/OpChangeMode.cpp
45 src/Op/OpEnumDirectory.cpp
46 src/Op/OpXfer.cpp
47 src/Op/OpRemove.cpp
48 src/Op/OpMakeDirectory.cpp
49 src/Op/OpExecute.cpp
50 src/Protocol/SplitLocationSpecification.cpp
51 src/Protocol/Protocol.cpp
55 set(PROTOCOL_SOURCES
56 src/Erroring.cpp
57 src/Host/HostRemoteBroker.cpp
61 add_executable (NetRocks-FILE
62     ${PROTOCOL_SOURCES}
63     src/Protocol/File/ProtocolFile.cpp
64     src/Host/HostLocal.cpp
67 # get rid of warning: dynamic exception specifications are deprecated in C++11
68 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
70 target_link_libraries(NetRocks-FILE utils)
71 target_include_directories(NetRocks-FILE PRIVATE src)
72 set_target_properties(NetRocks-FILE
73     PROPERTIES
74     RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
75     PREFIX ""
76     SUFFIX ".broker")
77 target_compile_options(NetRocks-FILE PUBLIC -DNETROCKS_PROTOCOL)
79 if (LIBSSH_FOUND AND ((NOT DEFINED NR_SFTP) OR NR_SFTP))
80     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_SFTP")
81     add_executable (NetRocks-SFTP
82         ${PROTOCOL_SOURCES}
83         src/Protocol/SSH/SSHConnection.cpp
84         src/Protocol/SSH/ProtocolSFTP.cpp
85         src/Protocol/SSH/ProtocolSCP.cpp
86     )
87     target_link_libraries(NetRocks-SFTP utils ${LIBSSH_LIBRARIES})
88     target_include_directories(NetRocks-SFTP PRIVATE src ${LIBSSH_INCLUDE_DIRS})
89     set_target_properties(NetRocks-SFTP
90         PROPERTIES
91         RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
92         PREFIX ""
93         SUFFIX ".broker")
94 endif ()
96 if (LIBSMBCLIENT_FOUND AND ((NOT DEFINED NR_SMB) OR NR_SMB))
97     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_SMB")
98     add_executable (NetRocks-SMB
99         ${PROTOCOL_SOURCES}
100         src/Protocol/SMB/ProtocolSMB.cpp
101         src/Protocol/SMB/NMBEnum.cpp
102     )
103     target_link_libraries(NetRocks-SMB utils ${LIBSMBCLIENT_LIBRARIES})
104     target_include_directories(NetRocks-SMB PRIVATE src ${LIBSMBCLIENT_INCLUDE_DIRS})
105     set_target_properties(NetRocks-SMB
106         PROPERTIES
107         RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
108         PREFIX ""
109         SUFFIX ".broker")
110 endif ()
112 if (LIBNFS_FOUND AND ((NOT DEFINED NR_NFS) OR NR_NFS))
113     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_NFS")
114     add_executable (NetRocks-NFS
115         ${PROTOCOL_SOURCES}
116         src/Protocol/NFS/ProtocolNFS.cpp
117     )
118     target_link_libraries(NetRocks-NFS utils ${LIBNFS_LIBRARIES})
119     target_include_directories(NetRocks-NFS PRIVATE src ${LIBNFS_INCLUDE_DIRS})
120     set_target_properties(NetRocks-NFS
121         PROPERTIES
122         RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
123         PREFIX ""
124         SUFFIX ".broker")
125 endif ()
128 if (LIBNEON_FOUND AND ((NOT DEFINED NR_WEBDAV) OR NR_WEBDAV))
129     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_WEBDAV")
130     add_executable (NetRocks-WebDAV
131         ${PROTOCOL_SOURCES}
132         src/Protocol/WebDAV/ProtocolWebDAV.cpp
133     )
134     target_link_libraries(NetRocks-WebDAV utils ${LIBNEON_LIBRARIES})
135     target_include_directories(NetRocks-WebDAV PRIVATE src ${LIBNEON_INCLUDE_DIRS})
136     set_target_properties(NetRocks-WebDAV
137         PROPERTIES
138         RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
139         PREFIX ""
140         SUFFIX ".broker")
141 endif ()
143     add_executable (NetRocks-FTP
144         ${PROTOCOL_SOURCES}
145         src/Protocol/FTP/ProtocolFTP.cpp
146         src/Protocol/FTP/FTPConnection.cpp
147         src/Protocol/FTP/FTPParseMLST.cpp
148         src/Protocol/FTP/FTPParseLIST.cpp
149         src/Protocol/DirectoryEnumCache.cpp
150     )
151     target_link_libraries(NetRocks-FTP utils)
152     target_include_directories(NetRocks-FTP PRIVATE src)
153 if (OPENSSL_FOUND AND ((NOT DEFINED NR_OPENSSL) OR NR_OPENSSL))
154     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENSSL")
155     target_link_libraries(NetRocks-FTP ${OPENSSL_LIBRARIES})
156     target_include_directories(NetRocks-FTP PRIVATE ${OPENSSL_INCLUDE_DIR})
157 endif ()
158     set_target_properties(NetRocks-FTP
159         PROPERTIES
160         RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
161         PREFIX ""
162         SUFFIX ".broker")
165 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FAR_HAS_NAMELESS_UNIONS")
167 add_library (NetRocks MODULE ${SOURCES})
169 target_link_libraries(NetRocks utils far2l)
171 target_include_directories(NetRocks PRIVATE src)
172 target_include_directories(NetRocks PRIVATE ../WinPort)
173 target_include_directories(NetRocks PRIVATE ../far2l/far2sdk)
175 target_compile_definitions(NetRocks PRIVATE)
177 set_target_properties(NetRocks
178     PROPERTIES
179         LIBRARY_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/NetRocks/plug"
180         PREFIX ""
181         SUFFIX ".far-plug-wide")
183 add_custom_command(TARGET NetRocks POST_BUILD
184     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configs
185     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configs "${INSTALL_DIR}/Plugins/NetRocks")