move git descriptor into a static library that is linked against all tools
This commit is contained in:
parent
852c648235
commit
ffc361406e
@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
project(OSRM)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
set(HUGO "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(GetGitRevisionDescription)
|
||||
@ -34,14 +33,14 @@ set(BOOST_COMPONENTS filesystem program_options regex system thread)
|
||||
|
||||
configure_file(Util/GitDescription.cpp.in ${CMAKE_SOURCE_DIR}/Util/GitDescription.cpp)
|
||||
file(GLOB ExtractorGlob Extractor/*.cpp)
|
||||
set(ExtractorSources extractor.cpp ${ExtractorGlob} Util/GitDescription.cpp)
|
||||
set(ExtractorSources extractor.cpp ${ExtractorGlob})
|
||||
add_executable(osrm-extract ${ExtractorSources} )
|
||||
|
||||
file(GLOB PrepareGlob Contractor/*.cpp)
|
||||
set(PrepareSources prepare.cpp ${PrepareGlob} Util/GitDescription.cpp)
|
||||
set(PrepareSources prepare.cpp ${PrepareGlob} )
|
||||
add_executable(osrm-prepare ${PrepareSources} )
|
||||
|
||||
add_executable(osrm-routed routed.cpp Util/GitDescription.cpp)
|
||||
add_executable(osrm-routed routed.cpp)
|
||||
set_target_properties(osrm-routed PROPERTIES COMPILE_FLAGS -DROUTED)
|
||||
add_executable(osrm-datastore datastore.cpp)
|
||||
|
||||
@ -52,7 +51,9 @@ file(GLOB LibOSRMGlob Library/*.cpp)
|
||||
set(OSRMSources ${LibOSRMGlob} ${DescriptorGlob} ${DatastructureGlob})
|
||||
add_library( OSRM SHARED ${OSRMSources} )
|
||||
add_library( UUID STATIC Util/UUID.cpp )
|
||||
add_library( GITDESCRIPTION STATIC Util/GitDescription.cpp )
|
||||
add_dependencies( UUID UUIDConfigure )
|
||||
add_dependencies( GITDESCRIPTION GIT_DESCRIPTION )
|
||||
|
||||
# Check the release mode
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
@ -107,10 +108,10 @@ IF( APPLE )
|
||||
ELSE( APPLE )
|
||||
target_link_libraries( OSRM ${Boost_LIBRARIES} )
|
||||
ENDIF( APPLE )
|
||||
target_link_libraries( osrm-extract ${Boost_LIBRARIES} UUID )
|
||||
target_link_libraries( osrm-prepare ${Boost_LIBRARIES} UUID )
|
||||
target_link_libraries( osrm-routed ${Boost_LIBRARIES} OSRM UUID )
|
||||
target_link_libraries( osrm-datastore ${Boost_LIBRARIES} UUID )
|
||||
target_link_libraries( osrm-extract ${Boost_LIBRARIES} UUID GITDESCRIPTION )
|
||||
target_link_libraries( osrm-prepare ${Boost_LIBRARIES} UUID GITDESCRIPTION )
|
||||
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})
|
||||
@ -171,7 +172,7 @@ if(WITH_TOOLS)
|
||||
osrm-components ${GDAL_LIBRARIES} ${Boost_LIBRARIES} UUID
|
||||
)
|
||||
endif(GDAL_FOUND)
|
||||
add_executable ( osrm-cli Tools/simpleclient.cpp Util/GitDescription.cpp)
|
||||
add_executable ( osrm-cli Tools/simpleclient.cpp)
|
||||
target_link_libraries( osrm-cli ${Boost_LIBRARIES} OSRM UUID )
|
||||
add_executable ( osrm-io-benchmark Tools/io-benchmark.cpp )
|
||||
target_link_libraries( osrm-io-benchmark ${Boost_LIBRARIES} )
|
||||
|
Loading…
Reference in New Issue
Block a user