mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36:13 +01: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)
|
add_subdirectory(doc)
|
||||||
endif()
|
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
|
# setup the install rules
|
||||||
install(DIRECTORY include
|
install(DIRECTORY include
|
||||||
DESTINATION .
|
DESTINATION .
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ else()
|
|||||||
return()
|
return()
|
||||||
endif()
|
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
|
# detect the compiler and its version
|
||||||
# Note: The detection is order is important because:
|
# Note: The detection is order is important because:
|
||||||
# - Visual Studio can both use MSVC and Clang
|
# - 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