diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da3d2d..a4dd143 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ include_directories(${PROJECT_SOURCE_DIR} ) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(notdir $(abspath $@))\"'") + add_executable(notification-daemon calendar-daemon.cpp diff --git a/io/debug.h b/io/debug.h index 9e28fc6..9641c2f 100644 --- a/io/debug.h +++ b/io/debug.h @@ -13,8 +13,9 @@ struct X { #endif }; -#define DEBUG (X(), std::cout << "DEBUG[" << __FILE__ << ":" << __LINE__ << " in " << __func__ << "()]: ") -#define WARN (X(), std::cout << "WARN [" << __FILE__ << ":" << __LINE__ << " in " << __func__ << "()]: ") + +#define DEBUG (X(), std::cout << "DEBUG[" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ") +#define WARN (X(), std::cout << "WARN [" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ") #ifdef LOG_DEBUG #define STEP \