cmake: Canonicalize binary dir

This would otherwise fail to set $fish_function_path to
share/functions etc if run through a symlink.
This commit is contained in:
Fabian Boehm 2023-09-28 17:30:40 +02:00
parent 7c5777a82a
commit 35baa88334

View file

@ -59,9 +59,12 @@ if(DEFINED WITH_GETTEXT AND NOT "${WITH_GETTEXT}")
set(CMAKE_WITH_GETTEXT "0")
endif()
# CMAKE_BINARY_DIR can include symlinks, since we want to compare this to the dir fish is executed in we need to canonicalize it.
file(REAL_PATH "${CMAKE_BINARY_DIR}" fish_binary_dir)
# Tell Cargo where our build directory is so it can find config.h.
corrosion_set_env_vars(${fish_rust_target}
"FISH_BUILD_DIR=${CMAKE_BINARY_DIR}"
"FISH_BUILD_DIR=${fish_binary_dir}"
"FISH_AUTOCXX_GEN_DIR=${fish_autocxx_gen_dir}"
"FISH_RUST_TARGET_DIR=${rust_target_dir}"
"PREFIX=${CMAKE_INSTALL_PREFIX}"