Skip to content

Commit

Permalink
cmakelists updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetmertguduz committed May 10, 2024
1 parent 28b1d91 commit 075b47f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# VERSION
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.10)

# PROJECT
project(yiffy VERSION 1.0.0 DESCRIPTION "The terminal app for downloading/fetching images from e621/e926" LANGUAGES C)
Expand Down
19 changes: 13 additions & 6 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CREATING THE BINARY FILE
# CREATE THE BINARY FILE
add_executable(yiffy yiffy.c)

# FIND NCURSES
Expand All @@ -21,8 +21,15 @@ install(SCRIPT
CODE "file(WRITE \"${file_path}\" \"plog:nsfw\")"
)

# INSTALL THE EXECUTABLE TO USR/BIN
install(
TARGETS yiffy
DESTINATION /usr/local/bin/
)
# INSTALL THE EXECUTABLE TO USR/LOCAL/BIN
install(TARGETS yiffy DESTINATION /usr/local/bin)

# Create and install the config file, ensuring it writes with the correct permissions
install(CODE "
file(MAKE_DIRECTORY \"${dest_path}\")
file(WRITE \"${dest_path}/yiffy-config.txt\" \"plog:nsfw\")
execute_process(COMMAND chmod 755 \"${dest_path}\")
execute_process(COMMAND chmod 755 \"${dest_path}/yiffy-config.txt\")
execute_process(COMMAND chown $ENV{USER}:$ENV{USER} \"${dest_path}\")
execute_process(COMMAND chown $ENV{USER}:$ENV{USER} \"${dest_path}/yiffy-config.txt\")
")

0 comments on commit 075b47f

Please sign in to comment.