From 46794d7d3920efc00328c89c1e2861c93b76bbde Mon Sep 17 00:00:00 2001 From: rikky Date: Tue, 15 Mar 2011 00:47:00 +0000 Subject: [PATCH] Fix:build/cmake:Fixed some linkage dependency. Should also fix maptool linker errors on mingw with installed libint. git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4346 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/CMakeLists.txt | 3 +-- navit/cmake/navit_macros.cmake | 14 ++++++-------- navit/navit/CMakeLists.txt | 44 +++++++++++++++++++++++------------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt index 20a9d91..5a21ca1 100644 --- a/navit/CMakeLists.txt +++ b/navit/CMakeLists.txt @@ -104,7 +104,6 @@ else() CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL) if (NEEDS_LIBINTL) list(APPEND NAVIT_LIBS intl) - set(INTL_LIBS intl) endif(NEEDS_LIBINTL) endif(NOT HAVE_LIBINTL) @@ -119,7 +118,7 @@ if (Glib_FOUND) include_directories(${Glib_INCLUDE_DIRS}) list(APPEND NAVIT_LIBS ${Glib_LIBRARIES}) else(Glib_FOUND) - set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS}) + set_with_reason(support/glib "Glib not found" TRUE) endif(Glib_FOUND) if (Gmodule_FOUND) set(HAVE_GMODULE 1) diff --git a/navit/cmake/navit_macros.cmake b/navit/cmake/navit_macros.cmake index 08647e2..8e6ed62 100644 --- a/navit/cmake/navit_macros.cmake +++ b/navit/cmake/navit_macros.cmake @@ -44,27 +44,25 @@ macro(module_add_library MODULE_NAME ) SET_TARGET_PROPERTIES(${MODULE_NAME} PROPERTIES COMPILE_DEFINITIONS "MODULE=${MODULE_NAME}") TARGET_LINK_LIBRARIES(${MODULE_NAME} ${${MODULE_NAME}_LIBS}) SET_TARGET_PROPERTIES( ${MODULE_NAME} PROPERTIES COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS}") - + if (USE_PLUGINS) - # workaround to be compatible with old paths set_target_properties( ${MODULE_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.libs") - if (ANDROID) - TARGET_LINK_LIBRARIES(${MODULE_NAME} navit) - endif() install(TARGETS ${MODULE_NAME} DESTINATION ${LIB_DIR}/navit/${${MODULE_NAME}_TYPE} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + else() + TARGET_LINK_LIBRARIES(${MODULE_NAME} ${NAVIT_LIBNAME}) endif() endmacro(module_add_library) macro(supportlib_add_library LIB_NAME ) add_library(${LIB_NAME} ${ARGN}) SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS}") - if (USE_PLUGINS) - TARGET_LINK_LIBRARIES(${MODULE_NAME} navit_core) - endif() + if (NOT USE_PLUGINS) + TARGET_LINK_LIBRARIES(${LIB_NAME} ${NAVIT_LIBNAME}) + endif(NOT USE_PLUGINS) endmacro(supportlib_add_library) macro(message_error) diff --git a/navit/navit/CMakeLists.txt b/navit/navit/CMakeLists.txt index fea8258..6e304ae 100644 --- a/navit/navit/CMakeLists.txt +++ b/navit/navit/CMakeLists.txt @@ -4,6 +4,29 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}") include_directories( "${CMAKE_CURRENT_BINARY_DIR}") include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/support") +# navit cre +set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c compass.c config_.c coord.c country.c data_window.c debug.c + event.c file.c graphics.c gui.c item.c layout.c log.c main.c map.c + linguistics.c mapset.c maptype.c menu.c messages.c bookmarks.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c + profile.c projection.c roadprofile.c route.c routech.c search.c speech.c start_real.c sunriset.c transform.c track.c + util.c vehicle.c vehicleprofile.c xmlconfig.c ) + +if(NOT USE_PLUGINS) + list(APPEND NAVIT_SRC ${CMAKE_CURRENT_BINARY_DIR}/builtin.c) +endif(NOT USE_PLUGINS) + +if (${HAVE_GLIB}) + list(APPEND NAVIT_SRC event_glib.c) +endif() + +if(ANDROID) + list(APPEND NAVIT_SRC android.c) + set(NAVIT_LIBNAME navit) +else() + set(NAVIT_LIBNAME navit_core) +endif() + + foreach ( PLUGIN_PATH ${ALL_PLUGINS}) if (${PLUGIN_PATH}) include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_PATH}") @@ -42,26 +65,7 @@ endforeach() add_subdirectory (fib-1.1) -# navit cre -set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c compass.c config_.c coord.c country.c data_window.c debug.c - event.c file.c graphics.c gui.c item.c layout.c log.c main.c map.c - linguistics.c mapset.c maptype.c menu.c messages.c bookmarks.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c - profile.c projection.c roadprofile.c route.c routech.c search.c speech.c start_real.c sunriset.c transform.c track.c - util.c vehicle.c vehicleprofile.c xmlconfig.c ) - -if(NOT USE_PLUGINS) - list(APPEND NAVIT_SRC ${CMAKE_CURRENT_BINARY_DIR}/builtin.c) -endif(NOT USE_PLUGINS) - -if (${HAVE_GLIB}) - list(APPEND NAVIT_SRC event_glib.c) -endif() - -if(ANDROID) - list(APPEND NAVIT_SRC android.c) - set(NAVIT_LIBNAME navit) -else() - set(NAVIT_LIBNAME navit_core) +if(NOT ANDROID) if(WIN32 OR WINCE) add_executable (navit start.c ${CMAKE_CURRENT_SOURCE_DIR}/gui/win32/resources/resource.rc) else() -- 2.7.4