From 238dd07cf61d02c43af7f6e7b60f5e2ecbf7dc81 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 16 Dec 2013 17:03:17 -0500 Subject: [PATCH 1/2] fix linking order to unbreak linux builds against static protobuf and libz --- CMakeLists.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0abfa9c010..4a6977c0bc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,15 +120,6 @@ target_link_libraries( osrm-prepare ${CoordinateGlob} ${Boost_LIBRARIES} UUID GI target_link_libraries( osrm-routed ${Boost_LIBRARIES} OSRM UUID GITDESCRIPTION ) target_link_libraries( osrm-datastore ${Boost_LIBRARIES} UUID GITDESCRIPTION ) -find_package ( BZip2 REQUIRED ) -include_directories(${BZIP_INCLUDE_DIRS}) -target_link_libraries (osrm-extract ${BZIP2_LIBRARIES}) - -find_package( ZLIB REQUIRED ) -include_directories(${ZLIB_INCLUDE_DIRS}) -target_link_libraries (osrm-extract ${ZLIB_LIBRARY}) -target_link_libraries (osrm-routed ${ZLIB_LIBRARY}) - find_package( Threads REQUIRED ) target_link_libraries (osrm-extract ${CMAKE_THREAD_LIBS_INIT}) @@ -162,11 +153,6 @@ include_directories(${LUABIND_INCLUDE_DIR}) target_link_libraries (osrm-extract ${LUABIND_LIBRARY}) target_link_libraries (osrm-prepare ${LUABIND_LIBRARY}) -find_package( Protobuf REQUIRED ) -include_directories(${PROTOBUF_INCLUDE_DIRS}) -target_link_libraries (osrm-extract ${PROTOBUF_LIBRARY}) -target_link_libraries (osrm-prepare ${PROTOBUF_LIBRARY}) - find_package( STXXL REQUIRED ) include_directories(${STXXL_INCLUDE_DIR}) target_link_libraries (OSRM ${STXXL_LIBRARY}) @@ -178,6 +164,20 @@ 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}) + +find_package ( BZip2 REQUIRED ) +include_directories(${BZIP_INCLUDE_DIRS}) +target_link_libraries (osrm-extract ${BZIP2_LIBRARIES}) + +find_package( ZLIB REQUIRED ) +include_directories(${ZLIB_INCLUDE_DIRS}) +target_link_libraries (osrm-extract ${ZLIB_LIBRARY}) +target_link_libraries (osrm-routed ${ZLIB_LIBRARY}) + if(WITH_TOOLS) message(STATUS "Activating OSRM internal tools") find_package( GDAL ) From bb244646df928cd0cb68a1684dbc52612558f6c1 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 16 Dec 2013 18:49:35 -0500 Subject: [PATCH 2/2] bake gitdescription and uuid into OSRM library to avoid failure points of linking them directly --- CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a6977c0bc3..ca24d3fde1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ file(GLOB HttpGlob Server/Http/*.cpp) file(GLOB LibOSRMGlob Library/*.cpp) set(OSRMSources ${LibOSRMGlob} ${DescriptorGlob} ${DatastructureGlob} ${CoordinateGlob} ${AlgorithmGlob} ${HttpGlob}) -add_library( OSRM SHARED ${OSRMSources} ) +add_library( OSRM SHARED ${OSRMSources} Util/GitDescription.cpp Util/UUID.cpp ) add_library( UUID STATIC Util/UUID.cpp ) add_library( GITDESCRIPTION STATIC Util/GitDescription.cpp ) add_dependencies( UUID UUIDConfigure ) @@ -109,12 +109,7 @@ if(NOT Boost_FOUND) endif(NOT Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) -if(APPLE) - target_link_libraries( OSRM ${Boost_LIBRARIES} UUID ) -else() - target_link_libraries( OSRM ${Boost_LIBRARIES} ) -endif() - +target_link_libraries( OSRM ${Boost_LIBRARIES} ) target_link_libraries( osrm-extract ${CoordinateGlob} ${Boost_LIBRARIES} UUID GITDESCRIPTION ) target_link_libraries( osrm-prepare ${CoordinateGlob} ${Boost_LIBRARIES} UUID GITDESCRIPTION ) target_link_libraries( osrm-routed ${Boost_LIBRARIES} OSRM UUID GITDESCRIPTION )