Skip to content
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

Install prefix not honored #233

Closed
3 tasks done
mgrojo opened this issue Feb 23, 2024 · 4 comments · Fixed by #234
Closed
3 tasks done

Install prefix not honored #233

mgrojo opened this issue Feb 23, 2024 · 4 comments · Fixed by #234
Labels

Comments

@mgrojo
Copy link
Contributor

mgrojo commented Feb 23, 2024

Prerequisite Checklist

Describe your issue here

I tried to install as a regular user, but a system path was tried to be written.

Your Environment

  • OS / distro / window manager: Ubuntu 22.04.4 LTS / Xwayland
  • CSFML version: b71e8c1
  • Compiler / toolchain: GCC
  • Special compiler / CMake flags:

Steps to reproduce

cmake --install . --prefix $HOME/local

Expected behavior

Everything is installed under $HOME/local with regular user permissions.

Actual behavior

-- Install configuration: "Release"
-- Installing: /home/mgr/local/lib/libcsfml-system.so.3.0.0
-- Installing: /home/mgr/local/lib/libcsfml-system.so.3.0
-- Installing: /home/mgr/local/lib/libcsfml-system.so
-- Installing: /home/mgr/local/lib/libcsfml-window.so.3.0.0
-- Installing: /home/mgr/local/lib/libcsfml-window.so.3.0
-- Installing: /home/mgr/local/lib/libcsfml-window.so
-- Installing: /home/mgr/local/lib/libcsfml-network.so.3.0.0
-- Installing: /home/mgr/local/lib/libcsfml-network.so.3.0
-- Installing: /home/mgr/local/lib/libcsfml-network.so
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so.3.0.0
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so.3.0
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so
-- Installing: /home/mgr/local/lib/libcsfml-audio.so.3.0.0
-- Installing: /home/mgr/local/lib/libcsfml-audio.so.3.0
-- Installing: /home/mgr/local/lib/libcsfml-audio.so
CMake Error at cmake_install.cmake:59 (file):
  file cannot create directory: /usr/local//pkgconfig.  Maybe need
  administrative privileges.
@ChrisThrasher
Copy link
Member

ChrisThrasher commented Feb 23, 2024

Please share your CMake configuration command. It appears you're trying to do something with pkgconfig as opposed to a normal CMake installation.

@mgrojo
Copy link
Contributor Author

mgrojo commented Feb 23, 2024

I simply did:

cmake .
make
cmake --install . --prefix $HOME/local

I tried also with make install but don't know how to specify the prefix. I found the last command in https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html

@texus
Copy link
Contributor

texus commented Feb 23, 2024

When you run cmake the first time, CSFML_PKGCONFIG_INSTALL_PREFIX gets initialized based on CMAKE_INSTALL_PREFIX. When running cmake the second time, it ignores the new $HOME/local prefix because the install directory for pkgfile depends on CSFML_PKGCONFIG_INSTALL_PREFIX, which was initialized with the wrong prefix on the first run.

I've seen this problem in the past as well, even in SFML itself. If you delete the build folder and specify the prefix on the first cmake run then it does get installed to the correct location (when running the install command later). Alternatively you can specify a value for CSFML_PKGCONFIG_INSTALL_PREFIX explicitly.

@mgrojo
Copy link
Contributor Author

mgrojo commented Feb 25, 2024

Fixed via #234.

@mgrojo mgrojo closed this as completed Feb 25, 2024
@eXpl0it3r eXpl0it3r linked a pull request Feb 26, 2024 that will close this issue
@eXpl0it3r eXpl0it3r added the Bug label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants