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 execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
49 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
50 OUTPUT_VARIABLE GIT_HASH
51 OUTPUT_STRIP_TRAILING_WHITESPACE)
53 if(NOT "${GIT_HASH}" STREQUAL "")
54 message(STATUS "git hash: ${GIT_HASH}")
55 set(VERSION_PATCH "${VERSION_PATCH}-${GIT_HASH}")
57 message(WARNING "git information unavailable, assuming its a build from v_${VERSION}")
61 set(VERSION_PATCH "${VERSION_PATCH}-beta")
63 set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
65 set(CMAKE_CXX_STANDARD_REQUIRED ON)
66 set(CMAKE_CXX_STANDARD 11)
67 set(CMAKE_CXX_EXTENSIONS OFF)
69 if(NOT CMAKE_BUILD_TYPE)
70 set(CMAKE_BUILD_TYPE "Release")
73 message(STATUS "Build Type: ${CMAKE_BUILD_TYPE} Version: ${VERSION}")
75 if(NOT DEFINED CMAKE_INSTALL_PREFIX)
76 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
77 set(CMAKE_INSTALL_PREFIX "/usr/local")
78 elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
79 set(CMAKE_INSTALL_PREFIX "/usr/local")
81 set(CMAKE_INSTALL_PREFIX "/usr")
85 ##############################
87 if (NOT DEFINED USEWX)
91 if (NOT DEFINED UNRAR)
95 # EACP disabled by default for now as FAR's GetCodePageInfo rejects all multibyte charsets due to BUGBUG.
96 # Uncomment EACP-stuff here when that will be fixed. See https://github.com/elfmz/far2l/issues/1179
97 #if (NOT DEFINED EACP)
101 if (NOT DEFINED LEGACY)
102 # TODO: default it to NO somewhere in 2022, after all obsolete settings
103 # registry-upgrade-to-ini stuff will be safe to remove
107 message(STATUS "Force-enable LEGACY due to enabled FARFTP")
111 # message(STATUS "${ColorRed}Building without East Asian codepages support due to EACP=${EACP}${ColorNormal}")
114 if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
120 find_program(M4_PROG NAMES ${M4_NAME})
123 message(FATAL_ERROR "${ColorRed}${M4_NAME} not found - please install it${ColorNormal}")
125 set(M4 ${M4_PROG} -P "-DARCH=${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}" "-DMAJOR=${VERSION_MAJOR}" "-DMINOR=${VERSION_MINOR}" "-DPATCH=${VERSION_PATCH}")
127 # set(RM rm) actually not needed: use $(CMAKE_COMMAND) -E remove
128 find_program (GAWK NAMES gawk)
130 message(FATAL_ERROR "${ColorRed}gawk not found - please install it${ColorNormal}")
134 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__MUSL__")
135 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__MUSL__")
139 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__TAR_LIMITED_ARGS__")
140 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__TAR_LIMITED_ARGS__")
143 if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
144 message("Please consider to switch to newer CMake")
145 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
148 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64") # -fsanitize=address
149 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99 -fPIC -Wno-unused-function -D_FILE_OFFSET_BITS=64") # -fsanitize=address
150 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2")
151 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O2")
153 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
154 set(APP_DIR ${CMAKE_BINARY_DIR}/install)
155 set(INSTALL_DIR ${APP_DIR}/${APP_NAME}.app/Contents/MacOS)
156 set(EXECUTABLE_NAME ${APP_NAME})
159 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
160 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
161 set(INSTALL_DIR ${CMAKE_BINARY_DIR}/install)
162 set(EXECUTABLE_NAME far2l)
164 if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
165 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--gc-sections")
166 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections")
170 if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
171 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=600")
172 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=600")
173 message(STATUS "Running under cygwin, wow!")
176 if (CMAKE_SYSTEM_NAME MATCHES "Haiku")
177 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-attributes")
180 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
181 set(CMAKE_C_VISIBILITY_PRESET hidden)
184 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINPORT_REGISTRY")
185 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPORT_REGISTRY")
186 message(STATUS "Enabling registry support due to enabled LEGACY")
188 message(STATUS "LEGACY is not enabled, your old registry settings will be forgotten, if any")
191 if(CMAKE_VERSION VERSION_GREATER "3.3")
192 cmake_policy(SET CMP0063 NEW)
193 cmake_policy(SET CMP0057 NEW)
196 include_directories(utils/include)
198 add_subdirectory (WinPort)
199 add_subdirectory (utils)
200 add_subdirectory (far2l)
203 message(STATUS "Building without GUI/wxWidgets backend due to USEWX=${USEWX}")
205 message(STATUS "Building with GUI/wxWidgets backend")
206 if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
207 if (DEFINED wxWidgets_CONFIG_EXECUTABLE)
208 message(STATUS "Using pre-defined wx config: ${wxWidgets_CONFIG_EXECUTABLE}")
210 elseif(EXISTS "/usr/local/bin/wxgtk3u-3.2-config")
211 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.2-config")
212 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.2")
213 message(STATUS "Using known location of wx-config 3.2")
215 elseif(EXISTS "/usr/local/bin/wxgtk3u-3.1-config")
216 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.1-config")
217 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.1")
218 message(STATUS "Using known location of wx-config 3.1")
220 elseif (EXISTS "/usr/local/bin/wxgtk3u-3.0-config")
221 set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
222 set(wxWidgets_wxrc_EXECUTABLE "/usr/local/bin/wxrc-gtk3u-3.0")
223 message(STATUS "Using known location of wx-config 3.0")
226 message(STATUS "No wxgtk3u-3.*-config in expected locations")
229 elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
230 if (EXISTS "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wx-config")
232 set(wxWidgets_CONFIG_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wx-config")
233 set(wxWidgets_wxrc_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.2/bin/wxrc")
234 message(STATUS "Using known location of wx-config 3.2")
236 elseif (EXISTS "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wx-config")
238 set(wxWidgets_CONFIG_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wx-config")
239 set(wxWidgets_wxrc_EXECUTABLE "/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.1/bin/wxrc")
240 message(STATUS "Using known location of wx-config 3.1")
243 message(STATUS "No wx-config in expected locations")
247 add_subdirectory(WinPort/src/Backend/WX)
250 if (NOT DEFINED TTYX)
253 message(STATUS "Building with TTY X11 extensions due to X11 found")
254 add_subdirectory(WinPort/src/Backend/TTY/TTYX)
256 message(STATUS "Building without TTY X11 extensions due to X11 not found")
259 message(STATUS "Building with TTY X11 extensions due to TTYX=${TTYX}")
260 add_subdirectory(WinPort/src/Backend/TTY/TTYX)
262 message(STATUS "Building without TTY X11 extensions due to TTYX=${TTYX}")
266 ##############################
269 if (NOT DEFINED ALIGN OR ALIGN)
270 message(STATUS "ALIGN plugin enabled")
271 add_subdirectory (align)
273 message(STATUS "${ColorRed}ALIGN plugin disabled due to ALIGN=${ALIGN}${ColorNormal}")
275 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/align/plug/align.far-plug-wide)
279 if (NOT DEFINED AUTOWRAP OR AUTOWRAP)
280 message(STATUS "AUTOWRAP plugin enabled")
281 add_subdirectory (autowrap)
283 message(STATUS "${ColorRed}AUTOWRAP plugin disabled due to AUTOWRAP=${AUTOWRAP}${ColorNormal}")
285 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/autowrap/plug/autowrap.far-plug-wide)
289 if (NOT DEFINED CALC OR CALC)
290 message(STATUS "CALC plugin enabled")
291 add_subdirectory (calc)
293 message(STATUS "${ColorRed}CALC plugin disabled due to CALC=${CALC}${ColorNormal}")
295 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/calc/plug/calc.far-plug-wide)
299 if (NOT DEFINED COLORER OR COLORER)
300 message(STATUS "COLORER plugin enabled")
301 add_subdirectory (colorer)
303 message(STATUS "${ColorRed}COLORER plugin disabled due to COLORER=${COLORER}${ColorNormal}")
305 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/colorer/plug/colorer.far-plug-wide)
309 if (NOT DEFINED COMPARE OR COMPARE)
310 message(STATUS "COMPARE plugin enabled")
311 add_subdirectory (compare)
313 message(STATUS "${ColorRed}COMPARE plugin disabled due to COMPARE=${COMPARE}${ColorNormal}")
315 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/compare/plug/compare.far-plug-wide)
319 if (NOT DEFINED DRAWLINE OR DRAWLINE)
320 message(STATUS "DRAWLINE plugin enabled")
321 add_subdirectory (drawline)
323 message(STATUS "${ColorRed}DRAWLINE plugin disabled due to DRAWLINE=${DRAWLINE}${ColorNormal}")
325 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/drawline/plug/drawline.far-plug-wide)
329 if (NOT DEFINED EDITCASE OR EDITCASE)
330 message(STATUS "EDITCASE plugin enabled")
331 add_subdirectory (editcase)
333 message(STATUS "${ColorRed}EDITCASE plugin disabled due to EDITCASE=${EDITCASE}${ColorNormal}")
335 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/editcase/plug/editcase.far-plug-wide)
339 if (NOT DEFINED EDITORCOMP OR EDITORCOMP)
340 message(STATUS "EDITORCOMP plugin enabled")
341 add_subdirectory (editorcomp)
343 message(STATUS "${ColorRed}EDITORCOMP plugin disabled due to EDITORCOMP=${EDITORCOMP}${ColorNormal}")
345 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/editorcomp/plug/editorcomp.far-plug-wide)
349 if (DEFINED FARFTP AND FARFTP)
350 message(STATUS "FARFTP plugin enabled (obsolete)")
351 add_subdirectory (FARStdlib)
352 add_subdirectory (farftp)
355 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/farftp/plug/farftp.far-plug-mb)
359 if (NOT DEFINED FILECASE OR FILECASE)
360 message(STATUS "FILECASE plugin enabled")
361 add_subdirectory (filecase)
363 message(STATUS "${ColorRed}FILECASE plugin disabled due to FILECASE=${FILECASE}${ColorNormal}")
365 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/filecase/plug/filecase.far-plug-wide)
369 if (NOT DEFINED INCSRCH OR INCSRCH)
370 message(STATUS "INCSRCH plugin enabled")
371 add_subdirectory (incsrch)
373 message(STATUS "${ColorRed}Building without <INCSRCH> plugin due to INCSRCH=${INCSRCH}${ColorNormal}")
375 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/incsrch/plug/incsrch.far-plug-wide)
379 if (NOT DEFINED INSIDE OR INSIDE)
380 message(STATUS "INSIDE plugin enabled")
381 add_subdirectory (inside)
383 message(STATUS "${ColorRed}INSIDE plugin disabled due to INSIDE=${INSIDE}${ColorNormal}")
385 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/inside/plug/inside.far-plug-mb)
389 if (NOT DEFINED MULTIARC OR MULTIARC)
390 message(STATUS "MULTIARC plugin enabled")
391 find_package(PkgConfig REQUIRED)
392 pkg_search_module(LibArchive QUIET libarchive)
393 if(NOT LibArchive_FOUND)
394 message(WARNING "${ColorRed}libarchive not found, multiarc will have weaker archives support. Its recommended to install libarchive-dev and reconfigure far2l.${ColorNormal}")
397 pkg_search_module(PCRE QUIET libpcre)
399 message(WARNING "${ColorRed}libpcre not found, multiarc will have no custom archives support. Install libpcre and reconfigure far2l if you need that functionality.${ColorNormal}")
402 add_subdirectory (multiarc)
404 message(STATUS "${ColorRed}MULTIARC plugin disabled due to MULTIARC=${MULTIARC}${ColorNormal}")
406 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/multiarc/plug/multiarc.far-plug-mb)
410 if (NOT DEFINED NETROCKS OR NETROCKS)
411 message(STATUS "NETROCKS plugin enabled")
412 find_package(OpenSSL)
414 message(STATUS "OpenSSL found -> enjoy FTPS support in NetRocks")
416 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}")
419 find_package(LibSSH 0.5.0)
421 message(STATUS "libssh found -> enjoy SFTP support in NetRocks")
423 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}")
426 find_package(Libsmbclient)
427 if(LIBSMBCLIENT_FOUND)
428 message(STATUS "libsmbclient found -> enjoy SMB support in NetRocks")
430 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}")
431 endif(LIBSMBCLIENT_FOUND)
435 message(STATUS "libnfs found -> enjoy NFS support in NetRocks")
437 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}")
440 find_package(LibNEON)
442 message(STATUS "libneon found -> enjoy WebDav support in NetRocks")
444 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}")
447 add_subdirectory (NetRocks)
449 message(STATUS "${ColorRed}NETROCKS plugin disabled due to NETROCKS=${NETROCKS}${ColorNormal}")
451 execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/NetRocks/plug/NetRocks.far-plug-wide)
455 if (DEFINED VIRTUAL_PYTHON)
456 message(STATUS "PYTHON plugin with interpreter from virtualenv enabled")
457 add_subdirectory (python)
458 # Copy this explicitly cuz generic copier command excludes 'far2l'
459 install(DIRECTORY "${INSTALL_DIR}/Plugins/python/plug/far2l"
460 DESTINATION "share/far2l/Plugins/python/plug/" USE_SOURCE_PERMISSIONS
461 COMPONENT base FILES_MATCHING
464 if (DEFINED PYTHON AND PYTHON)
465 find_package(Python3 COMPONENTS Interpreter Development)
467 if(Python3_FOUND AND Python3_Development_FOUND)
468 message(STATUS "PYTHON plugin enabled")
469 add_subdirectory (python)
471 execute_process(COMMAND echo Python: preparing virtual environment)
474 execute_process(COMMAND ${PYTHON3} -m venv --system-site-packages ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python)
477 execute_process(COMMAND echo Python: installing packages)
480 execute_process(COMMAND ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python/bin/python -m pip install cffi debugpy)
483 # Copy this explicitly cuz generic copier command excludes 'far2l'
484 install(DIRECTORY "${INSTALL_DIR}/Plugins/python/plug/far2l"
485 DESTINATION "share/far2l/Plugins/python/plug/" USE_SOURCE_PERMISSIONS
486 COMPONENT base FILES_MATCHING
489 message(WARNING "${ColorRed}PYTHON plugin disabled due to missing python3 environment${ColorNormal}")
493 message(STATUS "${ColorRed}PYTHON plugin disabled, use -DPYTHON=yes if you need it${ColorNormal}")
495 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/python/plug/python.far-plug-wide)
500 if (NOT DEFINED SIMPLEINDENT OR SIMPLEINDENT)
501 message(STATUS "SIMPLEINDENT plugin enabled")
502 add_subdirectory (SimpleIndent)
504 message(STATUS "${ColorRed}SIMPLEINDENT plugin disabled due to SIMPLEINDENT=${SIMPLEINDENT}${ColorNormal}")
506 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/SimpleIndent/plug/SimpleIndent.far-plug-wide)
510 if (NOT DEFINED TMPPANEL OR TMPPANEL)
511 message(STATUS "TMPPANEL plugin enabled")
512 add_subdirectory (tmppanel)
514 message(STATUS "${ColorRed}TMPPANEL plugin disabled due to TMPPANEL=${TMPPANEL}${ColorNormal}")
516 execute_process(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/tmppanel/plug/tmppanel.far-plug-wide)
520 ##############################
521 # common install directives
523 add_subdirectory (packaging)
525 add_subdirectory(man)
527 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
528 set(FIXUP_SCRIPT packaging/osx/FixupBundle.cmake)
529 configure_file(${FIXUP_SCRIPT}.in ${PROJECT_BINARY_DIR}/${FIXUP_SCRIPT} @ONLY)
530 install(DIRECTORY ${APP_DIR}/${APP_NAME}.app DESTINATION . USE_SOURCE_PERMISSIONS COMPONENT app EXCLUDE_FROM_ALL)
531 install(SCRIPT ${PROJECT_BINARY_DIR}/${FIXUP_SCRIPT} COMPONENT app EXCLUDE_FROM_ALL)
534 install(PROGRAMS "${INSTALL_DIR}/${EXECUTABLE_NAME}" DESTINATION "bin" RENAME far2l COMPONENT base)
536 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "lib/far2l" USE_SOURCE_PERMISSIONS COMPONENT base FILES_MATCHING
537 PATTERN "colorer/base" EXCLUDE
538 PATTERN "far2l_gui.so"
539 PATTERN "far2l_ttyx.broker"
540 PATTERN "plug/*.far-plug-*"
541 PATTERN "plug/*.broker")
543 install(DIRECTORY "${INSTALL_DIR}/" DESTINATION "share/far2l" USE_SOURCE_PERMISSIONS COMPONENT base FILES_MATCHING
544 PATTERN "${EXECUTABLE_NAME}" EXCLUDE
545 PATTERN "far2ledit" EXCLUDE
546 PATTERN "far2l_*" EXCLUDE
547 PATTERN "*.far-plug-*" EXCLUDE
548 PATTERN "*.broker" EXCLUDE
549 PATTERN "python/plug/python" EXCLUDE
552 # setup some symlinks and remove deprecated stuff from previous installation
553 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../bin/far2l ${PROJECT_BINARY_DIR}/far2l/far2l_askpass)
554 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../bin/far2l ${PROJECT_BINARY_DIR}/far2l/far2l_sudoapp)
555 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink far2l ${PROJECT_BINARY_DIR}/far2l/far2ledit)
556 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2l_askpass" DESTINATION "lib/far2l" COMPONENT system)
557 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2l_sudoapp" DESTINATION "lib/far2l" COMPONENT system)
558 install(FILES "${PROJECT_BINARY_DIR}/far2l/far2ledit" DESTINATION "bin" COMPONENT base)
560 execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f \"\${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/objinfo/plug/objinfo.far-plug-mb\")