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

Fix pkgconfig files install path #234

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

kimci86
Copy link
Contributor

@kimci86 kimci86 commented Feb 23, 2024

Fix for #233
See commit messages for details.

I tested this PR running this on Ubuntu:

cmake -S . -B build
cmake --build build
cmake --install build --prefix whatever

Files are installed as expected without sudo.

It is recommended in CMake's official documentation to use relative path
for DESTINATION parameter. Using absolute paths do not work with the
cmake --install command's --prefix option.
The variable CMAKE_INSTALL_LIBDIR is used to define CSFML_PKGCONFIG_DIR
variable in cmake/Config.cmake file.
Copy-pasted from SFML's CMakeLists.txt file.
@kimci86
Copy link
Contributor Author

kimci86 commented Feb 23, 2024

One problem though is that CMake --install command's --prefix option has no impact on csfml-*.pc.in configured output. Those files are starting with prefix=@CMAKE_INSTALL_PREFIX@ so installed files start with e.g. prefix=/usr/local regardless of --prefix option.

@eXpl0it3r
Copy link
Member

@mgrojo can you give this a try?

@mgrojo
Copy link
Contributor

mgrojo commented Feb 24, 2024

I followed the same steps as in #233 with this branch, and it worked this time.

-- Install configuration: "Release"
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-all.pc
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-system.pc
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-window.pc
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-graphics.pc
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-audio.pc
-- Installing: /home/mgr/local/lib/pkgconfig/csfml-network.pc
-- Installing: /home/mgr/local/include
-- Installing: /home/mgr/local/include/SFML
-- Installing: /home/mgr/local/include/SFML/Config.h
-- Installing: /home/mgr/local/include/SFML/Network.h
-- Installing: /home/mgr/local/include/SFML/Network
-- Installing: /home/mgr/local/include/SFML/Network/Ftp.h
-- Installing: /home/mgr/local/include/SFML/Network/Types.h
-- Installing: /home/mgr/local/include/SFML/Network/Http.h
-- Installing: /home/mgr/local/include/SFML/Network/Export.h
-- Installing: /home/mgr/local/include/SFML/Network/TcpListener.h
-- Installing: /home/mgr/local/include/SFML/Network/SocketStatus.h
-- Installing: /home/mgr/local/include/SFML/Network/UdpSocket.h
-- Installing: /home/mgr/local/include/SFML/Network/TcpSocket.h
-- Installing: /home/mgr/local/include/SFML/Network/Packet.h
-- Installing: /home/mgr/local/include/SFML/Network/IpAddress.h
-- Installing: /home/mgr/local/include/SFML/Network/SocketSelector.h
-- Installing: /home/mgr/local/include/SFML/Audio.h
-- Installing: /home/mgr/local/include/SFML/System
-- Installing: /home/mgr/local/include/SFML/System/Types.h
-- Installing: /home/mgr/local/include/SFML/System/Sleep.h
-- Installing: /home/mgr/local/include/SFML/System/Export.h
-- Installing: /home/mgr/local/include/SFML/System/Buffer.h
-- Installing: /home/mgr/local/include/SFML/System/Vector2.h
-- Installing: /home/mgr/local/include/SFML/System/Clock.h
-- Installing: /home/mgr/local/include/SFML/System/InputStream.h
-- Installing: /home/mgr/local/include/SFML/System/Vector3.h
-- Installing: /home/mgr/local/include/SFML/System/Time.h
-- Installing: /home/mgr/local/include/SFML/System/Thread.h
-- Installing: /home/mgr/local/include/SFML/System/Mutex.h
-- Installing: /home/mgr/local/include/SFML/Graphics
-- Installing: /home/mgr/local/include/SFML/Graphics/RenderTexture.h
-- Installing: /home/mgr/local/include/SFML/Graphics/VertexBuffer.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Font.h
-- Installing: /home/mgr/local/include/SFML/Graphics/VertexArray.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Vertex.h
-- Installing: /home/mgr/local/include/SFML/Graphics/FontInfo.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Types.h
-- Installing: /home/mgr/local/include/SFML/Graphics/BlendMode.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Export.h
-- Installing: /home/mgr/local/include/SFML/Graphics/PrimitiveType.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Transform.h
-- Installing: /home/mgr/local/include/SFML/Graphics/RectangleShape.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Shape.h
-- Installing: /home/mgr/local/include/SFML/Graphics/ConvexShape.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Image.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Texture.h
-- Installing: /home/mgr/local/include/SFML/Graphics/CircleShape.h
-- Installing: /home/mgr/local/include/SFML/Graphics/View.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Transformable.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Color.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Sprite.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Glyph.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Glsl.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Text.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Rect.h
-- Installing: /home/mgr/local/include/SFML/Graphics/Shader.h
-- Installing: /home/mgr/local/include/SFML/Graphics/RenderStates.h
-- Installing: /home/mgr/local/include/SFML/Graphics/RenderWindow.h
-- Installing: /home/mgr/local/include/SFML/Window
-- Installing: /home/mgr/local/include/SFML/Window/Vulkan.h
-- Installing: /home/mgr/local/include/SFML/Window/Clipboard.h
-- Installing: /home/mgr/local/include/SFML/Window/Types.h
-- Installing: /home/mgr/local/include/SFML/Window/Keyboard.h
-- Installing: /home/mgr/local/include/SFML/Window/Export.h
-- Installing: /home/mgr/local/include/SFML/Window/Touch.h
-- Installing: /home/mgr/local/include/SFML/Window/Context.h
-- Installing: /home/mgr/local/include/SFML/Window/Mouse.h
-- Installing: /home/mgr/local/include/SFML/Window/WindowBase.h
-- Installing: /home/mgr/local/include/SFML/Window/Sensor.h
-- Installing: /home/mgr/local/include/SFML/Window/Window.h
-- Installing: /home/mgr/local/include/SFML/Window/VideoMode.h
-- Installing: /home/mgr/local/include/SFML/Window/Cursor.h
-- Installing: /home/mgr/local/include/SFML/Window/Event.h
-- Installing: /home/mgr/local/include/SFML/Window/Joystick.h
-- Installing: /home/mgr/local/include/SFML/Window/WindowHandle.h
-- Installing: /home/mgr/local/include/SFML/Window/JoystickIdentification.h
-- Installing: /home/mgr/local/include/SFML/GPUPreference.h
-- Installing: /home/mgr/local/include/SFML/System.h
-- Installing: /home/mgr/local/include/SFML/Window.h
-- Installing: /home/mgr/local/include/SFML/OpenGL.h
-- Installing: /home/mgr/local/include/SFML/Audio
-- Installing: /home/mgr/local/include/SFML/Audio/Types.h
-- Installing: /home/mgr/local/include/SFML/Audio/Export.h
-- Installing: /home/mgr/local/include/SFML/Audio/Listener.h
-- Installing: /home/mgr/local/include/SFML/Audio/SoundStatus.h
-- Installing: /home/mgr/local/include/SFML/Audio/SoundRecorder.h
-- Installing: /home/mgr/local/include/SFML/Audio/SoundBufferRecorder.h
-- Installing: /home/mgr/local/include/SFML/Audio/SoundBuffer.h
-- Installing: /home/mgr/local/include/SFML/Audio/SoundStream.h
-- Installing: /home/mgr/local/include/SFML/Audio/Sound.h
-- Installing: /home/mgr/local/include/SFML/Audio/Music.h
-- Installing: /home/mgr/local/include/SFML/Graphics.h
-- Installing: /home/mgr/local/share/CSFML/license.md
-- Installing: /home/mgr/local/share/CSFML/readme.md
-- Installing: /home/mgr/local/lib/libcsfml-system.so.2.6.0
-- Installing: /home/mgr/local/lib/libcsfml-system.so.2.6
-- Installing: /home/mgr/local/lib/libcsfml-system.so
-- Installing: /home/mgr/local/lib/libcsfml-window.so.2.6.0
-- Installing: /home/mgr/local/lib/libcsfml-window.so.2.6
-- Installing: /home/mgr/local/lib/libcsfml-window.so
-- Installing: /home/mgr/local/lib/libcsfml-network.so.2.6.0
-- Installing: /home/mgr/local/lib/libcsfml-network.so.2.6
-- Installing: /home/mgr/local/lib/libcsfml-network.so
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so.2.6.0
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so.2.6
-- Installing: /home/mgr/local/lib/libcsfml-graphics.so
-- Installing: /home/mgr/local/lib/libcsfml-audio.so.2.6.0
-- Installing: /home/mgr/local/lib/libcsfml-audio.so.2.6
-- Installing: /home/mgr/local/lib/libcsfml-audio.so

Thanks @kimci86.

@eXpl0it3r eXpl0it3r merged commit 16ae40d into SFML:2.6.x Feb 25, 2024
18 checks passed
@kimci86 kimci86 deleted the bugfix/pkgconfig_files_install branch February 25, 2024 21:16
@eXpl0it3r
Copy link
Member

Thanks for fixing this! 🙂

@mgrojo mgrojo mentioned this pull request Feb 25, 2024
3 tasks
@eXpl0it3r eXpl0it3r linked an issue Feb 26, 2024 that may be closed by this pull request
3 tasks
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 this pull request may close these issues.

Install prefix not honored
4 participants