Skip to content

Commit

Permalink
cmake: fix missing working directory for version header generation
Browse files Browse the repository at this point in the history
By default `add_custom_command` runs in the current build directory.

This resolves "Commit UNKNOWN" in the generated version header when
the build directory is not a subdirectory of the git working tree.
  • Loading branch information
pcolberg committed Oct 25, 2021
1 parent 57c9d2b commit 950f21d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ add_custom_command(
-D "GIT_FOUND=${GIT_FOUND}"
-D "GIT_EXECUTABLE=${GIT_EXECUTABLE}"
-P "${CMAKE_CURRENT_LIST_DIR}/cmake/scripts/version.cmake"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)

add_library(acl_objs OBJECT
Expand Down

0 comments on commit 950f21d

Please # to comment.