Skip to content

Commit b11eaf1

Browse files
JosiahWIjbeder
authored andcommitted
Run format target from project root
The CMake format target does not use the correct .clang-format file in out-of-source builds. This instructs CMake to use the project root as the working directory for running the clang-format command so that it finds the .clang-format file.
1 parent 9f7babc commit b11eaf1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ if (YAML_CPP_FORMAT_SOURCE AND YAML_CPP_CLANG_FORMAT_EXE)
197197
COMMAND clang-format --style=file -i $<TARGET_PROPERTY:yaml-cpp,SOURCES>
198198
COMMAND_EXPAND_LISTS
199199
COMMENT "Running clang-format"
200+
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
200201
VERBATIM)
201202
endif()
202203

0 commit comments

Comments
 (0)