From e88016c63f814ceaa84127273cfd1002a1922209 Mon Sep 17 00:00:00 2001 From: Jamie Snape Date: Mon, 19 Dec 2016 11:45:00 -0500 Subject: [PATCH] Write and install pkg-config file --- CMakeLists.txt | 9 +++++++++ tinyobjloader.pc.in | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tinyobjloader.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 956c0c2..0ebd0af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(tinyobjloader-examples-objsticher set(TINYOBJLOADER_CMAKE_DIR lib/cmake) set(TINYOBJLOADER_INCLUDE_DIR include) set(TINYOBJLOADER_LIBRARY_DIR lib) +set(TINYOBJLOADER_PKGCONFIG_DIR lib/pkgconfig) option(TINYOBJLOADER_BUILD_TEST_LOADER "Build Example Loader Application" OFF) option(TINYOBJLOADER_COMPILATION_SHARED "Build as shared library" OFF) @@ -88,6 +89,9 @@ write_basic_package_version_file(tinyobjloader-config-version.cmake SameMajorVersion ) +#pkg-config file +configure_file(tinyobjloader.pc.in tinyobjloader.pc @ONLY) + #Installation install ( TARGETS tinyobjloader @@ -115,3 +119,8 @@ install ( FILES DESTINATION ${TINYOBJLOADER_CMAKE_DIR} ) +install ( FILES + "${CMAKE_CURRENT_BINARY_DIR}/tinyobjloader.pc" + DESTINATION + ${TINYOBJLOADER_PKGCONFIG_DIR} + ) diff --git a/tinyobjloader.pc.in b/tinyobjloader.pc.in new file mode 100644 index 0000000..7585fee --- /dev/null +++ b/tinyobjloader.pc.in @@ -0,0 +1,15 @@ +# Generated by CMake @CMAKE_VERSION@ for @PROJECT_NAME@. Any changes to this +# file will be overwritten by the next CMake run. The input file was +# tinyobjloader.pc.in. + +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@TINYOBJLOADER_LIBRARY_DIR@ +includedir=${prefix}/@TINYOBJLOADER_INCLUDE_DIR@ + +Name: @PROJECT_NAME@ +Description: Tiny but powerful single file wavefront obj loader +URL: https://syoyo.github.io/tinyobjloader/ +Version: @TINYOBJLOADER_VERSION@ +Libs: -L${libdir} -ltinyobjloader +Cflags: -I${includedir}