| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: cmake.mk,v 1.18 2020/05/12 17:36:20 rillig Exp $ | | 1 | # $NetBSD: cmake.mk,v 1.19 2020/06/13 15:11:11 ryoon 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 |
| @@ -73,27 +73,29 @@ CMAKE_ARGS+=-DCMAKE_PREFIX_PATH:PATH=${C | | | @@ -73,27 +73,29 @@ CMAKE_ARGS+=-DCMAKE_PREFIX_PATH:PATH=${C |
73 | | | 73 | |
74 | CMAKE_MODULE_PATH_OVERRIDE+= CMakeLists.txt | | 74 | CMAKE_MODULE_PATH_OVERRIDE+= CMakeLists.txt |
75 | | | 75 | |
76 | ### configure-cmake-override modifies the cmake CMakeLists.txt file in | | 76 | ### configure-cmake-override modifies the cmake CMakeLists.txt file in |
77 | ### ${WRKSRC} so that if CMAKE_MODULE_PATH is set we add our Module | | 77 | ### ${WRKSRC} so that if CMAKE_MODULE_PATH is set we add our Module |
78 | ### directory before any others. | | 78 | ### directory before any others. |
79 | ### | | 79 | ### |
80 | | | 80 | |
81 | SUBST_CLASSES+= cmake | | 81 | SUBST_CLASSES+= cmake |
82 | SUBST_STAGE.cmake= do-configure-pre-hook | | 82 | SUBST_STAGE.cmake= do-configure-pre-hook |
83 | SUBST_MESSAGE.cmake= Fixing CMAKE_MODULE_PATH in CMakeLists.txt | | 83 | SUBST_MESSAGE.cmake= Fixing CMAKE_MODULE_PATH in CMakeLists.txt |
84 | SUBST_FILES.cmake= ${CMAKE_MODULE_PATH_OVERRIDE} | | 84 | SUBST_FILES.cmake= ${CMAKE_MODULE_PATH_OVERRIDE} |
85 | SUBST_SED.cmake= \ | | 85 | SUBST_SED.cmake= \ |
86 | 's|set *( *CMAKE_MODULE_PATH |set (CMAKE_MODULE_PATH "${_CMAKE_DIR}" |' | | 86 | -e 's|set *( *CMAKE_MODULE_PATH |set (CMAKE_MODULE_PATH "${_CMAKE_DIR}" |' |
| | | 87 | SUBST_SED.cmake+= \ |
| | | 88 | -e 's|SET *( *CMAKE_MODULE_PATH |SET (CMAKE_MODULE_PATH "${_CMAKE_DIR}" |' |
87 | SUBST_NOOP_OK.cmake= yes # not all packages need this | | 89 | SUBST_NOOP_OK.cmake= yes # not all packages need this |
88 | | | 90 | |
89 | do-configure-pre-hook: __cmake-copy-module-tree | | 91 | do-configure-pre-hook: __cmake-copy-module-tree |
90 | __cmake-copy-module-tree: .PHONY | | 92 | __cmake-copy-module-tree: .PHONY |
91 | ${RUN} cd ${PKGSRCDIR}/mk; ${CP} -R cmake-Modules ${_CMAKE_DIR} | | 93 | ${RUN} cd ${PKGSRCDIR}/mk; ${CP} -R cmake-Modules ${_CMAKE_DIR} |
92 | | | 94 | |
93 | ### The cmake function export_library_dependencies() writes out | | 95 | ### The cmake function export_library_dependencies() writes out |
94 | ### library dependency info to a file and this may contain buildlink | | 96 | ### library dependency info to a file and this may contain buildlink |
95 | ### paths. | | 97 | ### paths. |
96 | ### cmake-dependencies-rewrite modifies any such files, listed in | | 98 | ### cmake-dependencies-rewrite modifies any such files, listed in |
97 | ### ${CMAKE_DEPENDENCIES_REWRITE} (relative to ${WRKSRC}) to have the | | 99 | ### ${CMAKE_DEPENDENCIES_REWRITE} (relative to ${WRKSRC}) to have the |
98 | ### real dependencies | | 100 | ### real dependencies |
99 | ### | | 101 | ### |