summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkoan <jkoan@users.noreply.github.com>2020-01-19 00:07:23 +0100
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2020-01-18 16:07:23 -0700
commit37715fe8301c6ebbc5e85c6f370dd7afd16f5792 (patch)
tree90931ca1b96c0aa7fafe14cc5b5ecbb79e613d44
parentdf8c2e319193ac3c7f8dda4082937b542e1f3a92 (diff)
downloadnavit-37715fe8301c6ebbc5e85c6f370dd7afd16f5792.tar.gz
Fix run when in build dir (#957)
* add:build:core:Add file which is only visible to devs to detect when navit is running in build dir
-rw-r--r--navit/CMakeLists.txt2
-rw-r--r--navit/main.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index 1234bd0cb..5f7ee3cd7 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -3,6 +3,8 @@ include_directories( "${PROJECT_SOURCE_DIR}")
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories( "${CMAKE_CURRENT_BINARY_DIR}")
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/support")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/THIS_IS_THE_NAVIT_WORKING_DIR "\r\nThis File should never appear on binary distributions\r\n" )
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/THIS_IS_THE_NAVIT_WORKING_DIR "\r\nOnly Devs should ever see this file" )
# navit core
set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c config_.c coord.c country.c data_window.c debug.c
diff --git a/navit/main.c b/navit/main.c
index 84ec577aa..0faf44485 100644
--- a/navit/main.c
+++ b/navit/main.c
@@ -355,7 +355,8 @@ void main_init(const char *program) {
setlocale(LC_NUMERIC,"C");
#endif
#if !defined _WIN32 && !defined _WIN32_WCE
- if (file_exists("navit.c") || file_exists("navit.o") || file_exists("navit.lo") || file_exists("version.h")) {
+ if (file_exists("navit.c") || file_exists("navit.o") || file_exists("navit.lo")
+ || file_exists("THIS_IS_THE_NAVIT_WORKING_DIR")) {
char buffer[PATH_MAX];
printf("%s",_("Running from source directory\n"));
if(getcwd(buffer, PATH_MAX)==NULL) { /*libc of navit returns "dummy" */