yuzu icon indicating copy to clipboard operation
yuzu copied to clipboard

cmake: fix git detection

Open abouvier opened this issue 1 year ago • 0 comments

When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR, CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.

So if doing an out-of-source build, the GetGitRevisionDescription module will search the .git directory inside the build/binary directory and will not find it (hence the *-NOTFOUND value for some variables). The other solution is to copy the .git directory, before the compilation, inside the future build/binary directory. But including GenerateSCMRev is more straight forward than passing every CMake variable to an external (CMake) script.

abouvier avatar Sep 17 '22 22:09 abouvier