Ticket #832: fix-cmake.patch

File fix-cmake.patch, 8.3 KB (added by pini, 9 years ago)

New release of the patch with a few more fixes and workarounds

  • CMakeLists.txt

    Description: Fix cmake config to produce same packages as with the autotools
     This patch apply various fixes and workaround so that the generated binary
     packages are close to the one generated with the autotools configuration.
    Author: Gilles Filippini <pini@debian.org>
    Forwarded: http://trac.navit-project.org/ticket/832
    Last-Update: 2011-04-11
    old new  
    4747add_module(speech/dbus "dbus-glib-1 not found" FALSE)
    4848add_module(vehicle/gpsd_dbus "dbus-glib-1 not found" FALSE)
    4949add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
     50add_module(map/garmin "Garmin library not found" FALSE)
    5051add_feature(ENABLE_NLS "default" TRUE)
    5152
    5253INCLUDE (CPack)
     
    7879find_package(PkgConfig)
    7980if(PKG_CONFIG_FOUND)
    8081   pkg_check_modules(QUESOGLC quesoglc)
    81    pkg_check_modules(LIBGPSD libgpsd)
     82   pkg_check_modules(LIBGPS libgps)
     83   pkg_check_modules(LIBGPS19 libgps>=2.90)
     84   pkg_check_modules(LIBGARMIN libgarmin)
    8285endif(PKG_CONFIG_FOUND)
    8386#Simple checks
    8487CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP)
     
    156159   include_directories(${FREETYPE_INCLUDE_DIRS})
    157160   set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LIBRARIES}")
    158161   add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/navit/fonts")
     162   pkg_check_modules(FRIBIDI fribidi)
     163   pkg_check_modules(FRIBIDI2 fribidi>=0.19.0)
    159164else(FREETYPE_FOUND)
    160165   MESSAGE("No freetype library found, graphics modules may not be available")
    161166   set_with_reason(graphics/android "FreeType library not found" FALSE)
     
    217222   set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY})
    218223endif(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND)
    219224
    220 if (HAVE_LIBGPS)
     225if (LIBGPS_FOUND)
    221226   set_with_reason(vehicle/gpsd "gpsd lib found" TRUE)
    222 endif(HAVE_LIBGPS)
     227endif(LIBGPS_FOUND)
    223228
    224229if (GYPSY_FOUND)
    225230   set_with_reason(vehicle/gypsy "gypsy lib found" TRUE)
    226231endif(GYPSY_FOUND)
    227232
     233if (HAVE_LIBGARMIN)
     234   set_with_reason(map/garmin "Garmin library found" TRUE)
     235endif(HAVE_LIBGARMIN)
     236
    228237if(DBusGLib_FOUND)
    229238   include_directories(${DBusGLib_INCLUDE_DIRS})
    230239   set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
  • navit/CMakeLists.txt

    old new  
    138138add_subdirectory (maptool)
    139139add_subdirectory (xpm)
    140140add_subdirectory (maps)
    141 add_subdirectory (android)
     141if (ANDROID)
     142   add_subdirectory (android)
     143endif()
    142144
    143145install(TARGETS navit
    144146        DESTINATION ${BIN_DIR}
     
    146148
    147149install(FILES ${CMAKE_CURRENT_BINARY_DIR}/navit.xml
    148150        DESTINATION ${SHARE_DIR}
    149         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
     151        PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
  • navit/font/freetype/CMakeLists.txt

    old new  
    11module_add_library(font_freetype font_freetype.c)
    22
     3if (FRIBIDI_FOUND)
     4   set_property(
     5      TARGET font_freetype
     6      APPEND PROPERTY COMPILE_DEFINITIONS USE_FRIBIDI=1
     7   )
     8   set_property(
     9      TARGET font_freetype
     10      APPEND PROPERTY COMPILE_FLAGS "-I${FRIBIDI_INCLUDE_DIRS}"
     11   )
     12   if (NOT FRIBIDI2_FOUND)
     13      set_property(
     14         TARGET font_freetype
     15         APPEND PROPERTY COMPILE_DEFINITIONS FRIBIDIOLD=1
     16      )
     17   endif (NOT FRIBIDI2_FOUND)
     18   target_link_libraries(font_freetype ${FRIBIDI_LIBRARIES})
     19endif (FRIBIDI_FOUND)
     20
     21if (FONTCONFIG_FOUND)
     22   target_link_libraries(font_freetype ${FONTCONFIG_LIBRARIES})
     23endif (FONTCONFIG_FOUND)
  • new file navit/navit/map/garmin/CMakeLists.txt

    - +  
     1# After the cmake tutorial
     2# http://www.cmake.org/cmake/help/cmake_tutorial.html
     3add_executable(gentypes gentypes.c)
     4
     5# add the command to generate the source code
     6add_custom_command (
     7  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/g2nbuiltin.h
     8  COMMAND gentypes ${CMAKE_CURRENT_SOURCE_DIR}/garmintypes.txt ${CMAKE_CURRENT_BINARY_DIR}/g2nbuiltin.h
     9  DEPENDS gentypes
     10  )
     11
     12module_add_library(map_garmin garmin.c gar2navit.c g2nbuiltin.h)
     13set_property(
     14   TARGET map_garmin
     15   APPEND PROPERTY COMPILE_FLAGS "-I${CMAKE_CURRENT_BINARY_DIR}"
     16)
  • navit/xpm/CMakeLists.txt

    old new  
    5252   endforeach()
    5353endmacro()
    5454
    55 #install(FILES  desktop_icons/navit.desktop DESTINATION share/applications)
    56 #install(FILES  desktop_icons/22x22/navit.png DESTINATION share/icons/hicolor/22x22/apps)
    57 #install(FILES  desktop_icons/128x128/navit.png DESTINATION share/icons/hicolor/128x128/apps)
     55install(FILES  desktop_icons/navit.desktop DESTINATION share/applications)
     56install(FILES  desktop_icons/22x22/navit.png DESTINATION share/icons/hicolor/22x22/apps)
     57install(FILES  desktop_icons/128x128/navit.png DESTINATION share/icons/hicolor/128x128/apps)
    5858#install(FILES  bench.xpm DESTINATION )
    5959
    6060if (USE_SVG OR SVG2PNG)
     
    9797install(
    9898   FILES ${IMAGE_TARGETS}
    9999   DESTINATION ${IMAGE_DIR}
    100    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
     100   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
    101101)
  • navit/vehicle/gpsd/CMakeLists.txt

    old new  
    11module_add_library(vehicle_gpsd vehicle_gpsd.c)
    2 
     2if (LIBGPS19_FOUND)
     3   set_property(
     4      TARGET vehicle_gpsd
     5      APPEND PROPERTY COMPILE_DEFINITIONS HAVE_LIBGPS19=1
     6   )
     7endif (LIBGPS19_FOUND)
     8target_link_libraries(vehicle_gpsd ${LIBGPS_LIBRARIES})
  • navit/graphics/gtk_drawing_area/CMakeLists.txt

    old new  
    11module_add_library(graphics_gtk_drawing_area graphics_gtk_drawing_area.c)
    2 
     2target_link_libraries(graphics_gtk_drawing_area ${GTK2_LIBRARIES})
  • cmake/navit_macros.cmake

    old new  
    5252      # workaround to be compatible with old paths
    5353      set_target_properties( ${MODULE_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.libs")
    5454
     55      message("@@@${MODULE_NAME}\t${${MODULE_NAME}_TYPE}\n")
    5556      install(TARGETS ${MODULE_NAME}
    5657              DESTINATION ${LIB_DIR}/navit/${${MODULE_NAME}_TYPE}
    5758              PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
  • navit/vehicle/file/CMakeLists.txt

    old new  
    11module_add_library(vehicle_file vehicle_file.c)
     2set (vehicle_pipe_TYPE ${vehicle_file_TYPE})
     3set (vehicle_serial_TYPE ${vehicle_file_TYPE})
     4set (vehicle_socket_TYPE ${vehicle_file_TYPE})
    25module_add_library(vehicle_pipe vehicle_pipe.c)
    36module_add_library(vehicle_serial vehicle_serial.c)
    47module_add_library(vehicle_socket vehicle_socket.c)