2022-06-10 22:58:35 +02:00
|
|
|
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs
|
2021-02-18 22:25:36 +01:00
|
|
|
|
2022-03-20 13:16:04 +01:00
|
|
|
project(fastfetch
|
2022-08-22 12:14:08 +02:00
|
|
|
VERSION 1.6.5
|
2022-03-20 13:16:04 +01:00
|
|
|
LANGUAGES C
|
|
|
|
)
|
2021-02-18 22:25:36 +01:00
|
|
|
|
2022-09-05 18:30:30 +02:00
|
|
|
###################
|
|
|
|
# Target Platform #
|
|
|
|
###################
|
|
|
|
|
|
|
|
if(APPLE OR ANDROID)
|
|
|
|
set(LINUX FALSE CACHE BOOL "...") # Linux true means we have full linux userland, not just the kernel
|
|
|
|
elseif(UNIX)
|
|
|
|
set(LINUX TRUE CACHE BOOL "...")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unsupported platform")
|
|
|
|
endif()
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
#####################
|
|
|
|
# Configure options #
|
|
|
|
#####################
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-09-05 19:56:00 +02:00
|
|
|
include(CMakeDependentOption)
|
|
|
|
|
|
|
|
cmake_dependent_option(ENABLE_LIBPCI "Enable libpci" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_XRANDR "Enable xrandr" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_X11 "Enable x11" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_GIO "Enable gio-2.0" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_DCONF "Enable dconf" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_DBUS "Enable dbus-1" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_XFCONF "Enable libxfconf-0" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_SQLITE3 "Enable sqlite3" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_RPM "Enable rpm" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_IMAGEMAGICK7 "Enable imagemagick 7" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_IMAGEMAGICK6 "Enable imagemagick 6" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_CHAFA "Enable chafa" ON "ENABLE_IMAGEMAGICK6 OR ENABLE_IMAGEMAGICK7" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_ZLIB "Enable zlib" ON "ENABLE_CHAFA" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_EGL "Enable egl" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_GLX "Enable glx" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_OSMESA "Enable osmesa" ON "LINUX" OFF)
|
|
|
|
cmake_dependent_option(ENABLE_OPENCL "Enable opencl" ON "LINUX" OFF)
|
|
|
|
|
|
|
|
option(BUILD_TESTS "Build tests" OFF) # Also create test executables
|
|
|
|
option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
|
2022-06-08 16:25:14 +02:00
|
|
|
|
|
|
|
#############################
|
|
|
|
# Compile time dependencies #
|
|
|
|
#############################
|
|
|
|
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
2022-09-04 14:30:52 +02:00
|
|
|
include(CheckIncludeFile)
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
####################
|
|
|
|
# Compiler options #
|
|
|
|
####################
|
|
|
|
|
2021-10-20 08:12:15 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
endif()
|
2021-03-07 20:05:00 +01:00
|
|
|
|
2022-06-08 15:52:55 +02:00
|
|
|
set(CMAKE_C_STANDARD 11)
|
2021-11-17 18:38:57 +01:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion")
|
2021-10-25 13:29:39 +02:00
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
include(CheckIPOSupported)
|
|
|
|
check_ipo_supported(RESULT IPO_SUPPORTED)
|
|
|
|
if(IPO_SUPPORTED)
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#######################
|
|
|
|
# Target FS structure #
|
|
|
|
#######################
|
|
|
|
|
2022-04-10 15:07:52 +02:00
|
|
|
if(NOT TARGET_DIR_ROOT)
|
2022-04-10 15:26:18 +02:00
|
|
|
if(NOT ANDROID)
|
|
|
|
set(TARGET_DIR_ROOT "")
|
|
|
|
else()
|
|
|
|
set(TARGET_DIR_ROOT "/data/data/com.termux/files/usr")
|
|
|
|
endif()
|
2022-04-10 15:07:52 +02:00
|
|
|
endif()
|
2022-04-10 15:26:18 +02:00
|
|
|
|
2022-04-10 15:07:52 +02:00
|
|
|
if(NOT TARGET_DIR_USR)
|
2022-04-10 15:26:18 +02:00
|
|
|
if(NOT ANDROID)
|
|
|
|
set(TARGET_DIR_USR "${TARGET_DIR_ROOT}/usr")
|
|
|
|
else()
|
|
|
|
set(TARGET_DIR_USR "${TARGET_DIR_ROOT}")
|
|
|
|
endif()
|
2022-04-10 15:07:52 +02:00
|
|
|
endif()
|
2022-04-10 15:26:18 +02:00
|
|
|
|
2022-04-10 15:07:52 +02:00
|
|
|
if(NOT TARGET_DIR_HOME)
|
2022-04-10 15:26:18 +02:00
|
|
|
if(NOT ANDROID)
|
|
|
|
set(TARGET_DIR_HOME "${TARGET_DIR_ROOT}/home")
|
|
|
|
else()
|
|
|
|
set(TARGET_DIR_HOME "/data/data/com.termux/files/home")
|
|
|
|
endif()
|
2022-04-10 15:07:52 +02:00
|
|
|
endif()
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
#################
|
|
|
|
# Tweak version #
|
|
|
|
#################
|
2021-10-22 21:53:29 +02:00
|
|
|
|
2022-04-10 15:07:52 +02:00
|
|
|
if (SET_TWEAK AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
|
|
|
execute_process(
|
|
|
|
COMMAND git describe --tags
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
OUTPUT_VARIABLE PROJECT_VERSION_TWEAK
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
string(REGEX MATCH "-[0-9]+" PROJECT_VERSION_TWEAK "${PROJECT_VERSION_TWEAK}")
|
|
|
|
endif()
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
#############
|
|
|
|
# Text data #
|
|
|
|
#############
|
|
|
|
|
|
|
|
function(fastfetch_load_text FILENAME OUTVAR)
|
|
|
|
file(READ "${FILENAME}" TEMP)
|
|
|
|
string(REPLACE "\n" "\\n" TEMP "${TEMP}")
|
|
|
|
string(REPLACE "\"" "\\\"" TEMP "${TEMP}")
|
|
|
|
string(REPLACE "$\\" "" TEMP "${TEMP}")
|
|
|
|
set("${OUTVAR}" "${TEMP}" PARENT_SCOPE)
|
|
|
|
endfunction(fastfetch_load_text)
|
|
|
|
|
2021-10-23 14:59:11 +02:00
|
|
|
fastfetch_load_text(src/data/structure.txt DATATEXT_STRUCTURE)
|
2022-07-21 14:37:13 +02:00
|
|
|
fastfetch_load_text(src/data/config_system.txt DATATEXT_CONFIG_SYSTEM)
|
|
|
|
fastfetch_load_text(src/data/config_user.txt DATATEXT_CONFIG_USER)
|
2021-10-22 21:53:29 +02:00
|
|
|
fastfetch_load_text(src/data/modules.txt DATATEXT_MODULES)
|
|
|
|
fastfetch_load_text(src/data/help.txt DATATEXT_HELP)
|
|
|
|
fastfetch_load_text(src/data/help_color.txt DATATEXT_HELP_COLOR)
|
|
|
|
fastfetch_load_text(src/data/help_format.txt DATATEXT_HELP_FORMAT)
|
|
|
|
fastfetch_load_text(src/data/help_config.txt DATATEXT_HELP_CONFIG)
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
######################
|
|
|
|
# Configure config.h #
|
|
|
|
######################
|
|
|
|
|
2021-02-22 20:36:25 +01:00
|
|
|
configure_file(src/fastfetch_config.h.in fastfetch_config.h)
|
2021-03-06 11:28:38 +01:00
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
#######################
|
|
|
|
# libfastfetch target #
|
|
|
|
#######################
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-09-04 12:43:30 +02:00
|
|
|
set(LIBFASTFETCH_SRC
|
2022-02-09 15:20:07 +01:00
|
|
|
src/util/FFstrbuf.c
|
|
|
|
src/util/FFlist.c
|
|
|
|
src/util/FFvaluestore.c
|
|
|
|
src/common/init.c
|
|
|
|
src/common/io.c
|
2022-04-08 15:50:49 +02:00
|
|
|
src/common/printing.c
|
|
|
|
src/common/caching.c
|
|
|
|
src/common/properties.c
|
|
|
|
src/common/font.c
|
2022-02-09 15:20:07 +01:00
|
|
|
src/common/processing.c
|
|
|
|
src/common/format.c
|
|
|
|
src/common/parsing.c
|
|
|
|
src/common/settings.c
|
|
|
|
src/common/library.c
|
|
|
|
src/common/networking.c
|
2022-04-02 14:35:43 +02:00
|
|
|
src/logo/logo.c
|
|
|
|
src/logo/builtin.c
|
2022-04-13 23:04:42 +02:00
|
|
|
src/logo/image/image.c
|
|
|
|
src/logo/image/im7.c
|
|
|
|
src/logo/image/im6.c
|
2022-07-22 17:18:36 +02:00
|
|
|
src/detection/qt.c
|
2022-02-09 15:20:07 +01:00
|
|
|
src/detection/gtk.c
|
|
|
|
src/detection/terminalShell.c
|
2022-06-01 00:04:58 +02:00
|
|
|
src/detection/vulkan.c
|
2022-02-13 23:51:13 +01:00
|
|
|
src/detection/media.c
|
2022-02-25 13:30:37 +01:00
|
|
|
src/detection/datetime.c
|
2022-06-15 23:15:49 +02:00
|
|
|
src/detection/temps.c
|
2022-07-22 19:36:00 +02:00
|
|
|
src/detection/title.c
|
2022-09-04 12:43:30 +02:00
|
|
|
src/detection/host/host.c
|
2022-09-04 13:33:18 +02:00
|
|
|
src/detection/os/os.c
|
2022-09-04 22:20:12 +02:00
|
|
|
src/detection/cpu/cpu.c
|
2022-09-05 17:42:42 +02:00
|
|
|
src/detection/gpu/gpu.c
|
2022-09-05 10:57:09 +02:00
|
|
|
src/detection/memory/memory.c
|
2022-02-09 15:20:07 +01:00
|
|
|
src/detection/displayserver/displayServer.c
|
|
|
|
src/detection/displayserver/wayland.c
|
|
|
|
src/detection/displayserver/xcb.c
|
|
|
|
src/detection/displayserver/xlib.c
|
|
|
|
src/detection/displayserver/wmde.c
|
|
|
|
src/modules/break.c
|
|
|
|
src/modules/custom.c
|
|
|
|
src/modules/title.c
|
|
|
|
src/modules/separator.c
|
|
|
|
src/modules/os.c
|
|
|
|
src/modules/host.c
|
|
|
|
src/modules/kernel.c
|
|
|
|
src/modules/uptime.c
|
|
|
|
src/modules/processes.c
|
|
|
|
src/modules/packages.c
|
|
|
|
src/modules/shell.c
|
|
|
|
src/modules/resolution.c
|
|
|
|
src/modules/de.c
|
|
|
|
src/modules/wm.c
|
|
|
|
src/modules/wmtheme.c
|
|
|
|
src/modules/theme.c
|
|
|
|
src/modules/icons.c
|
|
|
|
src/modules/font.c
|
|
|
|
src/modules/cursor.c
|
|
|
|
src/modules/terminal.c
|
|
|
|
src/modules/terminalfont.c
|
|
|
|
src/modules/cpu.c
|
|
|
|
src/modules/cpuUsage.c
|
|
|
|
src/modules/gpu.c
|
|
|
|
src/modules/memory.c
|
|
|
|
src/modules/disk.c
|
|
|
|
src/modules/battery.c
|
|
|
|
src/modules/locale.c
|
2022-06-01 00:04:58 +02:00
|
|
|
src/modules/vulkan.c
|
2022-02-09 15:20:07 +01:00
|
|
|
src/modules/localip.c
|
|
|
|
src/modules/publicip.c
|
2022-02-13 23:51:13 +01:00
|
|
|
src/modules/player.c
|
|
|
|
src/modules/song.c
|
2022-02-25 13:30:37 +01:00
|
|
|
src/modules/datetime.c
|
|
|
|
src/modules/date.c
|
|
|
|
src/modules/time.c
|
2022-02-09 15:20:07 +01:00
|
|
|
src/modules/colors.c
|
2022-06-04 15:21:34 +02:00
|
|
|
src/modules/opengl.c
|
2022-06-05 00:18:40 +02:00
|
|
|
src/modules/opencl.c
|
2022-02-09 15:20:07 +01:00
|
|
|
)
|
2022-02-08 07:10:46 +02:00
|
|
|
|
2022-09-04 12:43:30 +02:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND LIBFASTFETCH_SRC
|
2022-09-04 14:30:52 +02:00
|
|
|
src/detection/host/host_apple.c
|
|
|
|
src/detection/os/os_apple.c
|
2022-09-04 22:20:12 +02:00
|
|
|
src/detection/cpu/cpu_apple.c
|
2022-09-05 17:42:42 +02:00
|
|
|
src/detection/gpu/gpu_apple.c
|
2022-09-05 10:57:09 +02:00
|
|
|
src/detection/memory/memory_apple.c
|
2022-09-04 12:43:30 +02:00
|
|
|
)
|
|
|
|
elseif(ANDROID)
|
|
|
|
list(APPEND LIBFASTFETCH_SRC
|
2022-09-04 13:33:18 +02:00
|
|
|
src/detection/host/host_android.c
|
|
|
|
src/detection/os/os_android.c
|
2022-09-04 22:20:12 +02:00
|
|
|
src/detection/cpu/cpu_linux.c
|
2022-09-05 17:42:42 +02:00
|
|
|
src/detection/gpu/gpu_android.c
|
2022-09-05 10:57:09 +02:00
|
|
|
src/detection/memory/memory_linux.c
|
2022-09-04 12:43:30 +02:00
|
|
|
)
|
2022-09-05 18:30:30 +02:00
|
|
|
else()
|
2022-09-04 12:43:30 +02:00
|
|
|
list(APPEND LIBFASTFETCH_SRC
|
2022-09-04 13:33:18 +02:00
|
|
|
src/detection/host/host_linux.c
|
|
|
|
src/detection/os/os_linux.c
|
2022-09-04 22:20:12 +02:00
|
|
|
src/detection/cpu/cpu_linux.c
|
2022-09-05 17:42:42 +02:00
|
|
|
src/detection/gpu/gpu_linux.c
|
2022-09-05 10:57:09 +02:00
|
|
|
src/detection/memory/memory_linux.c
|
2022-09-04 12:43:30 +02:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(libfastfetch OBJECT
|
|
|
|
${LIBFASTFETCH_SRC}
|
|
|
|
)
|
|
|
|
|
2022-09-04 14:30:52 +02:00
|
|
|
CHECK_INCLUDE_FILE("sys/sysinfo.h" HAVE_SYSINFO_H)
|
|
|
|
if(HAVE_SYSINFO_H)
|
|
|
|
# needs to be public, because changes fastfech.h ABI
|
|
|
|
target_compile_definitions(libfastfetch PUBLIC FF_HAVE_SYSINFO_H)
|
|
|
|
endif()
|
|
|
|
|
2022-09-05 19:56:00 +02:00
|
|
|
function(ff_check_lib VARNAME)
|
|
|
|
if(NOT ENABLE_${VARNAME})
|
|
|
|
return()
|
2022-04-13 23:13:25 +02:00
|
|
|
endif()
|
2022-04-11 16:19:02 +02:00
|
|
|
|
2022-09-05 19:56:00 +02:00
|
|
|
foreach(LIBNAME ${ARGN})
|
|
|
|
pkg_check_modules(${VARNAME} ${LIBNAME})
|
|
|
|
if(${VARNAME}_FOUND)
|
|
|
|
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_${VARNAME}=1)
|
|
|
|
target_include_directories(libfastfetch PRIVATE ${${VARNAME}_INCLUDE_DIRS})
|
|
|
|
return()
|
2022-05-29 16:23:56 +02:00
|
|
|
endif()
|
2022-09-05 19:56:00 +02:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
message(WARNING "Package ${ARGV1} not found, building without support.")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
ff_check_lib(LIBPCI libpci)
|
|
|
|
ff_check_lib(VULKAN vulkan)
|
|
|
|
ff_check_lib(WAYLAND wayland-client)
|
|
|
|
ff_check_lib(XCB_RANDR xcb-randr)
|
|
|
|
ff_check_lib(XCB xcb)
|
|
|
|
ff_check_lib(XRAND xrandr)
|
|
|
|
ff_check_lib(X11 x11)
|
|
|
|
ff_check_lib(GIO gio-2.0)
|
|
|
|
ff_check_lib(DCONF dconf)
|
|
|
|
ff_check_lib(DBUS dbus-1)
|
|
|
|
ff_check_lib(XFCONF libxfconf-0)
|
|
|
|
ff_check_lib(SQLITE3 sqlite3)
|
|
|
|
ff_check_lib(RPM rpm)
|
|
|
|
ff_check_lib(IMAGEMAGICK7 MagickCore-7.Q16HDRI MagickCore-7.Q16 /usr/lib/imagemagick7/pkgconfig/MagickCore-7.Q16HDRI.pc /usr/lib/imagemagick7/pkgconfig/MagickCore-7.Q16.pc)
|
|
|
|
ff_check_lib(IMAGEMAGICK6 MagickCore-6.Q16HDRI MagickCore-6.Q16 /usr/lib/imagemagick6/pkgconfig/MagickCore-6.Q16HDRI.pc /usr/lib/imagemagick6/pkgconfig/MagickCore-6.Q16.pc)
|
|
|
|
ff_check_lib(ZLIB zlib)
|
|
|
|
ff_check_lib(CHAFA chafa>=1.10)
|
|
|
|
ff_check_lib(EGL egl)
|
|
|
|
ff_check_lib(GLX glx)
|
|
|
|
ff_check_lib(OSMESA osmesa)
|
|
|
|
ff_check_lib(OPENCL OpenCL)
|
2022-06-05 00:18:40 +02:00
|
|
|
|
2022-02-09 15:20:07 +01:00
|
|
|
target_include_directories(libfastfetch
|
|
|
|
PUBLIC ${PROJECT_BINARY_DIR}
|
|
|
|
PUBLIC ${PROJECT_SOURCE_DIR}/src
|
2021-04-09 14:07:05 +02:00
|
|
|
)
|
|
|
|
|
2022-02-09 15:20:07 +01:00
|
|
|
target_link_libraries(libfastfetch
|
|
|
|
PRIVATE ${CMAKE_DL_LIBS}
|
|
|
|
PRIVATE Threads::Threads
|
2021-02-18 22:25:36 +01:00
|
|
|
)
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
######################
|
|
|
|
# Executable targets #
|
|
|
|
######################
|
2022-02-09 15:20:07 +01:00
|
|
|
|
2021-02-27 18:30:05 +01:00
|
|
|
add_executable(fastfetch
|
|
|
|
src/fastfetch.c
|
2022-02-09 15:20:07 +01:00
|
|
|
)
|
|
|
|
target_link_libraries(fastfetch
|
|
|
|
PRIVATE libfastfetch
|
2021-02-27 18:30:05 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(flashfetch
|
|
|
|
src/flashfetch.c
|
|
|
|
)
|
2022-02-09 15:20:07 +01:00
|
|
|
target_link_libraries(flashfetch
|
|
|
|
PRIVATE libfastfetch
|
2021-02-27 18:30:05 +01:00
|
|
|
)
|
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
###################
|
|
|
|
# Testing targets #
|
|
|
|
###################
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-02-21 12:22:29 +05:00
|
|
|
if (BUILD_TESTS)
|
|
|
|
add_executable(fastfetch-test-strbuf
|
|
|
|
tests/strbuf.c
|
|
|
|
)
|
|
|
|
target_link_libraries(fastfetch-test-strbuf
|
|
|
|
PRIVATE libfastfetch
|
|
|
|
)
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
add_test(NAME test-strbuf COMMAND fastfetch-test-strbuf)
|
|
|
|
endif()
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
##################
|
|
|
|
# install target #
|
|
|
|
##################
|
2022-03-25 11:57:58 +01:00
|
|
|
|
2022-07-27 21:56:28 +02:00
|
|
|
#https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.html
|
|
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
|
|
set(CMAKE_INSTALL_PREFIX "${TARGET_DIR_USR}" CACHE PATH "..." FORCE)
|
|
|
|
endif()
|
|
|
|
|
2022-07-26 22:13:09 +02:00
|
|
|
if(NOT CMAKE_INSTALL_SYSCONFDIR)
|
2022-07-27 21:56:28 +02:00
|
|
|
set(CMAKE_INSTALL_SYSCONFDIR "${TARGET_DIR_ROOT}/etc")
|
2022-07-26 22:13:09 +02:00
|
|
|
endif()
|
|
|
|
|
2022-03-25 11:57:58 +01:00
|
|
|
include(GNUInstallDirs)
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-03-08 11:59:06 +01:00
|
|
|
install(
|
2022-07-21 14:37:13 +02:00
|
|
|
TARGETS fastfetch flashfetch
|
2022-07-27 21:56:28 +02:00
|
|
|
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
2022-03-08 11:59:06 +01:00
|
|
|
)
|
2022-02-21 11:40:33 +05:00
|
|
|
|
2022-04-06 14:02:05 +02:00
|
|
|
install(
|
2022-07-27 21:56:28 +02:00
|
|
|
FILES "${CMAKE_SOURCE_DIR}/src/data/config_system.txt"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}"
|
2022-07-21 14:37:13 +02:00
|
|
|
RENAME "config.conf"
|
2022-04-06 14:02:05 +02:00
|
|
|
)
|
|
|
|
|
2022-03-08 11:59:06 +01:00
|
|
|
install(
|
2022-07-27 21:56:28 +02:00
|
|
|
FILES "${CMAKE_SOURCE_DIR}/completions/bash"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions"
|
|
|
|
RENAME "${CMAKE_PROJECT_NAME}"
|
2022-02-21 11:40:33 +05:00
|
|
|
)
|
|
|
|
|
2022-03-08 11:59:06 +01:00
|
|
|
install(
|
2022-08-12 21:39:27 +03:00
|
|
|
DIRECTORY "${CMAKE_SOURCE_DIR}/presets"
|
2022-07-27 21:56:28 +02:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}"
|
2022-03-08 11:59:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
2022-07-27 21:56:28 +02:00
|
|
|
FILES "${CMAKE_SOURCE_DIR}/LICENSE"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${CMAKE_PROJECT_NAME}"
|
2022-02-21 11:40:33 +05:00
|
|
|
)
|
2022-03-25 11:57:58 +01:00
|
|
|
|
2022-06-08 16:25:14 +02:00
|
|
|
##################
|
|
|
|
# package target #
|
|
|
|
##################
|
2022-03-25 11:57:58 +01:00
|
|
|
|
2022-03-25 12:16:06 +01:00
|
|
|
set(CPACK_GENERATOR "DEB;RPM;TGZ;ZIP")
|
2022-07-26 22:13:09 +02:00
|
|
|
set(CPACK_SET_DESTDIR ON)
|
2022-03-25 11:57:58 +01:00
|
|
|
|
|
|
|
set(CPACK_PACKAGE_CONTACT "Linus Dierheimer <Linus@Dierheimer.de>")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Neofetch clone written in C")
|
2022-04-23 11:24:24 +02:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION "\
|
|
|
|
fastfetch is a neofetch-like tool for fetching system information and displaying them in a pretty way. \
|
|
|
|
It is written in c to achieve much better performance.\
|
2022-03-25 11:57:58 +01:00
|
|
|
")
|
|
|
|
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/LinusDierheimer")
|
|
|
|
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_SECTION, "utils")
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
2022-03-25 12:09:48 +01:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
|
2022-03-25 11:57:58 +01:00
|
|
|
|
2022-03-25 12:24:56 +01:00
|
|
|
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
|
|
|
|
2022-03-25 11:57:58 +01:00
|
|
|
include(CPack)
|