From ffc361406e15307b02e52c3c8e2d2ed66013cf35 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 15 Oct 2013 18:28:14 +0200 Subject: [PATCH] move git descriptor into a static library that is linked against all tools --- CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a8f0e636..890d422eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -50,9 +49,11 @@ file(GLOB DatastructureGlob DataStructures/*.cpp) file(GLOB LibOSRMGlob Library/*.cpp) set(OSRMSources ${LibOSRMGlob} ${DescriptorGlob} ${DatastructureGlob}) -add_library(OSRM SHARED ${OSRMSources}) -add_library(UUID STATIC Util/UUID.cpp) +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} )