Use the GNUInstallDirs layout from the eclass.

Upstream overrides the libdir to opt/megacmd/lib and the bindir to
usr/bin relative to the prefix, so CMAKE_INSTALL_PREFIX=/usr ends up in
/usr/usr/bin. The completion and sysctl.d files go to etc/ under the
prefix (/usr/etc). The vcpkg library copy reads an unset
VCPKG_INSTALLED_DIR and so installs the build host's /lib/*.so* into
the image. The ebuild installs the completion and sysctl.d files.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index caab827..b4f6bf8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ include(CMakePackageConfigHelpers) # For the CMake package
 include(target_sources_conditional) # To add files to the project without building them
 include(target_platform_compile_options) # To add compile options depeding on the platform
 
-if(UNIX AND NOT APPLE)
+if(FALSE) # Gentoo: keep GNUInstallDirs, no /opt/megacmd libdir or rpath
     # Set rpath and location for dirs accordingly:
     # If CMAKE_INSTALL_PREFIX is set (not default), it will set rpath to to such prefix plus /opt/....
     # If CMAKE_INSTALL_PREFIX is not set, it will set rpath to /opt/....
@@ -468,17 +468,9 @@ elseif(NOT WIN32)
         PATTERN "python" EXCLUDE
         PATTERN "win" EXCLUDE)
 
-    install(FILES "${CMAKE_CURRENT_LIST_DIR}/src/client/megacmd_completion.sh"
-        DESTINATION "etc/bash_completion.d"
-        )
-
-    # generate 100-megacmd-inotify-limit.conf file and have it installed
-    execute_process(COMMAND echo "fs.inotify.max_user_watches = 524288"
-                OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/99-megacmd-inotify-limit.conf)
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/99-megacmd-inotify-limit.conf
-        DESTINATION "etc/sysctl.d"
-        )
-
+    # Gentoo: the ebuild installs the bash completion and the sysctl.d
+    # file, and there are no vcpkg libraries to bundle.
+    if(FALSE)
     #Install vcpkg dynamic libraries in locations defined by GNUInstallDirs.
     if(CMAKE_BUILD_TYPE STREQUAL "Debug")
         SET(vcpkg_lib_folder "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/")
@@ -492,4 +484,5 @@ elseif(NOT WIN32)
             PATTERN "*dylib*" #macOS
             PATTERN "manual-link" EXCLUDE
             PATTERN "pkgconfig" EXCLUDE)
+    endif()
 endif() #not WIN32
