Merge pull request #195 from njwhite/master
Generate & Install pkg-config File
This commit is contained in:
commit
861d836de8
9
.gitignore
vendored
9
.gitignore
vendored
@ -33,4 +33,13 @@ example/*
|
||||
!example/makefile
|
||||
!example/makefile.clang
|
||||
|
||||
# generated files
|
||||
generated
|
||||
|
||||
# Cmake
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
|
@ -31,9 +31,11 @@ set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
|
||||
set(config_install_dir "lib/cmake/${PROJECT_NAME}")
|
||||
set(include_install_dir "include")
|
||||
set(pkgconfig_install_dir "lib/pkgconfig")
|
||||
|
||||
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
||||
set(pkg_config "${generated_dir}/${PROJECT_NAME}.pc")
|
||||
set(targets_export_name "${PROJECT_NAME}Targets")
|
||||
set(namespace "${PROJECT_NAME}::")
|
||||
|
||||
@ -44,6 +46,7 @@ write_basic_package_version_file(
|
||||
|
||||
# Note: use 'targets_export_name'
|
||||
configure_file("cmake/Config.cmake.in" "${project_config}" @ONLY)
|
||||
configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY)
|
||||
|
||||
install(
|
||||
TARGETS spdlog
|
||||
@ -58,6 +61,11 @@ install(
|
||||
DESTINATION "${config_install_dir}"
|
||||
)
|
||||
|
||||
install(
|
||||
FILES "${pkg_config}"
|
||||
DESTINATION "${pkgconfig_install_dir}"
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT "${targets_export_name}"
|
||||
NAMESPACE "${namespace}"
|
||||
|
6
cmake/spdlog.pc.in
Normal file
6
cmake/spdlog.pc.in
Normal file
@ -0,0 +1,6 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: @PROJECT_NAME@
|
||||
Description: Super fast C++ logging library.
|
||||
Version: @PROJECT_VERSION@
|
Loading…
Reference in New Issue
Block a user