1 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
3 cmake_minimum_required (VERSION 3.0.2)
8 set(APP_IDENTIFIER "com.far2l")
9 set(CPACK_PACKAGE_NAME "far2l")
12 set(ColorNormal "${Esc}[m")
13 set(ColorRed "${Esc}[1;31m")
15 include(GNUInstallDirs)
17 # just to force reconfigure if packaging/version changed
18 configure_file(${CMAKE_SOURCE_DIR}/packaging/version ${CMAKE_BINARY_DIR}/packaging/version @ONLY)
20 # reconfigure in case .git directory changed to update version correctly
21 IF(EXISTS ${CMAKE_SOURCE_DIR}/.git)
22 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/.git)
25 file(READ "${CMAKE_SOURCE_DIR}/packaging/version" VERSION)
26 string(REGEX REPLACE "[\r\n\t ]$" "" VERSION "${VERSION}")
27 string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
28 string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
29 string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.(.*)" "\\1" VERSION_PATCH "${VERSION}")
31 if("${VERSION_MAJOR}" STREQUAL "" OR "${VERSION_MAJOR}" STREQUAL "${VERSION}"
32 OR "${VERSION_MINOR}" STREQUAL "" OR "${VERSION_MINOR}" STREQUAL "${VERSION}"
33 OR "${VERSION_PATCH}" STREQUAL "" OR "${VERSION_PATCH}" STREQUAL "${VERSION}")
34 message(FATAL_ERROR "${ColorRed}packaging/version is corrupted, please write actual X.Y.Z version into it.${ColorNormal}")
40 execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tag
41 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
42 OUTPUT_VARIABLE GIT_TAG
43 OUTPUT_STRIP_TRAILING_WHITESPACE)
46 if(NOT "${GIT_TAG}" STREQUAL "v_${VERSION}")
48 if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
49 execute_process(COMMAND "${GIT_EXECUTABLE}" show --no-patch --format=%ci HEAD
50 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
51 OUTPUT_VARIABLE GIT_DATE
52 OUTPUT_STRIP_TRAILING_WHITESPACE)
53 string(SUBSTRING ${GIT_DATE} 0 10 GIT_DATE)
54 execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
55 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
56 OUTPUT_VARIABLE GIT_HASH
57 OUTPUT_STRIP_TRAILING_WHITESPACE)
60 if(NOT "${GIT_DATE}" STREQUAL "")
61 message(STATUS "git date: ${GIT_DATE}")
62 set(VERSION_PATCH "${VERSION_PATCH}-${GIT_DATE}")
64 if(NOT "${GIT_HASH}" STREQUAL "")
65 message(STATUS "git hash: ${GIT_HASH}")
66 set(VERSION_PATCH "${VERSION_PATCH}-${GIT_HASH}")
68 message(WARNING "git information unavailable, assuming its a build from v_${VERSION}")
72 set(VERSION_PATCH "${VERSION_PATCH}-beta")
74 set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
76 set(CMAKE_CXX_STANDARD_REQUIRED ON)
77 set(CMAKE_CXX_STANDARD 11)
78 set(CMAKE_CXX_EXTENSIONS OFF)
80 if(NOT CMAKE_BUILD_TYPE)
81 set(CMAKE_BUILD_TYPE "Release")
84 message(STATUS "Build Type: ${CMAKE_BUILD_TYPE} Version: ${VERSION}")
86 if(NOT DEFINED CMAKE_INSTALL_PREFIX)
87 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
88 set(CMAKE_INSTALL_PREFIX "/usr/local")
89 elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
90 set(CMAKE_INSTALL_PREFIX "/usr/local")
92 set(CMAKE_INSTALL_PREFIX "/usr")
96 ##############################
98 if (NOT DEFINED TESTING)
102 if (NOT DEFINED USEWX)
106 if (NOT DEFINED UNRAR)
110 if (NOT DEFINED USESPDLOG)
114 # EACP disabled by default for now as FAR's GetCodePageInfo rejects all multibyte charsets due to BUGBUG.
115 # Uncomment EACP-stuff here when that will be fixed. See https://github.com/elfmz/far2l/issues/1179
116 #if (NOT DEFINED EACP)
120 if (NOT DEFINED LEGACY)
121 # TODO: default it to NO somewhere in 2022, after all obsolete settings
122 # registry-upgrade-to-ini stuff will be safe to remove
126 message(STATUS "Force-enable LEGACY due to enabled FARFTP")
130 # message(STATUS "${ColorRed}Building without East Asian codepages support due to EACP=${EACP}${ColorNormal}")
133 # set(RM rm) actually not needed: use $(CMAKE_COMMAND) -E remove
136 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__MUSL__")
137 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__MUSL__")
141 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__TAR_LIMITED_ARGS__")
142 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__TAR_LIMITED_ARGS__")
145 if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
146 message("Please consider to switch to newer CMake")
147 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
150 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64") # -fsanitize=address
151 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64") # -fsanitize=address
152 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2")
153 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O2")
155 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
156 set(APP_DIR ${CMAKE_BINARY_DIR}/install)
157 set(INSTALL_DIR ${APP_DIR}/${APP_NAME}.app/Contents/MacOS)
158 set(EXECUTABLE_NAME ${APP_NAME})
161 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
162 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
163 set(INSTALL_DIR ${CMAKE_BINARY_DIR}/install)
164 set(EXECUTABLE_NAME far2l)
166 if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
167 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--gc-sections")
168 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections")
172 if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
173 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=600")
174 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=600")
175 message(STATUS "Running under cygwin, wow!")
178 if (CMAKE_SYSTEM_NAME MATCHES "Haiku")
179 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-attributes")
182 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
183 set(CMAKE_C_VISIBILITY_PRESET hidden)
186 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINPORT_REGISTRY")
187 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPORT_REGISTRY")
188 message(STATUS "Enabling registry support due to enabled LEGACY")
190 message(STATUS "LEGACY is not enabled, your old registry settings will be forgotten, if any")
193 if(CMAKE_VERSION VERSION_GREATER "3.3")
194 cmake_policy(SET CMP0063 NEW)
195 cmake_policy(SET CMP0057 NEW)
198 include_directories(utils/include)
200 add_subdirectory (WinPort)
201 add_subdirectory (utils)
202 add_subdirectory (far2l)
205 message(STATUS "Building without GUI/wxWidgets backend due to USEWX=${USEWX}")
207 message(STATUS "Building with GUI/wxWidgets backend")
208 if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
209 if (DEFINED wxWidgets_CONFIG_EXECUTABLE)
210 message(STATUS "Using pre-defined wx config: ${wxWidgets_CONFIG_EXECUTABLE}")
212 elseif(EXISTS "/usr/local/bin/wxgtk3u-3.2-config")
213 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.2-config")
214 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.2")
215 message(STATUS "Using known location of wx-config 3.2")
217 elseif(EXISTS "/usr/local/bin/wxgtk3u-3.1-config")
218 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.1-config")
219 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.1")
220 message(STATUS "Using known location of wx-config 3.1")
222 elseif (EXISTS "/usr/local/bin/wxgtk3u-3.0-config")
223 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
224 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.0")
225 message(STATUS "Using known location of wx-config 3.0")
228 message(STATUS "No wxgtk3u-3.*-config in expected locations")
231 elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
232 if (EXISTS "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wx-config")
234 set(wxWidgets_CONFIG_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wx-config")
235 set(wxWidgets_wxrc_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wxrc")
236 message(STATUS "Using known location of wx-config 3.2")
238 elseif (EXISTS "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wx-config")
240 set(wxWidgets_CONFIG_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wx-config")
241 set(wxWidgets_wxrc_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wxrc")
242 message(STATUS "Using known location of wx-config 3.1")
245 message(STATUS "No wx-config in expected locations")
249 add_subdirectory(WinPort/src/Backend/WX)
252 if (NOT DEFINED TTYX)
255 message(STATUS "Building with TTY X11 extensions due to X11 found")
256 add_subdirectory(WinPort/src/Backend/TTY/TTYX)
258 message(STATUS "Building without TTY X11 extensions due to X11 not found")
261 message(STATUS "Building with TTY X11 extensions due to TTYX=${TTYX}")
262 add_subdirectory(WinPort/src/Backend/TTY/TTYX)
264 message(STATUS "Building without TTY X11 extensions due to TTYX=${TTYX}")
268 ##############################
271 if (NOT DEFINED ALIGN OR ALIGN)
272 message(STATUS "ALIGN plugin enabled")
273 add_subdirectory (align)
275 message(STATUS "${ColorRed}ALIGN plugin disabled due to ALIGN=${ALIGN}${ColorNormal}")
277 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/align/plug/align.far-plug-wide)
281 if (NOT DEFINED AUTOWRAP OR AUTOWRAP)
282 message(STATUS "AUTOWRAP plugin enabled")
283 add_subdirectory (autowrap)
285 message(STATUS "${ColorRed}AUTOWRAP plugin disabled due to AUTOWRAP=${AUTOWRAP}${ColorNormal}")
287 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/autowrap/plug/autowrap.far-plug-wide)
291 if (NOT DEFINED CALC OR CALC)
292 message(STATUS "CALC plugin enabled")
293 add_subdirectory (calc)
295 message(STATUS "${ColorRed}CALC plugin disabled due to CALC=${CALC}${ColorNormal}")
297 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/calc/plug/calc.far-plug-wide)
301 if (NOT DEFINED COLORER OR COLORER)
302 message(STATUS "COLORER plugin enabled")
303 add_subdirectory (colorer)
305 message(STATUS "${ColorRed}COLORER plugin disabled due to COLORER=${COLORER}${ColorNormal}")
307 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/colorer/plug/colorer.far-plug-wide)
311 if (NOT DEFINED COMPARE OR COMPARE)
312 message(STATUS "COMPARE plugin enabled")
313 add_subdirectory (compare)
315 message(STATUS "${ColorRed}COMPARE plugin disabled due to COMPARE=${COMPARE}${ColorNormal}")
317 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/compare/plug/compare.far-plug-wide)
321 if (NOT DEFINED DRAWLINE OR DRAWLINE)
322 message(STATUS "DRAWLINE plugin enabled")
323 add_subdirectory (drawline)
325 message(STATUS "${ColorRed}DRAWLINE plugin disabled due to DRAWLINE=${DRAWLINE}${ColorNormal}")
327 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/drawline/plug/drawline.far-plug-wide)
331 if (NOT DEFINED EDITCASE OR EDITCASE)
332 message(STATUS "EDITCASE plugin enabled")
333 add_subdirectory (editcase)
335 message(STATUS "${ColorRed}EDITCASE plugin disabled due to EDITCASE=${EDITCASE}${ColorNormal}")
337 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/editcase/plug/editcase.far-plug-wide)
341 if (NOT DEFINED EDITORCOMP OR EDITORCOMP)
342 message(STATUS "EDITORCOMP plugin enabled")
343 add_subdirectory (editorcomp)
345 message(STATUS "${ColorRed}EDITORCOMP plugin disabled due to EDITORCOMP=${EDITORCOMP}${ColorNormal}")
347 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/editorcomp/plug/editorcomp.far-plug-wide)
351 if (DEFINED FARFTP AND FARFTP)
352 message(STATUS "FARFTP plugin enabled (obsolete)")
353 add_subdirectory (FARStdlib)
354 add_subdirectory (farftp)
357 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/farftp/plug/farftp.far-plug-mb)
361 if (NOT DEFINED FILECASE OR FILECASE)
362 message(STATUS "FILECASE plugin enabled")
363 add_subdirectory (filecase)
365 message(STATUS "${ColorRed}FILECASE plugin disabled due to FILECASE=${FILECASE}${ColorNormal}")
367 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/filecase/plug/filecase.far-plug-wide)
371 if (NOT DEFINED INCSRCH OR INCSRCH)
372 message(STATUS "INCSRCH plugin enabled")
373 add_subdirectory (incsrch)
375 message(STATUS "${ColorRed}Building without <INCSRCH> plugin due to INCSRCH=${INCSRCH}${ColorNormal}")
377 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/incsrch/plug/incsrch.far-plug-wide)
381 if (NOT DEFINED INSIDE OR INSIDE)
382 message(STATUS "INSIDE plugin enabled")
383 add_subdirectory (inside)
385 message(STATUS "${ColorRed}INSIDE plugin disabled due to INSIDE=${INSIDE}${ColorNormal}")
387 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/inside/plug/inside.far-plug-mb)
391 if (NOT DEFINED MULTIARC OR MULTIARC)
392 message(STATUS "MULTIARC plugin enabled")
393 find_package(PkgConfig REQUIRED)
394 pkg_search_module(LibArchive QUIET libarchive)
395 if(NOT LibArchive_FOUND)
396 message(WARNING "${ColorRed}libarchive not found, multiarc will have weaker archives support. Its recommended to install libarchive-dev and reconfigure far2l.${ColorNormal}")
399 pkg_search_module(PCRE QUIET libpcre)
401 message(WARNING "${ColorRed}libpcre not found, multiarc will have no regexp support in custom archive format descriptions. Install libpcre and reconfigure far2l if you need that functionality.${ColorNormal}")
404 add_subdirectory (multiarc)
406 message(STATUS "${ColorRed}MULTIARC plugin disabled due to MULTIARC=${MULTIARC}${ColorNormal}")
408 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/multiarc/plug/multiarc.far-plug-mb)
412 if (NOT DEFINED NETROCKS OR NETROCKS)
413 message(STATUS "NETROCKS plugin enabled")
414 find_package(OpenSSL)
416 message(STATUS "OpenSSL found -> enjoy FTPS support in NetRocks")
418 message(WARNING "${ColorRed}OpenSSL not found, NetRocks will not have FTPS protocol support. Install libssl-dev if you want FTPS protocol available in NetRocks.${ColorNormal}")
421 find_package(LibSSH 0.5.0)
423 message(STATUS "libssh found -> enjoy SFTP support in NetRocks")
425 message(WARNING "${ColorRed}libssh not found, NetRocks will not have SFTP protocol support. Install libssh-dev if you want SFTP protocol available in NetRocks.${ColorNormal}")
428 find_package(Libsmbclient)
429 if(LIBSMBCLIENT_FOUND)
430 message(STATUS "libsmbclient found -> enjoy SMB support in NetRocks")
432 message(WARNING "${ColorRed}libsmbclient not found, NetRocks will not have SMB protocol support. Install libsmbclient-dev if you want SMB protocol available in NetRocks.${ColorNormal}")
433 endif(LIBSMBCLIENT_FOUND)
437 message(STATUS "libnfs found -> enjoy NFS support in NetRocks")
439 message(WARNING "${ColorRed}libnfs not found, NetRocks will not have NFS protocol support. Install libnfs-dev if you want NFS protocol available in NetRocks.${ColorNormal}")
442 find_package(LibNEON)
444 message(STATUS "libneon found -> enjoy WebDav support in NetRocks")
446 message(WARNING "${ColorRed}libneon not found, NetRocks will not have WebDav protocol support. Install libneon*-dev if you want WebDav protocol available in NetRocks.${ColorNormal}")
449 add_subdirectory (NetRocks)
451 message(STATUS "${ColorRed}NETROCKS plugin disabled due to NETROCKS=${NETROCKS}${ColorNormal}")
453 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/NetRocks/plug/NetRocks.far-plug-wide)
457 if (DEFINED VIRTUAL_PYTHON)
458 message(STATUS "PYTHON plugin with interpreter from virtualenv enabled")
459 add_subdirectory (python)
460 # Copy this explicitly cuz generic copier command excludes 'far2l'
461 install(DIRECTORY "${INSTALL_DIR}/Plugins/python/plug/far2l"
462 DESTINATION "lib/far2l/Plugins/python/plug/" USE_SOURCE_PERMISSIONS
463 COMPONENT base FILES_MATCHING
466 if (DEFINED PYTHON AND PYTHON)
467 find_package(Python3 COMPONENTS Interpreter Development)
469 if(Python3_FOUND AND Python3_Development_FOUND)
470 message(STATUS "PYTHON plugin enabled")
471 add_subdirectory (python)
473 execute_process(COMMAND echo Python: preparing virtual environment)
476 execute_process(COMMAND ${Python3_EXECUTABLE} -m venv --system-site-packages ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python)
479 execute_process(COMMAND echo Python: installing packages)
482 execute_process(COMMAND ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python/bin/python -m pip install cffi debugpy)
485 # Copy this explicitly cuz generic copier command excludes 'far2l'
486 install(DIRECTORY "${INSTALL_DIR}/Plugins/python/plug/far2l"
487 DESTINATION "lib/far2l/Plugins/python/plug/" USE_SOURCE_PERMISSIONS
488 COMPONENT base FILES_MATCHING
491 message(WARNING "${ColorRed}PYTHON plugin disabled due to missing python3 environment${ColorNormal}")
495 message(STATUS "${ColorRed}PYTHON plugin disabled, use -DPYTHON=yes if you need it${ColorNormal}")
497 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python.far-plug-wide)
502 if (NOT DEFINED SIMPLEINDENT OR SIMPLEINDENT)
503 message(STATUS "SIMPLEINDENT plugin enabled")
504 add_subdirectory (SimpleIndent)
506 message(STATUS "${ColorRed}SIMPLEINDENT plugin disabled due to SIMPLEINDENT=${SIMPLEINDENT}${ColorNormal}")
508 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/SimpleIndent/plug/SimpleIndent.far-plug-wide)
512 if (NOT DEFINED TMPPANEL OR TMPPANEL)
513 message(STATUS "TMPPANEL plugin enabled")
514 add_subdirectory (tmppanel)
516 message(STATUS "${ColorRed}TMPPANEL plugin disabled due to TMPPANEL=${TMPPANEL}${ColorNormal}")
518 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/tmppanel/plug/tmppanel.far-plug-wide)
522 ##############################
523 # common install directives
525 add_subdirectory (packaging)
527 add_subdirectory(man)
529 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
530 set(FIXUP_SCRIPT packaging/osx/FixupBundle.cmake)
531 configure_file(${FIXUP_SCRIPT}.in ${PROJECT_BINARY_DIR}/${FIXUP_SCRIPT} @ONLY)
532 install(DIRECTORY ${APP_DIR}/${APP_NAME}.app DESTINATION . USE_SOURCE_PERMISSIONS COMPONENT app EXCLUDE_FROM_ALL)
533 install(SCRIPT ${PROJECT_BINARY_DIR}/${FIXUP_SCRIPT} COMPONENT app EXCLUDE_FROM_ALL)
536 install(PROGRAMS "${INSTALL_DIR}/${EXECUTABLE_NAME}" DESTINATION "bin" RENAME far2l COMPONENT base)
538 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "lib/far2l" USE_SOURCE_PERMISSIONS COMPONENT base FILES_MATCHING
539 PATTERN "colorer/base" EXCLUDE
540 PATTERN "far2l_gui.so"
541 PATTERN "far2l_ttyx.broker"
542 PATTERN "plug/*.far-plug-*"
543 PATTERN "plug/*.broker"
546 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "share/far2l" USE_SOURCE_PERMISSIONS COMPONENT base FILES_MATCHING
547 PATTERN "${EXECUTABLE_NAME}" EXCLUDE
548 PATTERN "far2ledit" EXCLUDE
549 PATTERN "far2l_*" EXCLUDE
550 PATTERN "*.far-plug-*" EXCLUDE
551 PATTERN "*.broker" EXCLUDE
552 PATTERN "python/plug/python" EXCLUDE
556 # setup some symlinks and remove deprecated stuff from previous installation
557 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../bin/far2l ${PROJECT_BINARY_DIR}/far2l/far2l_askpass)
558 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../bin/far2l ${PROJECT_BINARY_DIR}/far2l/far2l_sudoapp)
559 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink far2l ${PROJECT_BINARY_DIR}/far2l/far2ledit)
560 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2l_askpass" DESTINATION "lib/far2l" COMPONENT system)
561 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2l_sudoapp" DESTINATION "lib/far2l" COMPONENT system)
562 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2ledit" DESTINATION "bin" COMPONENT base)
564 execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f \"\${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/objinfo/plug/objinfo.far-plug-mb\")