Skip to content

Commit e88016c

Browse files
author
Jamie Snape
committed
Write and install pkg-config file
1 parent edabf19 commit e88016c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(tinyobjloader-examples-objsticher
2828
set(TINYOBJLOADER_CMAKE_DIR lib/cmake)
2929
set(TINYOBJLOADER_INCLUDE_DIR include)
3030
set(TINYOBJLOADER_LIBRARY_DIR lib)
31+
set(TINYOBJLOADER_PKGCONFIG_DIR lib/pkgconfig)
3132

3233
option(TINYOBJLOADER_BUILD_TEST_LOADER "Build Example Loader Application" OFF)
3334
option(TINYOBJLOADER_COMPILATION_SHARED "Build as shared library" OFF)
@@ -88,6 +89,9 @@ write_basic_package_version_file(tinyobjloader-config-version.cmake
8889
SameMajorVersion
8990
)
9091

92+
#pkg-config file
93+
configure_file(tinyobjloader.pc.in tinyobjloader.pc @ONLY)
94+
9195
#Installation
9296
install ( TARGETS
9397
tinyobjloader
@@ -115,3 +119,8 @@ install ( FILES
115119
DESTINATION
116120
${TINYOBJLOADER_CMAKE_DIR}
117121
)
122+
install ( FILES
123+
"${CMAKE_CURRENT_BINARY_DIR}/tinyobjloader.pc"
124+
DESTINATION
125+
${TINYOBJLOADER_PKGCONFIG_DIR}
126+
)

tinyobjloader.pc.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generated by CMake @CMAKE_VERSION@ for @PROJECT_NAME@. Any changes to this
2+
# file will be overwritten by the next CMake run. The input file was
3+
# tinyobjloader.pc.in.
4+
5+
prefix=@CMAKE_INSTALL_PREFIX@
6+
exec_prefix=${prefix}
7+
libdir=${prefix}/@TINYOBJLOADER_LIBRARY_DIR@
8+
includedir=${prefix}/@TINYOBJLOADER_INCLUDE_DIR@
9+
10+
Name: @PROJECT_NAME@
11+
Description: Tiny but powerful single file wavefront obj loader
12+
URL: https://syoyo.github.io/tinyobjloader/
13+
Version: @TINYOBJLOADER_VERSION@
14+
Libs: -L${libdir} -ltinyobjloader
15+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)