From edceac754f7f0d720e4f82d522f9bc354bc09b1f Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sun, 4 Jun 2023 13:50:34 +0800 Subject: [PATCH] chore: remove trivial macro from CMakeLists --- CMakeLists.txt | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30c11df..d060b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,29 +198,15 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git") endif () endif () -# Helper macros for install settings -macro (ppic_convert_to_relative_path _var) - # Make sure _var is a relative path - if (IS_ABSOLUTE "${${_var}}") - file (RELATIVE_PATH ${_var} "${CMAKE_INSTALL_PREFIX}" "${${_var}}") - endif () -endmacro () - # Install settings if (WIN32) - # FIXME: try to avoid install to a "bin" subfolder under windows... - # when fixed, don't forget to update the CI config file... - set (BIN_INSTALL_DIR "") # seems useless, don't know why... + # TODO: try to avoid install to a "bin" subfolder under windows... + # when fixed, don't forget to update the CI config file... elseif (UNIX) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) endif () - set (BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") # relative, usually "bin" - ppic_convert_to_relative_path(BIN_INSTALL_DIR) - set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") # "lib" or "lib64" - ppic_convert_to_relative_path(LIB_INSTALL_DIR) - # install icon install ( FILES assets/icons/app-icon.svg @@ -242,9 +228,9 @@ elseif (UNIX) endif() set (INSTALL_TARGETS_DEFAULT_ARGS - RUNTIME DESTINATION ${BIN_INSTALL_DIR} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Devel + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel ) install (