Commit b7e3a103 authored by Nick White's avatar Nick White

Generate & Install pkg-config File

parent 083d6c0d
...@@ -33,4 +33,13 @@ example/* ...@@ -33,4 +33,13 @@ example/*
!example/makefile !example/makefile
!example/makefile.clang !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") ...@@ -31,9 +31,11 @@ set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(config_install_dir "lib/cmake/${PROJECT_NAME}") set(config_install_dir "lib/cmake/${PROJECT_NAME}")
set(include_install_dir "include") set(include_install_dir "include")
set(pkgconfig_install_dir "lib/pkgconfig")
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${generated_dir}/${PROJECT_NAME}Config.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(targets_export_name "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::") set(namespace "${PROJECT_NAME}::")
...@@ -44,6 +46,7 @@ write_basic_package_version_file( ...@@ -44,6 +46,7 @@ write_basic_package_version_file(
# Note: use 'targets_export_name' # Note: use 'targets_export_name'
configure_file("cmake/Config.cmake.in" "${project_config}" @ONLY) configure_file("cmake/Config.cmake.in" "${project_config}" @ONLY)
configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY)
install( install(
TARGETS spdlog TARGETS spdlog
...@@ -58,6 +61,11 @@ install( ...@@ -58,6 +61,11 @@ install(
DESTINATION "${config_install_dir}" DESTINATION "${config_install_dir}"
) )
install(
FILES "${pkg_config}"
DESTINATION "${pkgconfig_install_dir}"
)
install( install(
EXPORT "${targets_export_name}" EXPORT "${targets_export_name}"
NAMESPACE "${namespace}" NAMESPACE "${namespace}"
......
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/include
Name: @PROJECT_NAME@
Description: Super fast C++ logging library.
Version: @PROJECT_VERSION@
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment