build system: add pkg-config support (#674)
This commit is contained in:
committed by
Michele Caini
parent
f9c995f03f
commit
1ebf614d79
@@ -96,6 +96,12 @@ endif()
|
||||
|
||||
target_compile_features(EnTT INTERFACE cxx_std_17)
|
||||
|
||||
#
|
||||
# Set pkg-config variables
|
||||
#
|
||||
set(EnTT_PKGCONFIG ${PROJECT_BINARY_DIR}/entt.pc)
|
||||
set(EnTT_PKGCONFIG_DESTDIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
#
|
||||
# Install EnTT
|
||||
#
|
||||
@@ -114,6 +120,12 @@ write_basic_package_version_file(
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
configure_file(
|
||||
"${EnTT_SOURCE_DIR}/cmake/in/entt.pc.in"
|
||||
"${EnTT_PKGCONFIG}"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
configure_package_config_file(
|
||||
${EnTT_SOURCE_DIR}/cmake/in/EnTTConfig.cmake.in
|
||||
EnTTConfig.cmake
|
||||
@@ -142,6 +154,8 @@ install(
|
||||
|
||||
install(DIRECTORY src/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
install(FILES "${EnTT_PKGCONFIG}" DESTINATION "${EnTT_PKGCONFIG_DESTDIR}")
|
||||
|
||||
export(PACKAGE EnTT)
|
||||
|
||||
#
|
||||
|
||||
8
cmake/in/entt.pc.in
Normal file
8
cmake/in/entt.pc.in
Normal file
@@ -0,0 +1,8 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
||||
|
||||
Name: EnTT
|
||||
Description: Fast and reliable entity component system (ECS)
|
||||
Url: https://github.com/skypjack/entt
|
||||
Version: @EnTT_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Reference in New Issue
Block a user