From 0c1dcfe9a94531e3a455f158373200bb518afc63 Mon Sep 17 00:00:00 2001 From: xutianchun Date: Mon, 20 Apr 2020 16:16:57 +0800 Subject: [PATCH] fix __FILE__ when soft link --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34b657a9..c3bd83e7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,7 +109,7 @@ else() endif () # force __FILE__ to show relative path of file, from source directory, as cmake project makes __FILE__ absolute directory -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILE__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"' -Wno-builtin-macro-redefined") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILE__='\"$(subst $(realpath ${CMAKE_SOURCE_DIR})/,,$(abspath $<))\"' -Wno-builtin-macro-redefined") # compile libraries from following directories # libgraph is compiled in any situation