diff --git a/CMakeLists.txt b/CMakeLists.txt index 7efc10a7218..f15935b47ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(CheckCXXCompilerFlag) include(FindPackageHandleStandardArgs) - find_package(Protobuf REQUIRED) if(PROTOBUF_PROTOC_EXECUTABLE STREQUAL "PROTOBUF_PROTOC_EXECUTABLE-NOTFOUND") message(SEND_ERROR "protoc executable not found! Missing protobuf-compiler package?") @@ -20,7 +19,7 @@ endif() include_directories(${PROTOBUF_INCLUDE_DIRS}) file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/Descriptors/*.proto") PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles}) -add_library(messages STATIC ${ProtoSources} ${ProtoHeaders}) +add_library(PBFoutput OBJECT ${ProtoSources} ${ProtoHeaders}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(GetGitRevisionDescription) @@ -62,13 +61,8 @@ configure_file( ${CMAKE_SOURCE_DIR}/Util/git_sha.cpp.in ${CMAKE_SOURCE_DIR}/Util/git_sha.cpp ) -<<<<<<< HEAD file(GLOB ExtractorGlob extractor/*.cpp) file(GLOB ImporterGlob data_structures/import_edge.cpp data_structures/external_memory_node.cpp) -add_library(IMPORT OBJECT ${ImporterGlob}) -======= -file(GLOB ExtractorGlob Extractor/*.cpp) -file(GLOB ImporterGlob DataStructures/ImportEdge.cpp DataStructures/ExternalMemoryNode.cpp) add_library(IMPORT OBJECT ${ImporterGlob} ${ProtoHeaders}) add_library(LOGGER OBJECT Util/simple_logger.cpp) add_library(PHANTOMNODE OBJECT data_structures/phantom_node.cpp) @@ -107,7 +101,7 @@ set( add_library(COORDINATE OBJECT ${CoordinateGlob}) add_library(FINGERPRINT OBJECT Util/finger_print.cpp) add_library(GITDESCRIPTION OBJECT Util/git_sha.cpp) -add_library(OSRM ${OSRMSources} $ $ $ $ $ $) +add_library(OSRM ${OSRMSources} $ $ $ $ $ $ $) add_dependencies(FINGERPRINT FingerPrintConfigure) add_executable(osrm-routed routed.cpp ${ServerGlob} $) @@ -221,13 +215,13 @@ if(NOT Boost_FOUND) endif() include_directories(${Boost_INCLUDE_DIRS}) -target_link_libraries(OSRM ${Boost_LIBRARIES} COORDLIB) -target_link_libraries(osrm-extract ${Boost_LIBRARIES} COORDLIB) -target_link_libraries(osrm-prepare ${Boost_LIBRARIES} COORDLIB) -target_link_libraries(osrm-routed ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM messages) -target_link_libraries(osrm-datastore ${Boost_LIBRARIES} COORDLIB) -target_link_libraries(datastructure-tests ${Boost_LIBRARIES} COORDLIB) -target_link_libraries(rtree-bench ${Boost_LIBRARIES} COORDLIB) +target_link_libraries(OSRM ${Boost_LIBRARIES}) +target_link_libraries(osrm-extract ${Boost_LIBRARIES}) +target_link_libraries(osrm-prepare ${Boost_LIBRARIES}) +target_link_libraries(osrm-routed ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM) +target_link_libraries(osrm-datastore ${Boost_LIBRARIES}) +target_link_libraries(datastructure-tests ${Boost_LIBRARIES}) +target_link_libraries(rtree-bench ${Boost_LIBRARIES}) find_package(Threads REQUIRED) target_link_libraries(osrm-extract ${CMAKE_THREAD_LIBS_INIT}) @@ -267,6 +261,10 @@ else() endif() include_directories(${LUA_INCLUDE_DIR}) +target_link_libraries(osrm-extract ${PROTOBUF_LIBRARY}) +target_link_libraries(osrm-prepare ${PROTOBUF_LIBRARY}) +target_link_libraries(osrm-routed ${PROTOBUF_LIBRARY}) + find_package(EXPAT REQUIRED) include_directories(${EXPAT_INCLUDE_DIRS}) target_link_libraries(osrm-extract ${EXPAT_LIBRARIES}) @@ -287,14 +285,6 @@ include_directories(${OSMPBF_INCLUDE_DIR}) target_link_libraries(osrm-extract ${OSMPBF_LIBRARY}) target_link_libraries(osrm-prepare ${OSMPBF_LIBRARY}) -find_package(Protobuf REQUIRED) -include_directories(${PROTOBUF_INCLUDE_DIRS}) -target_link_libraries(osrm-extract ${PROTOBUF_LIBRARY}) -target_link_libraries(osrm-prepare ${PROTOBUF_LIBRARY}) -target_link_libraries(osrm-routed ${PROTOBUF_LIBRARY}) - - - find_package(BZip2 REQUIRED) include_directories(${BZIP_INCLUDE_DIRS}) target_link_libraries(osrm-extract ${BZIP2_LIBRARIES}) @@ -320,7 +310,7 @@ if(WITH_TOOLS OR BUILD_TOOLS) endif() add_executable(osrm-cli tools/simpleclient.cpp $ $ $) target_link_libraries(osrm-cli ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM) - target_link_libraries(osrm-cli ${TBB_LIBRARIES}) + target_link_libraries(osrm-cli ${TBB_LIBRARIES} ${PROTOBUF_LIBRARY}) add_executable(osrm-io-benchmark tools/io-benchmark.cpp $ $ $) target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES}) add_executable(osrm-unlock-all tools/unlock_all_mutexes.cpp $ $ $)