3 add_subdirectory (bootstrap)
22 src/EditorConfigOrg.cpp
28 src/filefilterparams.cpp
29 src/FilesSuggestor.cpp
57 src/RefreshFrameManager.cpp
64 src/TPreRedrawFunc.cpp
75 src/panels/filelist.cpp
77 src/panels/flmodes.cpp
78 src/panels/flplugin.cpp
80 src/panels/flupdate.cpp
81 src/panels/infolist.cpp
83 src/panels/treelist.cpp
85 src/console/AnsiEsc.cpp
86 src/console/keyboard.cpp
87 src/console/console.cpp
88 src/console/constitle.cpp
89 src/console/interf.cpp
90 src/console/grabber.cpp
91 src/console/lockscrn.cpp
92 src/console/palette.cpp
93 src/console/savescr.cpp
94 src/console/scrbuf.cpp
95 src/console/scrobj.cpp
96 src/console/scrsaver.cpp
98 src/filemask/CFileMask.cpp
99 src/filemask/FileMasksProcessor.cpp
100 src/filemask/FileMasksWithExclude.cpp
102 src/locale/codepage.cpp
103 src/locale/DetectCodepage.cpp
105 src/locale/locale.cpp
107 src/bookmarks/Bookmarks.cpp
108 src/bookmarks/BookmarksMenu.cpp
109 src/bookmarks/BookmarksLegacy.cpp
113 src/cfg/ConfigOpt.cpp
114 src/cfg/ConfigOptEdit.cpp
116 src/cfg/ConfigLegacy.cpp
117 src/cfg/HotkeyLetterDialog.cpp
121 src/hist/poscache.cpp
131 src/vt/vtshell_translation.cpp
132 src/vt/vtshell_compose.cpp
133 src/vt/vtshell_leader.cpp
134 src/vt/vtshell_ioreaders.cpp
135 src/vt/vtshell_mouse.cpp
137 src/vt/vtcompletor.cpp
138 src/vt/VTFar2lExtensios.cpp
140 src/base/InterThreadCall.cpp
141 src/base/SafeMMap.cpp
142 src/base/farqueue.cpp
143 src/base/FARString.cpp
152 src/mix/MountInfo.cpp
158 src/mix/processname.cpp
161 src/mix/FSFileFlags.cpp
163 src/mix/ChunkedData.cpp
164 src/mix/UsedChars.cpp
165 src/mix/CachedCreds.cpp
168 # Option to disable building macro subsystem completely
169 option(FAR2MACRO "Use Far 2 macro engine" ON)
171 # Option to keep TVar implementation even if Far2 marco subsystem is not used
172 # (as it may be needed by alternative macro subsystem implementations)
173 option(FAR2TVAR "Use Far 2 TVar" ON)
176 list(APPEND SOURCES src/macro/chgmmode.cpp)
177 list(APPEND SOURCES src/macro/macro.cpp)
178 list(APPEND SOURCES src/macro/syntax.cpp)
179 list(APPEND SOURCES src/macro/tvar.cpp)
182 list(APPEND SOURCES src/macro/tvar.cpp)
183 add_compile_definitions(FAR2TVAR)
185 list(APPEND SOURCES src/macro/nomacro.cpp)
188 # Set target names for the executables
189 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
190 set(MACOSX_BUNDLE_LONG_VERSION_STRING ${VERSION})
191 set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION})
192 set(MACOSX_BUNDLE_GUI_IDENTIFIER ${APP_IDENTIFIER})
193 set(MACOSX_BUNDLE_ICON_FILE "Far.icns")
194 set(MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME})
195 add_executable(far2l MACOSX_BUNDLE ${SOURCES} "DE/Far.icns")
196 set_target_properties(far2l PROPERTIES
197 OUTPUT_NAME ${APP_NAME}
198 RUNTIME_OUTPUT_DIRECTORY ${APP_DIR})
199 set_source_files_properties("DE/Far.icns" PROPERTIES
200 MACOSX_PACKAGE_LOCATION Resources)
202 add_executable(far2l ${SOURCES})
203 set_target_properties(far2l PROPERTIES
204 RUNTIME_OUTPUT_DIRECTORY "${INSTALL_DIR}")
207 if (NOT DEFINED USEUCD)
212 message(STATUS "Building without libuchardet due to USEUCD=${USEUCD}")
214 message(STATUS "Building with libuchardet")
215 find_package(Uchardet REQUIRED)
216 target_compile_definitions(far2l PRIVATE -DUSEUCD)
219 target_compile_definitions(far2l PRIVATE -DUNICODE)
221 target_include_directories(far2l PRIVATE
237 ${CMAKE_CURRENT_BINARY_DIR}
238 ${UCHARDET_INCLUDE_DIRS}
241 add_dependencies(far2l bootstrap WinPort)
243 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
244 SET (WINPORT -force_load WinPort wineguts utils)
246 SET (WINPORT -Wl,--whole-archive WinPort -Wl,--no-whole-archive)
249 set_target_properties(far2l
253 if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
254 target_link_libraries(far2l
257 PRIVATE ${UCHARDET_LIBRARIES})
258 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
259 target_link_libraries(far2l
262 PRIVATE ${UCHARDET_LIBRARIES})
264 target_link_libraries(far2l
267 PRIVATE ${UCHARDET_LIBRARIES})
270 add_custom_command(TARGET far2l POST_BUILD
271 COMMAND ln -sf ${EXECUTABLE_NAME} ${INSTALL_DIR}/far2l_askpass
272 COMMAND ln -sf ${EXECUTABLE_NAME} ${INSTALL_DIR}/far2l_sudoapp
273 COMMAND ln -sf ${EXECUTABLE_NAME} ${INSTALL_DIR}/far2ledit)
275 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
278 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/DE/far2l.desktop" "${CMAKE_CURRENT_BINARY_DIR}/DE/far2l.desktop")
280 install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/DE/icons" DESTINATION "share" USE_SOURCE_PERMISSIONS COMPONENT desktop FILES_MATCHING PATTERN "*")
282 # Have to make desktop file executable, see:
283 # https://wiki.ubuntu.com/SecurityTeam/Policies#Execute-Permission_Bit_Required
284 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DE/far2l.desktop" DESTINATION "share/applications" COMPONENT desktop
285 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)