mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
Merge pull request #90 from hartenfels/pkg-config
Add pkg-config Support + Autotools Fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -70,3 +70,4 @@ win/x64
|
|||||||
win/x85
|
win/x85
|
||||||
win/Debug
|
win/Debug
|
||||||
cglm-test-ios*
|
cglm-test-ios*
|
||||||
|
/cglm.pc
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ cglm_HEADERS = include/cglm/version.h \
|
|||||||
include/cglm/sphere.h \
|
include/cglm/sphere.h \
|
||||||
include/cglm/ease.h \
|
include/cglm/ease.h \
|
||||||
include/cglm/curve.h \
|
include/cglm/curve.h \
|
||||||
include/cglm/bezier.h
|
include/cglm/bezier.h \
|
||||||
|
include/cglm/types-struct.h \
|
||||||
|
include/cglm/struct.h
|
||||||
|
|
||||||
cglm_calldir=$(includedir)/cglm/call
|
cglm_calldir=$(includedir)/cglm/call
|
||||||
cglm_call_HEADERS = include/cglm/call/mat4.h \
|
cglm_call_HEADERS = include/cglm/call/mat4.h \
|
||||||
@@ -152,6 +154,8 @@ test_tests_SOURCES=\
|
|||||||
test/src/test_affine.c \
|
test/src/test_affine.c \
|
||||||
test/src/test_bezier.c
|
test/src/test_bezier.c
|
||||||
|
|
||||||
|
pkgconfig_DATA=cglm.pc
|
||||||
|
|
||||||
# When running configure with --prefix, $VPATH references
|
# When running configure with --prefix, $VPATH references
|
||||||
# the source directory that post-build.sh is in. When not
|
# the source directory that post-build.sh is in. When not
|
||||||
# using a prefix, $VPATH will be unset, so we need to fall
|
# using a prefix, $VPATH will be unset, so we need to fall
|
||||||
11
README.md
11
README.md
@@ -145,6 +145,17 @@ $ make check # [Optional] (if you run `sh ./build-deps.sh`)
|
|||||||
$ [sudo] make install
|
$ [sudo] make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will also install pkg-config files so you can use
|
||||||
|
`pkg-config --cflags cglm` and `pkg-config --libs cglm` to retrieve compiler
|
||||||
|
and linker flags.
|
||||||
|
|
||||||
|
The files will be installed into the given prefix (usually `/usr/local` by
|
||||||
|
default on Linux), but your pkg-config may not be configured to actually check
|
||||||
|
there. You can figure out where it's looking by running `pkg-config --variable
|
||||||
|
pc_path pkg-config` and change the path the files are installed to via
|
||||||
|
`./configure --with-pkgconfigdir=/your/path`. Alternatively, you can add the
|
||||||
|
prefix path to your `PKG_CONFIG_PATH` environment variable.
|
||||||
|
|
||||||
### Windows (MSBuild)
|
### Windows (MSBuild)
|
||||||
Windows related build files, project files are located in `win` folder,
|
Windows related build files, project files are located in `win` folder,
|
||||||
make sure you are inside `cglm/win` folder.
|
make sure you are inside `cglm/win` folder.
|
||||||
|
|||||||
11
cglm.pc.in
Normal file
11
cglm.pc.in
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
Name: @PACKAGE_NAME@
|
||||||
|
Description: OpenGL Mathematics (glm) for C
|
||||||
|
URL: https://github.com/recp/cglm
|
||||||
|
Version: @PACKAGE_VERSION@
|
||||||
|
Cflags: -I${includedir}
|
||||||
|
Libs: -L${libdir} -lcglm @LIBS@
|
||||||
16
configure.ac
16
configure.ac
@@ -14,6 +14,20 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
AC_CONFIG_SRCDIR([src/])
|
AC_CONFIG_SRCDIR([src/])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
|
# Dependencies for pkg-config.
|
||||||
|
PKG_PROG_PKG_CONFIG
|
||||||
|
# Ancient versions of pkg-config (such as the one used in Travis CI)
|
||||||
|
# don't have this macro, so we need to do it manually.
|
||||||
|
m4_ifdef([PKG_INSTALLDIR], [
|
||||||
|
PKG_INSTALLDIR
|
||||||
|
], [
|
||||||
|
AC_ARG_WITH([pkgconfigdir],
|
||||||
|
[AS_HELP_STRING([--with-pkgconfigdir],
|
||||||
|
[pkg-config installation directory ['${libdir}/pkgconfig']])],,
|
||||||
|
[with_pkgconfigdir=]'${libdir}/pkgconfig')
|
||||||
|
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
|
||||||
|
])
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
@@ -53,6 +67,6 @@ AC_TYPE_UINT8_T
|
|||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_FUNC_ERROR_AT_LINE
|
AC_FUNC_ERROR_AT_LINE
|
||||||
|
|
||||||
AC_CONFIG_FILES([makefile])
|
AC_CONFIG_FILES([Makefile cglm.pc])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
Reference in New Issue
Block a user