mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 07:40:30 -08:00
20 lines
329 B
CMake
20 lines
329 B
CMake
# expands ~ to user home directory
|
|
#
|
|
# usage:
|
|
# expanduser("~/code" x)
|
|
|
|
function(expanduser in outvar)
|
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.21)
|
|
get_filename_component(out ${in} ABSOLUTE)
|
|
else()
|
|
file(REAL_PATH ${in} out EXPAND_TILDE)
|
|
endif()
|
|
|
|
set(${outvar}
|
|
${out}
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
endfunction(expanduser)
|