From d15de117b931921a7ab25ae743b30f4a79088e48 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Wed, 30 Jan 2019 14:24:59 -0600 Subject: [PATCH] Resolve CMAKE_* directories before saving as build defines Since fish began resolving symlinks it broke the running-from-build-dir detection in fish.cpp if the build directory were a symlink (which is common on some platforms where the default user HOME directory is a symlink in the first place, e.g. FreeBSD). --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ebfc73e6..882888c7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,8 +105,10 @@ ADD_DEFINITIONS(-D_UNICODE=1 INCLUDE(Version) # Let fish pick up when we're running out of the build directory without installing -ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}") -ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}") +GET_FILENAME_COMPONENT(REAL_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH) +GET_FILENAME_COMPONENT(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH) +ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}") +ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}") # Teach fish_version.o to rebuild when FBVF changes. # The standard C++ include detection machinery misses this.