-
-
Notifications
You must be signed in to change notification settings - Fork 615
macOS: respect CMAKE_INSTALL_SYSCONFDIR; use Cocoa API to parse plist files #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
drop libplist dependency ( macOS )
drop libplist dependency ( macOS )
LinusDierheimer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll trust you on the apple code.
| if(NOT TARGET_DIR_ETC) | ||
| set(TARGET_DIR_ETC "${CMAKE_INSTALL_SYSCONFDIR}") | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work if CMAKE_INSTALL_SYSCONFDIR is not given during configuring. It is set by include(GNUInstallDirs), which must be called after we set our default values.
TARGET_DIR_ETC and CMAKE_INSTALL_SYSCONFDIR will always be the same, so i would do the following:
Line 125 - 127:
if(NOT CMAKE_INSTALL_SYSCONFDIR)
set(CMAKE_INSTALL_SYSCONFDIR "${TARGET_DIR_ROOT}/etc" CACHE PATH "..." FORCE)
endif()fastfetch_config.h.in:
#define FASTFETCH_TARGET_DIR_ETC "@CMAKE_INSTALL_SYSCONFDIR@"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TARGET_DIR_ETC and CMAKE_INSTALL_SYSCONFDIR will always be the same
It's not the case if a user specifies CMAKE_INSTALL_SYSCONFDIR. It's necessary to make it work with macOS homebrew
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to be clear we need the following variables:
CMAKE_INSTALL_SYSCONFDIR: global fastfetch.conf goes here, only used for parsing the own config fileTARGET_DIR_ETC: global config dir, used to parse config files of other applications.
Configuring should be done the following way:
- If both are given: fine
- If one is given, initialize the other with the same value
- If none is given, initialize both with
${TARGET_DIR_ROOT}/etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the updated comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please do the code change? I'm not an expert of cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ofc.
Thanks. |
No description provided.