mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 13:53:36 +02:00
Add pkg-config files, optionally installed by CMake on Linux builds
The modules provided are: - csfml-system - csfml-graphics - csfml-window - csfml-audio - csfml-network - csfml-all (depends on all the above modules) They are installed to the standard location for pkg-config files on Linux. This is adapted from SFML own pkg-config files.
This commit is contained in:
1 parent
a05be24b48
commit
6476e9442e
8 files changed
+104
No files matched your search
@@ -58,6 +58,28 @@ if(CSFML_BUILD_DOC)
|
||||
add_subdirectory(doc)
|
||||
endif()
|
||||
|
||||
# on Linux and BSD-like OS, install pkg-config files by default
|
||||
set(CSFML_INSTALL_PKGCONFIG_DEFAULT FALSE)
|
||||
|
||||
if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD OR SFML_OS_NETBSD)
|
||||
set(CSFML_INSTALL_PKGCONFIG_DEFAULT TRUE)
|
||||
endif()
|
||||
|
||||
csfml_set_option(CSFML_INSTALL_PKGCONFIG_FILES ${CSFML_INSTALL_PKGCONFIG_DEFAULT} BOOL "TRUE to automatically install pkg-config files so other projects can find SFML")
|
||||
|
||||
if(CSFML_INSTALL_PKGCONFIG_FILES)
|
||||
csfml_set_option(CSFML_PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${CSFML_PKGCONFIG_DIR}" PATH "Install directory for CSFML's pkg-config .pc files")
|
||||
|
||||
foreach(csfml_module IN ITEMS all system window graphics audio network)
|
||||
configure_file(
|
||||
"tools/pkg-config/csfml-${csfml_module}.pc.in"
|
||||
"tools/pkg-config/csfml-${csfml_module}.pc"
|
||||
@ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/csfml-${csfml_module}.pc"
|
||||
DESTINATION "${CSFML_PKGCONFIG_INSTALL_PREFIX}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# setup the install rules
|
||||
install(DIRECTORY include
|
||||
DESTINATION .
|
||||
|
||||
@@ -32,6 +32,14 @@ else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# set pkgconfig install directory
|
||||
# this could be e.g. macports on mac or msys2 on windows etc.
|
||||
set(CSFML_PKGCONFIG_DIR "/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
|
||||
if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD OR SFML_OS_NETBSD)
|
||||
set(CSFML_PKGCONFIG_DIR "/libdata/pkgconfig")
|
||||
endif()
|
||||
|
||||
# detect the compiler and its version
|
||||
# Note: The detection is order is important because:
|
||||
# - Visual Studio can both use MSVC and Clang
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-all
|
||||
Description: The Simple and Fast Multimedia Library for C, all modules.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires: csfml-system, csfml-window, csfml-graphics, csfml-audio, csfml-network
|
||||
@@ -0,0 +1,13 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-audio
|
||||
Description: The Simple and Fast Multimedia Library for C, audio module.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires: csfml-system
|
||||
Requires.private: sfml-audio
|
||||
Libs: -L${libdir} -lcsfml-audio
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,13 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-graphics
|
||||
Description: The Simple and Fast Multimedia Library for C, graphics module.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires: csfml-window, csfml-system
|
||||
Requires.private: sfml-graphics
|
||||
Libs: -L${libdir} -lcsfml-graphics
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,13 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-network
|
||||
Description: The Simple and Fast Multimedia Library for C, network module.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires: csfml-system
|
||||
Requires.private: sfml-network
|
||||
Libs: -L${libdir} -lcsfml-network
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,12 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-system
|
||||
Description: The Simple and Fast Multimedia Library for C, system module.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires.private: sfml-system
|
||||
Libs: -L${libdir} -lcsfml-system
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,13 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: CSFML-window
|
||||
Description: The Simple and Fast Multimedia Library for C, window module.
|
||||
URL: https://www.sfml-dev.org
|
||||
Version: @PROJECT_VERSION@
|
||||
Requires: csfml-system
|
||||
Requires.private: sfml-window
|
||||
Libs: -L${libdir} -lcsfml-window
|
||||
Cflags: -I${includedir}
|
||||
Reference in new issue
Block a user