Skip to content

Commit c1c5b03

Browse files
dschogitster
authored andcommitted
cmake: better support for out-of-tree builds follow-up
In 7e0730c (t: better support for out-of-tree builds, 2024-12-06), the `bin-wrappers/` strategy was changed so that it no longer hard-codes the template directory to be `@BUILD_DIR@/templates/blt`, but instead interpolates the `@TEMPLATE_DIR@` placeholder during the build. However, this commit only adjusted the `Makefile`-based build. Let's adjust the CMake-based build as well. This fixes t0000.15 which would otherwise fail with: ++ echo ''\''t1234-verbose/err'\'' is not empty, it contains:' 't1234-verbose/err' is not empty, it contains: ++ cat t1234-verbose/err warning: templates not found in @TEMPLATE_DIR@ Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 904339e commit c1c5b03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/buildsystems/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1087,19 +1087,22 @@ set(wrapper_test_scripts
10871087
foreach(script ${wrapper_scripts})
10881088
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10891089
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1090+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
10901091
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/${script}${EXE_EXTENSION}" content "${content}")
10911092
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10921093
endforeach()
10931094

10941095
foreach(script ${wrapper_test_scripts})
10951096
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10961097
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1098+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
10971099
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/t/helper/${script}${EXE_EXTENSION}" content "${content}")
10981100
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10991101
endforeach()
11001102

11011103
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11021104
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1105+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
11031106
string(REPLACE "@GIT_TEXTDOMAINDIR@" "${CMAKE_BINARY_DIR}/po/build/locale" content "${content}")
11041107
string(REPLACE "@GITPERLLIB@" "${CMAKE_BINARY_DIR}/perl/build/lib" content "${content}")
11051108
string(REPLACE "@MERGE_TOOLS_DIR@" "${CMAKE_SOURCE_DIR}/mergetools" content "${content}")

0 commit comments

Comments
 (0)