| @@ -1,58 +1,66 @@ | | | @@ -1,58 +1,66 @@ |
1 | # $NetBSD: cmake.mk,v 1.11 2014/08/23 19:26:07 wiz Exp $ | | 1 | # $NetBSD: cmake.mk,v 1.12 2014/09/06 01:50:38 obache Exp $ |
2 | # | | 2 | # |
3 | # This file handles packages that use CMake as their primary build | | 3 | # This file handles packages that use CMake as their primary build |
4 | # system. For more information about CMake, see http://www.cmake.org/. | | 4 | # system. For more information about CMake, see http://www.cmake.org/. |
5 | # | | 5 | # |
6 | # === Package-settable variables === | | 6 | # === Package-settable variables === |
7 | # | | 7 | # |
8 | # CMAKE_DEPENDENCIES_REWRITE | | 8 | # CMAKE_DEPENDENCIES_REWRITE |
9 | # A list of files (XXX: variable name) relative to WRKSRC in | | 9 | # A list of files (XXX: variable name) relative to WRKSRC in |
10 | # which, after configuring the package, buildlink3 dependencies | | 10 | # which, after configuring the package, buildlink3 dependencies |
11 | # are resolved to the real ones. | | 11 | # are resolved to the real ones. |
12 | # | | 12 | # |
13 | # CMAKE_MODULE_PATH_OVERRIDE | | 13 | # CMAKE_MODULE_PATH_OVERRIDE |
14 | # A list of files relative to WRKSRC in which the CMAKE_MODULE_PATH | | 14 | # A list of files relative to WRKSRC in which the CMAKE_MODULE_PATH |
15 | # variable is adjusted to include the path from the pkgsrc wrappers. | | 15 | # variable is adjusted to include the path from the pkgsrc wrappers. |
16 | # The file ${WRKSRC}/CMakeLists.txt is always appended to this list. | | 16 | # The file ${WRKSRC}/CMakeLists.txt is always appended to this list. |
17 | # | | 17 | # |
18 | # CMAKE_PREFIX_PATH | | 18 | # CMAKE_PREFIX_PATH |
19 | # A list of directories to add the CMAKE_PREFIX_PATH cmake variable. | | 19 | # A list of directories to add the CMAKE_PREFIX_PATH cmake variable. |
20 | # If a package installs it's contents in ${PREFIX}/package instead of | | 20 | # If a package installs it's contents in ${PREFIX}/package instead of |
21 | # ${PREFIX} and it installs cmake modules there | | 21 | # ${PREFIX} and it installs cmake modules there |
22 | # "CMAKE_PREFIX_PATH += ${PREFIX}/package" should be in it's | | 22 | # "CMAKE_PREFIX_PATH += ${PREFIX}/package" should be in it's |
23 | # buildlink3.mk so that packages that depend on it can find it's | | 23 | # buildlink3.mk so that packages that depend on it can find it's |
24 | # cmake modules if they use cmake to build. | | 24 | # cmake modules if they use cmake to build. |
25 | # | | 25 | # |
| | | 26 | # CMAKE_USE_GNU_INSTALL_DIRS |
| | | 27 | # If set to yes, set GNU standard installation directories with pkgsrc |
| | | 28 | # configured settings. The default is yes. |
| | | 29 | # |
26 | | | 30 | |
27 | _CMAKE_DIR= ${BUILDLINK_DIR}/cmake-Modules | | 31 | _CMAKE_DIR= ${BUILDLINK_DIR}/cmake-Modules |
28 | | | 32 | |
| | | 33 | CMAKE_USE_GNU_INSTALL_DIRS?= yes |
| | | 34 | |
29 | CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} | | 35 | CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} |
30 | CMAKE_ARGS+= -DCMAKE_MODULE_PATH:PATH=${_CMAKE_DIR} | | 36 | CMAKE_ARGS+= -DCMAKE_MODULE_PATH:PATH=${_CMAKE_DIR} |
31 | CMAKE_ARGS+= -DCMAKE_INSTALL_LIBDIR:PATH=lib | | | |
32 | .if ${OPSYS} != "Darwin" | | 37 | .if ${OPSYS} != "Darwin" |
33 | CMAKE_ARGS+= -DCMAKE_SKIP_RPATH:BOOL=TRUE | | 38 | CMAKE_ARGS+= -DCMAKE_SKIP_RPATH:BOOL=TRUE |
34 | .else | | 39 | .else |
35 | CMAKE_ARGS+= -DCMAKE_SKIP_RPATH:BOOL=FALSE | | 40 | CMAKE_ARGS+= -DCMAKE_SKIP_RPATH:BOOL=FALSE |
36 | CMAKE_ARGS+= -DCMAKE_INSTALL_NAME_DIR:PATH=${PREFIX}/lib | | 41 | CMAKE_ARGS+= -DCMAKE_INSTALL_NAME_DIR:PATH=${PREFIX}/lib |
37 | CMAKE_ARGS+= -DOPENAL_INCLUDE_DIR:PATH=/System/Library/Frameworks/OpenAL.framework/Headers | | 42 | CMAKE_ARGS+= -DOPENAL_INCLUDE_DIR:PATH=/System/Library/Frameworks/OpenAL.framework/Headers |
38 | CMAKE_ARGS+= -DOPENGL_INCLUDE_DIR:PATH=/System/Library/Frameworks/OpenGL.framework/Headers | | 43 | CMAKE_ARGS+= -DOPENGL_INCLUDE_DIR:PATH=/System/Library/Frameworks/OpenGL.framework/Headers |
39 | .endif | | 44 | .endif |
| | | 45 | .if defined(CMAKE_USE_GNU_INSTALL_DIRS) && empty(CMAKE_USE_GNU_INSTALL_DIRS:M[nN][oO]) |
| | | 46 | CMAKE_ARGS+= -DCMAKE_INSTALL_LIBDIR:PATH=lib |
40 | CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH=${PKGMANDIR} | | 47 | CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH=${PKGMANDIR} |
41 | .if defined(INFO_FILES) | | 48 | . if defined(INFO_FILES) |
42 | CMAKE_ARGS+= -DCMAKE_INSTALL_INFODIR:PATH=${PKGINFODIR} | | 49 | CMAKE_ARGS+= -DCMAKE_INSTALL_INFODIR:PATH=${PKGINFODIR} |
43 | .endif | | 50 | . endif |
44 | .if defined(USE_PKGLOCALEDIR) && empty(USE_PKGLOCALEDIR:M[nN][oO]) | | 51 | . if defined(USE_PKGLOCALEDIR) && empty(USE_PKGLOCALEDIR:M[nN][oO]) |
45 | CMAKE_ARGS+= -DCMAKE_INSTALL_LOCALEDIR:PATH=${PKGLOCALEDIR}/locale | | 52 | CMAKE_ARGS+= -DCMAKE_INSTALL_LOCALEDIR:PATH=${PKGLOCALEDIR}/locale |
| | | 53 | . endif |
46 | .endif | | 54 | .endif |
47 | | | 55 | |
48 | .if defined(CMAKE_PREFIX_PATH) | | 56 | .if defined(CMAKE_PREFIX_PATH) |
49 | CMAKE_ARGS+=-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH:ts;:Q} | | 57 | CMAKE_ARGS+=-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH:ts;:Q} |
50 | .endif | | 58 | .endif |
51 | | | 59 | |
52 | CMAKE_MODULE_PATH_OVERRIDE+= CMakeLists.txt | | 60 | CMAKE_MODULE_PATH_OVERRIDE+= CMakeLists.txt |
53 | | | 61 | |
54 | ### configure-cmake-override modifies the cmake CMakeLists.txt file in | | 62 | ### configure-cmake-override modifies the cmake CMakeLists.txt file in |
55 | ### ${WRKSRC} so that if CMAKE_MODULE_PATH is set we add our Module | | 63 | ### ${WRKSRC} so that if CMAKE_MODULE_PATH is set we add our Module |
56 | ### directory before any others. | | 64 | ### directory before any others. |
57 | ### | | 65 | ### |
58 | | | 66 | |