diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fa213df6..a30734be5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.8) if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE ) message(FATAL_ERROR "In-source builds are not allowed. @@ -52,13 +52,13 @@ configure_file( ) file(GLOB ExtractorGlob Extractor/*.cpp) file(GLOB ImporterGlob DataStructures/Import*.cpp) -add_library(IMPORT STATIC ${ImporterGlob}) +add_library(IMPORT OBJECT ${ImporterGlob}) set(ExtractorSources extractor.cpp ${ExtractorGlob}) -add_executable(osrm-extract ${ExtractorSources}) +add_executable(osrm-extract ${ExtractorSources} $ $ $ $) file(GLOB PrepareGlob Contractor/*.cpp DataStructures/HilbertValue.cpp DataStructures/RestrictionMap.cpp) set(PrepareSources prepare.cpp ${PrepareGlob}) -add_executable(osrm-prepare ${PrepareSources}) +add_executable(osrm-prepare ${PrepareSources} $ $ $ $) file(GLOB ServerGlob Server/*.cpp) file(GLOB DescriptorGlob Descriptors/*.cpp) @@ -78,17 +78,17 @@ set( ${AlgorithmGlob} ${HttpGlob} ) -add_library(COORDLIB STATIC ${CoordinateGlob}) -add_library(FINGERPRINT STATIC Util/FingerPrint.cpp) -add_library(OSRM ${OSRMSources} Util/GitDescription.cpp Util/FingerPrint.cpp) -add_library(GITDESCRIPTION STATIC Util/GitDescription.cpp) +add_library(COORDINATE OBJECT ${CoordinateGlob}) +add_library(FINGERPRINT OBJECT Util/FingerPrint.cpp) +add_library(OSRM ${OSRMSources} Util/GitDescription.cpp Util/FingerPrint.cpp $) +add_library(GITDESCRIPTION OBJECT Util/GitDescription.cpp) add_dependencies(FINGERPRINT FingerPrintConfigure) add_executable(osrm-routed routed.cpp ${ServerGlob}) -add_executable(osrm-datastore datastore.cpp) +add_executable(osrm-datastore datastore.cpp $ $ $) # Unit tests -add_executable(datastructure-tests EXCLUDE_FROM_ALL UnitTests/datastructure_tests.cpp ${DataStructureTestsGlob}) +add_executable(datastructure-tests EXCLUDE_FROM_ALL UnitTests/datastructure_tests.cpp ${DataStructureTestsGlob} $) # Benchmarks add_executable(rtree-bench EXCLUDE_FROM_ALL Benchmarks/StaticRTreeBench.cpp) @@ -197,13 +197,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} FINGERPRINT GITDESCRIPTION COORDLIB IMPORT) -target_link_libraries(osrm-prepare ${Boost_LIBRARIES} FINGERPRINT GITDESCRIPTION COORDLIB IMPORT) -target_link_libraries(osrm-routed ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM FINGERPRINT GITDESCRIPTION) -target_link_libraries(osrm-datastore ${Boost_LIBRARIES} FINGERPRINT GITDESCRIPTION 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}) @@ -284,28 +284,28 @@ if(WITH_TOOLS OR BUILD_TOOLS) message(STATUS "Activating OSRM internal tools") find_package(GDAL) if(GDAL_FOUND) - add_executable(osrm-components Tools/components.cpp) - target_link_libraries(osrm-components ${TBB_LIBRARIES} IMPORT) + add_executable(osrm-components Tools/components.cpp $ $ $) + target_link_libraries(osrm-components ${TBB_LIBRARIES}) include_directories(${GDAL_INCLUDE_DIR}) target_link_libraries( osrm-components - ${GDAL_LIBRARIES} ${Boost_LIBRARIES} FINGERPRINT GITDESCRIPTION COORDLIB) + ${GDAL_LIBRARIES} ${Boost_LIBRARIES}) install(TARGETS osrm-components DESTINATION bin) else() message(FATAL_ERROR "libgdal and/or development headers not found") endif() add_executable(osrm-cli Tools/simpleclient.cpp) - target_link_libraries(osrm-cli ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM FINGERPRINT GITDESCRIPTION) + target_link_libraries(osrm-cli ${Boost_LIBRARIES} ${OPTIONAL_SOCKET_LIBS} OSRM) target_link_libraries(osrm-cli ${TBB_LIBRARIES}) - add_executable(osrm-io-benchmark Tools/io-benchmark.cpp) - target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES} GITDESCRIPTION) - add_executable(osrm-unlock-all Tools/unlock_all_mutexes.cpp) - target_link_libraries(osrm-unlock-all ${Boost_LIBRARIES} GITDESCRIPTION) + 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 $) + target_link_libraries(osrm-unlock-all ${Boost_LIBRARIES}) if(UNIX AND NOT APPLE) target_link_libraries(osrm-unlock-all rt) endif() - add_executable(osrm-check-hsgr Tools/check-hsgr.cpp) - target_link_libraries(osrm-check-hsgr ${Boost_LIBRARIES} GITDESCRIPTION FINGERPRINT) + add_executable(osrm-check-hsgr Tools/check-hsgr.cpp $) + target_link_libraries(osrm-check-hsgr ${Boost_LIBRARIES}) install(TARGETS osrm-cli DESTINATION bin) install(TARGETS osrm-io-benchmark DESTINATION bin)