Fix:Build:Made download sample map work
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 4 Oct 2011 18:12:19 +0000 (18:12 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 4 Oct 2011 18:12:19 +0000 (18:12 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4826 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/CMakeLists.txt
navit/navit/maps/CMakeLists.txt

index 97fa256..3ea796e 100755 (executable)
@@ -468,8 +468,10 @@ find_program(BZCAT NAMES bzcat)
 if (SAMPLE_MAP)
    if(CMAKE_CROSSCOMPILING)
       cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE)
+      set(DOWNLOAD_SAMPLE_MAP TRUE)
    elseif(NOT BZCAT)
       cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE)
+      set(DOWNLOAD_SAMPLE_MAP TRUE)
    endif(CMAKE_CROSSCOMPILING)
 endif(SAMPLE_MAP)
 
index 5ed92db..045cd40 100644 (file)
@@ -12,9 +12,9 @@ if(SAMPLE_MAP)
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SAMPLE_MAP_NAME}.osm.bz2
       COMMAND ${CMAKE_COMMAND} -D URL=http://www.navit-project.org/maps/${SAMPLE_MAP_NAME}.osm.bz2 -D DST=${CMAKE_CURRENT_BINARY_DIR}/${SAMPLE_MAP_NAME}.osm.bz2 -P ${PROJECT_SOURCE_DIR}/cmake/navit_download.cmake
    )
-   if(CMAKE_CROSSCOMPILING OR NOT BZCAT)
-      add_custom_command (
-         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SAMPLE_MAP_NAME}.bin
+   if(DOWNLOAD_SAMPLE_MAP)
+      add_custom_target (
+         ${SAMPLE_MAP_NAME}.bin
          COMMAND ${CMAKE_COMMAND} -D URL=http://www.navit-project.org/maps/${SAMPLE_MAP_NAME}.bin -D DST=${CMAKE_CURRENT_BINARY_DIR}/${SAMPLE_MAP_NAME}.bin -P ${PROJECT_SOURCE_DIR}/cmake/navit_download.cmake
       )
    else()