nickguletskii / GLXOSD

GLXOSD is an extensible on-screen display (OSD)/overlay for OpenGL applications running on Linux with X11 which aims to provide similar functionality to MSI Afterburner/RivaTuner OSD. It can show FPS, frame timings, temperatures and more in OpenGL games and applications. It can also be used to benchmark games, much like voglperf.
https://glxosd.nickguletskii.com
MIT License
123 stars 20 forks source link

glxosd binary is not executable after installation #94

Closed kparal closed 7 years ago

kparal commented 7 years ago

After make all, the bin/glxosd binary has 755 permissions (which is right). But after make install, the /usr/bin/glxosd binary has 644 permissions (no executable bit). So I need to add the executable permissions to it manually during packaging. That is not a problem, but it would be easier if it actually copied the file including the correct permissions.

I see this in CMakeLists.txt:

##### Create launcher #####
configure_file(
    ${PROJECT_SOURCE_DIR}/launcher_template.sh.in
     ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/glxosd
    @ONLY
)
file(
    COPY ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/glxosd
    DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
    FILE_PERMISSIONS
        OWNER_READ OWNER_WRITE OWNER_EXECUTE
        GROUP_READ GROUP_EXECUTE
        WORLD_READ WORLD_EXECUTE
)

install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/glxosd" DESTINATION ${CMAKE_INSTALL_BINDIR})

Which seems to create the binary with correct permissions (including executable bits). But the last statement is probably where the permissions are lost again, because install(FILES) documentation claims:

Files installed by this form are by default given permissions OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argument is given.

I tried to replace the last command with file(COPY) which claims:

Copying preserves input permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PERMISSIONS).

but the installed script is still without executable bits. I don't know what I'm doing wrong, I'm not familiar with cmake.