summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--cmake/navit_macros.cmake11
-rw-r--r--navit/CMakeLists.txt2
-rw-r--r--navit/map/shapefile/CMakeLists.txt7
-rw-r--r--navit/support/shapefile/CMakeLists.txt1
5 files changed, 18 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cc06f016..e1105fb62 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -309,8 +309,11 @@ add_module(map/filter "Default" TRUE)
if(NOT MSVC)
add_module(map/mg "Default" TRUE)
endif(NOT MSVC)
-# cp15 promised to fix the build against the internal libshapefile
-add_module(map/shapefile "Default" FALSE)
+add_module_plugin(support/shapefile "Default" TRUE)
+set(map_shapefile_INCLUDES "${CMAKE_SOURCE_DIR}/navit/support/shapefile")
+#set(map_shapefile_LIBRARY_DIRS "${CMAKE_BINARY_DIR}/navit/support/shapefile")
+set(map_shapefile_LIBS "support_shapefile")
+add_module(map/shapefile "Default" TRUE)
add_module(map/textfile "Default" TRUE)
add_module(map/csv "Default" TRUE)
@@ -556,7 +559,7 @@ endif(EXTRA_DEFINES)
if (NOT NAVIT_DEPENDENCY_ERROR)
message("\nSummary:\n")
- set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULES})
+ set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES})
list(SORT SUMMARY_COMPONENTS)
set(LAST_TYPE NONE)
diff --git a/cmake/navit_macros.cmake b/cmake/navit_macros.cmake
index 4a8dd079d..446905bc8 100644
--- a/cmake/navit_macros.cmake
+++ b/cmake/navit_macros.cmake
@@ -39,12 +39,19 @@ macro(add_plugin PLUGIN_PATH REASON ENABLE)
internal_set(${PLUGIN_PATH} ${REASON} ${ENABLE})
endmacro()
+# module plugins are always linked static
+macro(add_module_plugin PLUGIN_PATH REASON ENABLE)
+ list(APPEND ALL_MODULE_PLUGINS ${PLUGIN_PATH})
+ internal_set(${PLUGIN_PATH} ${REASON} ${ENABLE})
+endmacro()
+
macro(module_add_library MODULE_NAME )
+ LINK_DIRECTORIES(${${MODULE_NAME}_LIBRARY_DIRS})
add_library(${MODULE_NAME} ${MODULE_BUILD_TYPE} ${ARGN})
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}")
-
+ SET_TARGET_PROPERTIES( ${MODULE_NAME} PROPERTIES COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} ${${MODULE_NAME}_FLAGS}")
+ INCLUDE_DIRECTORIES(${${MODULE_NAME}_INCLUDES})
if (USE_PLUGINS)
if (ANDROID)
TARGET_LINK_LIBRARIES(${MODULE_NAME} ${NAVIT_LIBNAME})
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index ce74f9824..43a17ddfa 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -57,7 +57,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/builtin.c.in ${CMAKE_CURRENT_BINARY_D
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/fib-1.1")
# Add module paths
-foreach (CURRENT_MODULE ${ALL_PLUGINS} ${ALL_MODULES})
+foreach (CURRENT_MODULE ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES})
if (${CURRENT_MODULE})
add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE}")
endif()
diff --git a/navit/map/shapefile/CMakeLists.txt b/navit/map/shapefile/CMakeLists.txt
index 7401f7e11..906537a73 100644
--- a/navit/map/shapefile/CMakeLists.txt
+++ b/navit/map/shapefile/CMakeLists.txt
@@ -1,6 +1 @@
-set (map_shapefile_SRC shapefile.c)
-if (NOT HAVE_SYSTEM_SHAPEFILELIB)
- set (map_shapefile_SRC ${map_shapefile_SRC} dbfopen.c shpopen.c shptree.c)
-endif()
-
-module_add_library(map_shapefile ${map_shapefile_SRC})
+module_add_library(map_shapefile shapefile.c)
diff --git a/navit/support/shapefile/CMakeLists.txt b/navit/support/shapefile/CMakeLists.txt
new file mode 100644
index 000000000..03c964329
--- /dev/null
+++ b/navit/support/shapefile/CMakeLists.txt
@@ -0,0 +1 @@
+supportlib_add_library(support_shapefile dbfopen.c shpopen.c shptree.c)